summaryrefslogtreecommitdiff
path: root/info/install-latex-guide-zh-cn/chapter/editor.tex
blob: 7f5bc50961fe15dfed524a9f395afe3a814c2fa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
% !TeX root = ../install-latex-guide-zh-cn.tex

\chapter{使用编辑器}

\section{Windows 10 系统}

在实际操作中, 用户会发觉使用记事本编写 \texttt{tex} 文件十分不便,
因此很多用户都将其他编辑器作为自己的首选.
这里向大家介绍随 \TeX{} Live 一同发行的轻量级编辑器 \TeX works
和功能更加丰富的
\TeX studio.
其他编辑器无法一一介绍, 还请自己在网上寻求更多帮助. 

\subsection{\TeX works}

\TeX works 是一款轻量级的 \LaTeX 编辑器, 个人认为非常适合入门级用户使用%
\footnote{很多用户在编写 \texttt{tex} 文件时喜欢借助其他工具,
这不是个好习惯, 这里鼓励用户多手动敲代码}. 

和大多数国产软件不同, \TeX works 不会自动在桌面生成快捷方式,
新人往往不知道如何打开它. 
实际上 \TeX works 在 \TeX{} Live 安装路径的
\texttt{\textbackslash bin\textbackslash win32} 中,
可在 \textsf{cmd} 中执行 \texttt{texworks} 打开,
也可直接在 Windows 搜索栏里搜 \TeX works 打开. 

刚开始使用 \TeX works 的用户不必过多配置,
在默认状态下打开软件、编写代码、保存文件后,
用户可使用 \TeX works 的“排版”按钮进行文档编译而不必回到命令行%
\footnote{实际上编辑器的按钮也是调用命令行来编译文档,
\TeX works 默认排版快捷键是 \keys{ctrl + T}}. 
按钮旁边是编译命令菜单, 用户可根据需要自行选择. 

下面介绍几个常用的功能. 

\subsubsection{显示行号}

打开 \menu{编辑 > 首选项 > 编辑器}, 选择 \menu{行号} 即可. 

\subsubsection{调整字体}

\TeX works 有时会擅自更改编辑器所使用的字体,
很多字体``长相''诡异,
让用户误以为是乱码.
用户可在 \menu{编辑 > 首选项 > 编辑器默认配置}
和 \menu{格式 > 字体} 处进行更改.
Windows 10 中字体列表见%
\href{https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list}{这里}.

\subsubsection{自动补全}

自动补全主要是 \keys{tab} 键的功能,
使用前需确定 \menu{首选项 > 编辑器} 中是否勾选了 \menu{启动自动补全}. 
有关自动补全的更多内容用户可参考
\href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 的自动补全功能}. 

\subsubsection{使用模板}

\TeX works支持从模板新建文档, 在 \menu{文件} 菜单中可见. 

\subsubsection{拼写检查}

