VSCode で LaTeX をビルドできるようにする
4189 ワード
環境
Windows 10 Home
Visual Studio Code バージョン 1.51.1
LaTeX Workshop v8.14.0
発生した問題
Visual Studio CodeにLaTeX Workshopを入れてビルドしようと思ったら、以下のようなエラーが出た。
そこで、Open compiler logをクリックして出力を見てみると、以下のような表示が。
No pages of output.
Transcript written on c:/Users/ユーザー名/Desktop/textest/1.log.
Latexmk: Log file says no output from latex
Latexmk: For rule 'pdflatex', no output was made
Collected error summary (may duplicate other messages):
pdflatex: Command for 'pdflatex' gave return code 1
Refer to 'c:/Users/ユーザー名/Desktop/textest/1.log' for details
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs, or warnings treated as errors.
=== TeX engine is 'pdfTeX'
Latexmk: Errors, so I did not complete making targets
どうやら、Latexmkからpdflatexが呼び出されている。TeXworksを使っていた時に、pdflatexは日本語を扱えないという制約があったことを思い出し、その時と同様にptex2pdfを使うように変更した。
解決法
以下をsettings.json
に記述する。
settings.json
{
"latex-workshop.latex.recipes": [
{
"name": "ptex2pdf",
"tools": [
"ptex2pdf"
]
}
],
"latex-workshop.latex.tools": [
{
"name": "ptex2pdf",
"command": "ptex2pdf",
"args": [
"-l",
"-ot",
"-kanji=utf8 -synctex=1",
"%DOC%"
]
}
],
"latex-workshop.view.pdf.viewer": "tab",
}
これで、Visual Studio Code上でビルドができるようになり、PDFのプレビューもできるようになった。
参考
Author And Source
この問題について(VSCode で LaTeX をビルドできるようにする), 我々は、より多くの情報をここで見つけました https://qiita.com/wdwd5454/items/10ff1aa27afd9f6ce7a9著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .