VScode使用Latex注意(IEEE论文投稿)
VScode配置Latex可看 基于Visual Studio Code的 LaTeX环境配置及使用示例(超详细)
以下为个人使用时的一些问题及解决方案
1. VScode配置文件(setting.json)
通过VScode进入文件夹,在文件夹中按下 **ctrl+shift+P ** 打开首选项会出现一个setting.json文件,在文件夹中直接粘贴以下内容
{
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.showContextMenu": true,
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
"latex-workshop.latex.tools": [
// 编译工具和命令
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
},
{
"name": "biber",
"command": "biber",
"args": [
"%DOCFILE%"
]
}
],
// 设置编译方法
"latex-workshop.latex.recipes": [
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "pdf->biber->pdf->pdf",
"tools": [
"pdflatex",
"biber",
"pdflatex",
"pdflatex"
]
},
{
"name": "xelatex",
"tools": [
"xelatex"
],
},
{
"name": "xe->biber->xe->xe",
"tools": [
"xelatex",
"biber",
"xelatex",
"xelatex"
]
},
{
"name": "xe->bibtex->xe->xe",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
}
],
"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"
],
"latex-workshop.latex.autoClean.run": "onFailed",
"latex-workshop.latex.recipe.default": "lastUsed",
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
"latex-workshop.view.pdf.viewer": "external",
"latex-workshop.view.pdf.ref.viewer":"auto",
"latex-workshop.view.pdf.external.viewer.command": "C:/Users/19401/AppData/Local/SumatraPDF/SumatraPDF.exe", // 注意修改路径
"latex-workshop.view.pdf.external.viewer.args": [
"%PDF%"
],
"latex-workshop.view.pdf.external.synctex.command": "C:/Users/19401/AppData/Local/SumatraPDF/SumatraPDF.exe", // 注意修改路径
"latex-workshop.view.pdf.external.synctex.args": [
"-forward-search",
"%TEX%",
"%LINE%",
"%PDF%"
]
}
以上内容包含配置外部pdf的代码
2. 使用外部pdf阅读器配置注意(SumatraPDF)
-
VScode内部配置:在setting.json末尾加入以下代码即可
"latex-workshop.view.pdf.viewer": "external", "latex-workshop.view.pdf.ref.viewer":"auto", "latex-workshop.view.pdf.external.viewer.command": "C:/Users/19401/AppData/Local/SumatraPDF/SumatraPDF.exe", // 注意修改路径 "latex-workshop.view.pdf.external.viewer.args": [ "%PDF%" ], "latex-workshop.view.pdf.external.synctex.command": "C:/Users/19401/AppData/Local/SumatraPDF/SumatraPDF.exe", // 注意修改路径 "latex-workshop.view.pdf.external.synctex.args": [ "-forward-search", "%TEX%", "%LINE%", "%PDF%" ]
“latex-workshop.view.pdf.external.viewer.command”: 以及**“latex-workshop.view.pdf.external.synctex.command”😗*此处路径使用最佳电脑安装SumatraPDF的实际位置,注意桌面快捷方式对应的文件保存位置非实际位置,一定是下载的位置
-
SumaPDF配置:打开 设置->高级选项 。对应位置修改为如下语句:
InverseSearchCmdLine = "D:\Microsoft VS Code\Code.exe" --goto %f:%l EnableTeXEnhancements = true
InverseSearchCmdLine一定要修改为最佳电脑实际VScode.exe实际位置,而非快捷方式位置
3. 编译时注意
编译IEEE文章需使用pdfLatex,使用texlive默认的xeLatex编译会报很多不符合论文的警告甚至报错,字体对不上则警告:Some font shapes were not available, defaults substituted.
IEEE警告原因及处理: LaTeX Warnings: Unused global option(s)
更多关于投稿IEEE文章的注意可看:
-
Latex 报错 “ I can‘t write on file ‘xxx.pdf‘. please type another file name for output “ 主要是不要打开其他例如福昕PDF阅读器,WPS等除编辑器以及SumatraPDF软件之外的阅读PDF的阅读软件查看当前正在写的论文PDF文档,使用则会报以上错误
-
缩进问题:两段文字间空出一行即可重起一段且换行。
要是不要打开其他例如福昕PDF阅读器,WPS等除编辑器以及SumatraPDF软件之外的阅读PDF的阅读软件查看当前正在写的论文PDF文档,使用则会报以上错误
- 缩进问题:两段文字间空出一行即可重起一段且换行。
- \IEEEpubid版权声明与正文内容重叠
[外链图片转存中…(img-ePLHJAQk-1704797845124)]