默认情况, \TeX works没有搭载拼写检查字典, 需要用户自己配置. 
首先, 访问
\href{https://extensions.openoffice.org/dictionary}{openoffice}
下载 \texttt{.oxt} 文件.
将 \texttt{.oxt} 文件重命名为 \texttt{.zip} 文件,
解压缩得到里面的 \texttt{.dic} 和 \texttt{.aff} 文件.
接下来将它们安装到
\texttt{<resources>\textbackslash dictionaries}%
\footnote{\texttt{<resources>} 的具体位置可以在
\menu{帮助 > TeXworks 配置与资源} 中找到,
若不存在该 \texttt{dictionaries} 文件夹,
用户可自行建立.}. 
安装完成后, 在 \menu{编辑 > 拼写} 中选择即可. 

\subsubsection{魔法注释}

魔法注释可以直接规定主文档、文件编码和编译命令等. 
例如用户写学位论文时, 往往有一个主文档和若干子文档. 
在子文档的开头写上魔法注释
\begin{lstlisting}
  % !TeX root = ../main.tex
\end{lstlisting}
即可告诉系统上一级目录中的 \texttt{main.tex} 是主文档%
\footnote{主文档和子文档的更多内容请参考 \texttt{\textbackslash include}
和 \texttt{\textbackslash input} 的用法}. 
\begin{lstlisting}
  % !TeX encoding = UTF8
\end{lstlisting}
表示该文档使用 ``UTF-8'' 编码%
\footnote{目前建议用户多用 ``UTF-8'' 编码, 尤其是中文文档}. 
\begin{lstlisting}
  % !TeX program = xelatex
\end{lstlisting}
表示该文档使用 \texttt{xelatex} 编译命令进行编译. 
\begin{lstlisting}
  % !TeX spellcheck = <language_code>
\end{lstlisting}
表示该文档使用 \texttt{<language\_code>} 进行拼写检查,
它的具体名称请用户到 \menu{编辑 > 拼写} 中查看. 

\subsubsection{转编码}

实际上转编码是很多编辑器都具备的功能. 
在\TeX works右下角有三个按钮,
左边按钮控制换行符类型, 中间按钮控制文档编码, 右边按钮控制行跳转. 
目前大部分中文用户主要面临的是``UTF-8''和``GBK''之间的转换. 
如果文档是``GBK''编码, 使用\TeX works打开文件后, 文档会出现乱码. 
这时, 点中间按钮, 选择编码类型``GBK'', 再点击按钮,
选择 \menu{使用所选编码重载文档}, 若文档中乱码消失, 则再次点击按钮,
选择``UTF-8'', 最后保存文档, 完成转码工作. 

除以上内容外, \TeX works 还支持正则表达式、自定义快捷键等. 
这些内容都写在 \TeX works 自带的手册中. 
手册不长, 用户可以通读一遍以了解更多内容.
很多功能可以通过\textbf{菜单栏}找到,
因此建议用户稍微了解一下它的菜单栏.

\subsection{\TeX studio}

相较于 \TeX works, \TeX studio 功能更丰富, 用法更多.
在使用 \TeX studio 前,
用户一定要查询\textbf{环境变量}中是否有 \texttt{system32}.
具体方法在前面已有说明, 此处不再赘述.
以下有关 \TeX studio 的用法介绍,
还请用户提前在 \menu{Options > configure TeXstudio} 中勾选
\menu{Show Advanced Options}.

\subsubsection{下载方法}

\TeX studio 有自己的%
\href{http://texstudio.sourceforge.net/}{官方网站},
但因网络原因,
打开不便.
网站上提供的下载链接跳转到了 github 上,
有兴趣的朋友可以直接到 github 上查看%
\href{https://github.com/texstudio-org/texstudio}{源码}%
和%
\href{https://github.com/texstudio-org/texstudio/releases}{可执行文件};
而清华大学也提供了相应的%
\href{https://mirrors.tuna.tsinghua.edu.cn/github-release/texstudio-org/texstudio/LatestRelease/}{镜像},
便于用户下载.
此外,
有%
\href{https://d.serctl.com}{第三方网站}%
可以辅助用户下载 github 上的发行文件,
网站提供了下载教程,
这里不再展开.

\subsubsection{更改默认编译命令}

在 \menu{Options > configure TeXstudio > build > default compiler}
中选择默认编译命令. 

另外用 \texttt{latexmk} 和 \texttt{biblatex} 做编译时,
需要在 \menu{Options > Configure TeXstudio > build > Build Options}
中取消 \menu{Check and update bibliography before compiling}. 

\subsubsection{显示行号}

在 \menu{Editor > Show Line Numbers} 选择行号如何显示.

\subsubsection{数学符号表}

在 \TeX studio 左下角有两个按钮:
\menu{Side Panel} 和 \menu{Messages / Log file}.
打开 \menu{Side Panel},
点击软件左侧边栏第 3 个图标 \menu{Symbols}.


\subsubsection{插入、改写调整}

与很多其他编辑器一样,
\TeX studio 也可以通过键盘 \keys{insert}
改变插入、改写状态.
分别处于插入、改写状态时,
编辑器光标会呈现不同的样子.

\subsubsection{调整缩进}

在 \menu{Options > Configure TeXstudio > Editor > Indentation Mode}
处可以选择是否保持缩进.
如果需要让缩进完全变为空格,
勾选 \menu{Replace Indentation Tab by Spaces}.

在 \menu{Adv. Editor > Appearance} 中可以更改 \menu{Tab Widths}.

\subsubsection{块选择模式}

同时按 \keys{Ctrl + Alt} 便可通过鼠标左键进行块选择.

\subsubsection{调整图标大小}

有些用户屏幕分辨率高,
因此软件上图标会显得很小.
在 \menu{Options > Configure TeXstudio > Gui Scaling} 处可以调整三处的显示比例.

\subsubsection{自动补全和未识别代码}

\TeX studio 自动补全功能会先通过用户引用的宏包来判断代码是否需要自动补全, 
同时它也可以以此判定用户输入的命令是否正确.
若系统判断命令无法识别,
则该命令会出现红色背景.

\TeX studio 能够识别的命令全部被写入了
\href{https://github.com/texstudio-org/texstudio/tree/master/completion}{cwl 文件}
中. 
用户可以根据自己的需要更改 cwl 文件,
然后将其放入
\texttt{<settings directory>\textbackslash completion\textbackslash user}
文件夹%
\footnote{点击 \menu{Help > Check LaTeX Installation},
在生成的 \texttt{System Report.txt} 中找到 \texttt{texstudio.ini} 文件,
其所在文件夹即为 \texttt{<settings directory>}}. 

自动补全后有可能生成文本框,
使用 \keys{\ctrl + \arrowkey{>}} 可以跳转至下一个文本框,
\keys{\ctrl + \arrowkey{<}} 则可以跳转至上一个. 

\subsubsection{拼写检查}

在
\menu{Options > Configure TeXstudio > Language Checking > Default Language}
处选择 \texttt{en\_US} 即可默认进行英文拼写检查.

\subsubsection{魔法注释}

除了像 \TeX works 中使用魔法注释外, \TeX studio 还有很多其他的魔法注释, 例如
\begin{lstlisting}
  % !TeX TXS-program:compile = txs:///latexmk/{}[-xelatex -synctex=1 -interaction=nonstopmode ?me"]
\end{lstlisting}
表示使用 \texttt{latexmk} 编译命令,
\texttt{\{\}} 表示无视编辑器赋予该命令的一切参数,
而 \texttt{[]} 表示添加其中的参数进行编译,
本例中添加 \texttt{-xelatex -synctex=1 -interaction=nonstopmode} 作为参数.
如果用户不清楚魔法注释都可以写哪些类型,
可以点击 \menu{LaTeX > Add magic comments} 查看五种魔法注释类型.
更多内容需要阅读软件手册.

\subsubsection{渲染方式}

默认的渲染方式对中文括号的支持不够好. 
用户可以在 \menu{Options > Configure TeXstudio > Adv. Editor > Hacks/Workarounds} 中取消
\menu{Try to automatically choose best display options},
选择 \menu{Disable cache of character width} 和 \menu{Disable fixed pitch mdoe}.
这样能够比较好地渲染中文括号. 

\subsubsection{转编码}

\TeX studio 右下角有一处显示文档编码 (Encoding). 
依旧以``UTF-8''和``GBK''之间的转换为例. 
如果文档是``GBK''编码, 使用 \TeX studio 打开文件后,
点击 \menu{Encoding} 处, 选择 \menu{More Encodings}.
打开窗口后, 选择``GBK / ...'', 点击 \menu{Reload With}.
若这时文档没有乱码, 再点击 \menu{Encoding > More Encodings},
选择``UTF-8'', 点击 \menu{Change To}, 保存文件, 完成转码.
在 \menu{Edit > Setup Encoding ...} 处同样可以打开编码窗口.

\subsubsection{自定义命令并生成按钮}

\TeX studio 允许用户自定义命令, 并将命令做成按钮放置于面板上.
如在 \menu{Options > Configure TeXstudio > Build > User commands} 中,
填写名称 \texttt{User1:Build-xe-view}
和对应的功能
\begin{lstlisting}
  latexmk -pdfxe -silent -synctex=1 -interaction=nonstopmode ?me" | txs:///view-pdf-internal --embedded
\end{lstlisting}
点击 \menu{OK}. 
接下来我们在 \menu{Tools > User} 中即可看到自定义的命令和相应快捷键.

接下来设置按钮.
打开 \menu{Options > Configure TeXstudio > Toolbars},
在两个下拉菜单中分别选择 \menu{Tools} 和 \menu{All menus},
在右边找到 \menu{Tools > User > Build-xe-view} 并将其添加至左端,
点击 \menu{OK}. 
这时, 在面板中将添加新的按钮. 

\subsubsection{生成宏指令}

\TeX studio 允许用户生成宏指令.
在 \menu{Macros > Edit Macros} 中, 用户可以根据自己的需要,
给出宏指令的名称、快捷键、内容等等.
例如我们将 \texttt{latexmk-pdf} 填写在 \menu{name} 中,
将
\begin{lstlisting}
  % !TeX TXS-program:compile = txs:///latexmk/{}[-pdf -synctex=1 -interaction=nonstopmode ?me"]
\end{lstlisting}
填写在 \menu{LaTeX Content} 中,
再将 \texttt{Shift+F1} 填写在 \menu{Shortcut}.
设置完毕后, 点击 \menu{OK}.
这时, 我们可以看到 \menu{Macros > latexmk-pdf} 出现.
在文档特定位置点击它或者直接使用 \keys{\shift + F1}, 即可看到魔法注释出现.

\subsubsection{更改颜色方案}

有一些用户喜欢深色的颜色方案.
手动修改颜色不方便的话, 我们可以从网上找到一些现成的颜色方案,
例如
\href{https://tex.stackexchange.com/questions/108315/how-can-i-set-a-dark-theme-in-texstudio}{stackexchange 网站}%
和%
\href{https://robjhyndman.com/hyndsight/dark-themes-for-writing/}{某些用户的博客}.
更改方案只需要打开 \texttt{ini} 文件,
将这些颜色方案复制到 \texttt{[formats]} 部分.
在 \menu{Help > Check LaTeX Installation}
中有 \texttt{ini} 文件的具体位置.

\subsubsection{调用外部 PDF 阅读器}

\TeX studio 已经内嵌了 PDF 阅读器供用户预览编译结果,
但一些用户喜欢使用外部 PDF 阅读器.
这里以 \href{https://www.sumatrapdfreader.org/free-pdf-reader.html}{SumatraPDF} 为例,
用户直接安装或下载便携版均可,
假定它在本地的位置为 \texttt{<SumatraPDFROOT>},
而 \TeX studio 在本地的位置是 \texttt{<TeXstudioROOT>}.
打开 \menu{Options > Configure TeXstudio} 窗口,
在 \menu{Build > User commands} 中添加
\begin{lstlisting}
  "<SumatraPDFROOT>\SumatraPDF.exe" -reuse-instance -forward-search ?c:rme" @ -inverse-search "<TeXstudioROOT>\texstudio.exe %%f -line %%l" "?m.pdf"
\end{lstlisting}
将其命名为 \texttt{user0:sumatrapdf}.
接下来, 在 \menu{Build > Build \& View} 中将
\texttt{txs:///compile | txs:///view} 改为
\texttt{txs:///compile | txs:///user0}.
最后, 在 \menu{Menus} 中将 \texttt{\&View} 的命令由
\texttt{txs:///view} 改为 \texttt{txs:///user0}.
完成以上设置后,
关闭窗口.
这时,
用户使用快捷键 \keys{F5} 和 \keys{F7} 均可打开 SumatraPDF 并且实现了正向搜索.
如果有人喜欢在编译时添加参数 \texttt{--outdir=temp},
那么可以将 \texttt{user0:sumatrapdf} 改为
\begin{lstlisting}
  "<SumatraPDFROOT>\SumatraPDF.exe" -reuse-instance -forward-search ?c:rme" @ -inverse-search "<TeXstudioROOT>\texstudio.exe %%f -line %%l" "?r)temp\?m.pdf"
\end{lstlisting}

如果以上设置没能正确实现正反向搜索,
那么可以将 \texttt{user0:sumatrapdf} 改为
\begin{lstlisting}
  dde:///"<SumatraPDFROOT>\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?m.pdf",?c:rme",@,0,0,1)]
\end{lstlisting}
其他不变.
而后用 SumatraPDF 打开生成的 PDF 文件,
在 \menu{Settings > Options > Set inverse search command line} 中输入
\begin{lstlisting}
  "<TeXstudioROOT>\texstudio.exe" "%f" -line %l
\end{lstlisting}
至此完成了逆向搜索,
双击 PDF 文件便可回到 \TeX studio 中对应代码的行首.

\section{Ubuntu 20.04 系统}

简化起见, 这里只介绍如何使用 \TeX studio.
根据官网推荐, 我们安装源内的 \TeX studio.
安装前可参照 \ref{subsec:fc-cache}~节的介绍换源以增速.

在 \textsf{Terminal} 中执行
\begin{lstlisting}[language = bash]
  sudo apt install texstudio
\end{lstlisting}
即可安装 \TeX studio.
注意安装过程中会产生一些依赖, 它们包括了源内的 \TeX{} live 包, 如 \texttt{tex-common}, \texttt{texlive-base}, \texttt{texlive-binaries}, \texttt{texlive-latex-base} 和 \texttt{texlive-latex-recommended}.
用户需要卸载它们.

当然用户也可以使用
\href{https://code.launchpad.net/~sunderme/+archive/ubuntu/texstudio}{PPA}
来安装 \TeX studio.
以此在 \textsf{Terminal} 中执行
\begin{lstlisting}[language = bash]
  sudo add-apt-repository ppa:sunderme/texstudio
  sudo apt update
  sudo apt install texstudio
\end{lstlisting}
鉴于网络原因,
直接从 PPA 下载容易丢包.
这里介绍中科大的\href{https://lug.ustc.edu.cn/wiki/mirrors/help/revproxy/}{反向镜像},
将
\begin{lstlisting}[language = bash]
  /etc/apt/sources.list.d/
\end{lstlisting}
中文件的内容
\begin{lstlisting}
  http(s)://ppa.launchpad.net
\end{lstlisting}
改为
\begin{lstlisting}
  https://launchpad.proxy.ustclug.org
\end{lstlisting}
而后再
\begin{lstlisting}[language = bash]
  sudo apt update
\end{lstlisting}
即完成换源.
有时地址太多而逐个换太麻烦,
可以直接使用如下命令直接替换\footnote{参见 \url{https://mogeko.me/2018/035/}}
\begin{lstlisting}[language = bash]
  sudo find /etc/apt/sources.list.d/ -type f -name "*.list" -exec  sed  -i.bak -r  's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 https\2://launchpad.proxy.ustclug.org#ig' {} \;
\end{lstlisting}

安装完毕后,
用户可以在 \textsf{Terminal} 中执行
\begin{lstlisting}[language = bash]
  texstudio main.tex
\end{lstlisting}
使用 \TeX studio 编辑文档.
也可直接双击 \texttt{main.tex} 文件.

注意, 在双击打开时, 用户需要在
\menu{Options > Configure TeXstudio} 中点击
\menu{Show Advanced Options},
接下来在 \menu{Build > Build Options > Commands (\${}PATH)}
中添加路径,
默认安装时为
\begin{lstlisting}
  /usr/local/texlive/2020/bin/x86_64-linux
\end{lstlisting}

其他设置可参考前文, 这里不再赘述.

\section{macOS}

这里介绍两款 macOS 下的编辑器:
\TeX Shop 和 \TeX studio.

\subsection{\TeX Shop}

Mac\TeX{} 自带 \TeX Shop 编辑器 (注意不要与其他自带的程序混淆),
通常在安装完毕后便可立即使用.
通过编辑器打开 \texttt{main.tex},
将排版程序 (工具栏上面左数第二个下拉菜单) 由默认的 \menu{LaTeX} 切换到
\menu{pdflatexmk},
再点击旁边的排版 \menu{排版} (\menu{Typeset}),
待编译完成后会弹出 PDF 预览界面.

编译中文文档, 通常需要将排版程序切换到 \menu{XeLaTeX}.
注意可能需要多次编译以生成正确的交叉引用等内容.

\subsection{\TeX studio}

如果希望使用 \TeX studio, 也可以通过 Homebrew 安装:
\begin{lstlisting}[language=bash]
  brew cask install texstudio
\end{lstlisting}
注意因为网络问题可能会下载失败.
这时可能需要从其他途径获得安装包并手工安装, 此处不再赘述.
其他设置与 Windows 系统中大致相仿.

\subsubsection{无法显示文字}

\TeX studio 在 macOS 下有可能无法显示文字,
这是其他系统下目前没有发现的问题.
具体解决方法见%
\href{https://zhuanlan.zhihu.com/p/80728204}{李阿玲在知乎的文章}.

\section{Windows Subsystem for Linux}

若使用 \TeX studio,
则需要将 \texttt{bash.exe} 及其绝对路径写入编译命令中.
使用
\href{https://www.voidtools.com/zh-cn/}{everything}
搜索时会发现多个 \texttt{bash.exe},
这里我们选择在路径
\texttt{C:\textbackslash Windows\textbackslash WinSxS...}
下的 \texttt{bash.exe}.
若该路径下仍有多个 \texttt{bash.exe},
则挑选与
\texttt{C:\textbackslash Windows\textbackslash System32}
同等大小的.

下面给出一个例子.
仿照前述建立用户自定义命令的方法,
在
\menu{Options > Configure TeXstudio > Build > User commands}
中,
填写名称
\texttt{User4:bash}
和功能\footnote{这里省略了中间路径, 用户根据自己的情形进行补充即可}
\begin{lstlisting}
  "C:\Windows\WinSxS\...\bash.exe" -i -c "latexmk -xelatex -synctex=1 -interaction=nonstopmode -halt-on-error -file-line-error ?me)"
\end{lstlisting}
点击 \menu{OK}. 
接下来打开 \menu{Options > Configure TeXstudio > Toolbars},
在两个下拉菜单中分别选择 \menu{Tools} 和 \menu{All menus},
在右边找到 \menu{Tools > User > bash} 并将其添加至左端, 点击 \menu{OK}. 
这时, 在面板中将添加新的按钮. 

遗憾的是, 由于路径表达方式不同, \TeX studio 无法正常使用正反搜索.
这个问题的一个可选择解决方案是在 WSL 中安装图形界面并使用 X Server,
这样可直接将 \TeX studio 安装至 WSL,
这里不讨论此方案的优劣.

\section{其他编辑器}

\href{https://code.visualstudio.com/}{VS Code} 目前已有插件
\href{https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop}{LaTeX Workshop}
供用户使用.
具体设置方式建议阅读插件手册,
一些网友的教程可以参考,
如
\href{https://github.com/EthanDeng/vscode-latex}{EthanDeng 的教程}.
另外,
VS Code 的
\href{https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl}{Remote-WSL}
插件可以帮助用户更方便地使用 WSL.
参考配置文件见附录~\ref{chp:appendix:wsl}.

\href{https://www.vim.org/}{Vim} 是一款优秀的编辑器,
它的用法较目前常见的编辑器有很大不同,
因此用户上手时容易感觉无所适从,
但熟练掌握用法后,
用户将很容易对其进行定制.
\href{http://vim-latex.sourceforge.net/}{Vim-LaTeX}
尝试提供一套全面的工具来查看、编辑和编译LaTeX文档,
用户可以考虑使用.

\section{多款编辑器对比参考}

显然, 能够支持 \LaTeX{} 的编辑器并不局限于本手册所介绍的几款.
表~\ref{tab:editor} 是 \href{https://ddswhu.me/}{ddswhu} 在 \LaTeX{}
小圈子内部对 \LaTeX{} 编辑器所进行的用户体验调查的结果, 比较主观, 仅供参考.
其中 Sublime Text 和 Visual Studio Code 为文本编辑器,
它们需要借助插件才能支持 \LaTeX{} 编译.
对自己网络非常自信的用户也可以参考
\href{https://en.wikipedia.org/wiki/Comparison_of_TeX_editors}{wikipedia}
上的对比结果.

\begin{table}[htbp]
  \centering
  \caption{\LaTeX{} 编辑器对比}
    \begin{tabular}{cccccc}
    \toprule
             &  WinEdt      &  \TeX studio  & \TeX works   &  Sublime Text &  VS Code     \\
             \cline{5-6}
    插件依赖  &        &   &  &  \href{https://latextools.readthedocs.io/en/latest/}{\LaTeX{}Tools} &  \href{https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop}{\LaTeX{} Workshop}   \\
    \midrule
    主流系统  &  Win          &  全平台        & Linux/Win     &  全平台        &  全平台       \\
    软件类型  &  商业软件      &  开源软件       & 开源软件       &  商业软件       &  开源软件     \\
    软件价格  &  \href{https://item.taobao.com/item.htm?id=551105790596}{219 元}       &  0             &  0            &  \href{https://www.sublimehq.com/store/text}{80 美元}        &  0           \\
    授权方式  &  终身/教育     &               &               &  终身/个人      &               \\
    % 附加信息  &  教育版本      &               &               &  三年更新       &               \\
    代码高亮  &  \stars{2.7}  &  \stars{3.2}  &  \stars{1.5}  &  \stars{4.3}  &  \stars{4.5}  \\
    颜色主题  &  \stars{2.3}  &  \stars{2.2}  &  \stars{1.0}  &  \stars{4.0}  &  \stars{4.0}  \\
    自动补全  &  \stars{2.7}  &  \stars{3.4}  &  \stars{2.0}  &  \stars{3.5}  &  \stars{4.0}  \\
    代码片段  &  \stars{2.7}  &  \stars{2.4}  &  \stars{0.5}  &  \stars{3.8}  &  \stars{4.0}  \\
    辅助输入  &  \stars{4.0}  &  \stars{3.4}  &  \stars{0.5}  &  \stars{2.3}  &  \stars{3.3}  \\
    开发完成  &  \stars{4.0}  &  \stars{3.8}  &  \stars{4.5}  &  \stars{3.5}  &  \stars{4.0}  \\
    推荐指数  &  \stars{2.7}  &  \stars{4.0}  &  \stars{1.5}  &  \stars{3.0}  &  \stars{4.3}  \\
    \bottomrule
    \end{tabular}%
  \label{tab:editor}%
\end{table}%