5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LaTeX WorkshopとSumatraPDFのsynctexの設定

Posted at

Windows10でVScodeのlatex-workshopのexternal pdfをsmatraPDFにしてsynctexを使ったforward searchとinverse searchの設定をする.いくつか参照して試行錯誤したのでメモ.

VScode側の設定

settings.josonに以下を追加.

"latex-workshop.view.pdf.viewer": "external",
"latex-workshop.view.pdf.external.viewer.command": 
        "C:\\Users\\[username]\\AppData\\Local\\SumatraPDF\\SumatraPDF.exe",
"latex-workshop.view.pdf.external.viewer.args": [
        "-reuse-instance",
        "%PDF%"
],
"latex-workshop.view.pdf.external.synctex.command": 
        "C:\\Users\\[username]\\AppData\\Local\\SumatraPDF\\SumatraPDF.exe",
"latex-workshop.view.pdf.external.synctex.args": [
    "-forward-search",
    "%TEX%",
    "%LINE%",
    "-reuse-instance",
    "-inverse-search",
    "C:\\Users\\[username]\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe \"C:\\Users\\[username]\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -r -g \"%f:%l\"", //put same code on Smatra pdf option
    "%PDF%",
],

smatraPDF側の設定

詳細設定に以下を追加

InverseSearchCmdLine = C:\Users\[username]\AppData\Local\Programs\Microsoft VS Code\Code.exe "C:\Users\[username]\AppData\Local\Programs\Microsoft VS Code\resources\app\out\cli.js" -r -g "%f:%l"

#使い方
Ctrl+Alt+JでVScode上のソースからsmatraPDFに飛ぶ.
PDFダブルクリックでsmatraPDFからVScode上のソースに飛ぶ.

#参考
James-Yu/LaTeX-Workshop View
https://github.com/James-Yu/LaTeX-Workshop/wiki/View,
TeX Wiki : SumatraPDF との synctex 連携
https://texwiki.texjp.org/?Visual%20Studio%20Code%2FLaTeX#g142ea7e
LaTeX WorkshopでSumatraPDFを使う
https://qiita.com/hakos/items/7178c9bdd0fbbf8f78db

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?