BIT-thesis / LaTeX-template

LaTeX template for BIT thesis
362 stars 92 forks source link

如果用XeTex engine编译,最好加上这么一句话。 #22

Open blizzardwj opened 7 years ago

blizzardwj commented 7 years ago

我用的是texlive+sublime text 3,插件用的是LatexTools,如果直接编译demo.tex默认用的pdflatex engine。 如果在开头加上“% !TEX program = XeLaTeX”不包含引号,可以切换成xelatex engine。 参考:https://tex.stackexchange.com/questions/226380/how-to-change-typesetting-engine-by-adding-code-to-tex-file

y-yating commented 6 years ago

好的~谢谢

minwei-s commented 6 years ago

用sublime text3的话,可以在tools -> build with里直接选择XeLaTeX编译。下次ctrl+b就默认XeLaTeX了。

598753468 commented 6 years ago

可以专门写个教程把各个编辑器的写法都写一下,我用的是vs code和latex workshop插件,可以添加以下设置

"latex-workshop.latex.toolchain": [
    {
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-no-pdf",
            "-interaction=nonstopmode",
            "%DOC%"
        ]
    },
    {
        "command": "bibtex",
        "args": [
            "%DOCFILE%"
        ]
    },
    {
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-no-pdf",
            "-interaction=nonstopmode",
            "%DOC%"
        ]
    },
    {
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "%DOC%"
        ]
    }
]

另外可以加上这段,隐藏不需要关心的文件

"files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/*.aux": true,
    "**/*.log": true,
    "**/*.xdv": true,
    "**/*.toc": true,
    "**/*.out": true,
    "**/*.fls": true,
    "**/*.fdb_latexmk": true,
    "**/*.blg": true,
    "**/*.bbl": true,
    "**/*.bst": true,
    "**/*.cls": true
}
liuliping0315 commented 4 years ago

可以专门写个教程把各个编辑器的写法都写一下,我用的是vs code和latex workshop插件,可以添加以下设置

"latex-workshop.latex.toolchain": [
    {
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-no-pdf",
            "-interaction=nonstopmode",
            "%DOC%"
        ]
    },
    {
        "command": "bibtex",
        "args": [
            "%DOCFILE%"
        ]
    },
    {
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-no-pdf",
            "-interaction=nonstopmode",
            "%DOC%"
        ]
    },
    {
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "%DOC%"
        ]
    }
]

另外可以加上这段,隐藏不需要关心的文件

"files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/*.aux": true,
    "**/*.log": true,
    "**/*.xdv": true,
    "**/*.toc": true,
    "**/*.out": true,
    "**/*.fls": true,
    "**/*.fdb_latexmk": true,
    "**/*.blg": true,
    "**/*.bbl": true,
    "**/*.bst": true,
    "**/*.cls": true
}

xelatex建议增加参数"-synctex=1",这样源代码和pdf可以互相跳转,源代码光标位置ctrl+alt+j,pdf上直接ctrl+鼠标左键,我用的new tab来查看pdf

imageslr commented 3 years ago

现在vscode-latex-workspace 要这么配置了:

"latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.latex.recipes": [{
        "name": "xelatex",
        "tools": [
          "xelatex",
          "bibtex",
          "xelatex",
          "xelatex-pdf"
        ]
      }],
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-no-pdf",
                "-interaction=nonstopmode",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "xelatex-pdf",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "%DOC%"
            ]
        }
    ]
Mickeyyyang commented 2 years ago

现在vscode-latex-workspace 要这么配置了:

"latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.latex.recipes": [{
        "name": "xelatex",
        "tools": [
          "xelatex",
          "bibtex",
          "xelatex",
          "xelatex-pdf"
        ]
      }],
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-no-pdf",
                "-interaction=nonstopmode",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "xelatex-pdf",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "%DOC%"
            ]
        }
    ]

Amazing... best wishes for 2023 biter...