Mac环境下,VSCode配置Latex
2020-9-15
VSCode配置Latex
VSCode配置Latex 的操作
-
安装 VSCode. 参考官网
-
在扩展中安装 Latex workshop
在VSCode配置 Latex 遇到的问题
1. 配置 Latex 对 xelatex 无法运行 ??
- Latex 默认的编辑方式时 latexmk, 需要运行xelatex,需要对settings.json 进行修改。修改方式如下
- 打开 settings --> 搜索 settings.json -->对其修改,把下面代码复制上去–> 重启Vscode
{
"latex-workshop.latex.recipes": [{
"name": "xelatex",
"tools": [
"xelatex"
]
}, {
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.latex.tools": [{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
}, {
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
}, {
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
}, {
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}],
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
"editor.fontSize": 20,
"editor.minimap.size": "fill",
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"markdown.preview.breaks": true,
"editor.wordWrap": "on",
"files.autoSave": "afterDelay",
"vim.startInInsertMode": true,
"editor.quickSuggestions": null,
}
- 参考 VSCode + Latex 配置
VSCode + Latex 配置
2. 如何 设置 latex 文档对齐方式?
- 打开 settings --> 在常用设置中找到 Editor: Word Wrap --> 选取对齐方式
3. vscode 无法输入字符是什么原因?
-
修改vscode文本编辑器默认的输入方式
-
vscode的文本编辑器继承了linux上vim的功能。用vscode打开源文件后,可能默认的模式是一般模式,这种模式下是不能输入字符的,对于用惯了windows的人来说是非常不习惯的。如何将默认的模式更改为插入模式呢。File-Preferences-Settings,搜索vim.startInInsertMode,在Start in Insert mode前面打上勾。
-
打开 settings --> 搜索 vim.startInInsertMode -->Start in Insert mode前面打上勾
如图
- 更新中…