LaTeX コマンド, PdfLaTeX コマンド, XeLaTeX コマンド, LuaLaTeX コマンドのオプションに -synctex=1 を追加します.
forward and inverse search は 外部PDFビューア に以下のように設定します.
■ 64-bit Windows の場合 (コマンドラインオプションを使用する場合)
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance -inverse-search """"C:\Program Files (x86)\TeXstudio\texstudio.exe""" """%%f""" -line %%l" "?am.pdf" -forward-search "?c:am.tex" @
■ 32-bit Windows の場合 (コマンドラインオプションを使用する場合)
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance -inverse-search """"C:\Program Files\TeXstudio\texstudio.exe""" """%%f""" -line %%l" "?am.pdf" -forward-search "?c:am.tex" @
forward search は 外部PDFビューア に以下のように設定します.
dde:///"C:\Program Files\SumatraPDF\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]
forward search は 外部PDFビューア に以下のように設定します.
dde:///"C:\Program Files\SumatraPDF\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?am.pdf","?c:am.tex",@,0,0,0)]
inverse search は SumatraPDF の [☰]-[設定(S)]-[オプション(O)...] の逆順検索コマンドラインの設定に以下のように設定します.
■ 64-bit Windows の場合
"C:\Program Files (x86)\TeXstudio\texstudio.exe" "%f" -line %l
■ 32-bit Windows の場合
"C:\Program Files\TeXstudio\texstudio.exe" "%f" -line %l
ダブルクリックで対応する TeX 文書の該当箇所にジャンプします.
forward search は 外部PDFビューア に以下のように設定します.
synctex view -i "@:0:?c:am.tex" -o "?am.pdf" -x "texworks --position=%%{page+1} '%%{output}'"
pdfuplatexA-nonstopmode.bat を作成します.
@echo off tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^ findstr "AcroRd32.exe" > nul && ^ pdfopen --file "%~n1.pdf" && ^ pdfclose --file "%~n1.pdf" & ^ ptex2pdf -u -l -ot "-kanji=utf8 -no-guess-input-enc -synctex=1 -interaction=nonstopmode" %1 && ^ synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --file '%%{output}' --page %%{page+1}"
ユーザーコマンドに
pdfuplatexA-nonstopmode.bat % "?c:am.tex" @
を入力します.
pdfuplatex2A-nonstopmode.bat を作成します.
@echo off tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^ findstr "AcroRd32.exe" > nul && ^ pdfopen --file "%~n1.pdf" && ^ pdfclose --file "%~n1.pdf" & ^ uplatex -kanji=utf8 -no-guess-input-enc -synctex=1 -interaction=nonstopmode %1 && ^ dvips -Ppdf -z -f "%~n1.dvi" | ^ convbkmk -u > "%~n1.ps" && ^ ps2pdf.exe "%~n1.ps" && ^ synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --file '%%{output}' --page %%{page+1}"
ユーザーコマンドに
pdfuplatex2A-nonstopmode.bat % "?c:am.tex" @
を入力します.
pdflatexA-nonstopmode.bat を作成します.
@echo off tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^ findstr "AcroRd32.exe" > nul && ^ pdfopen --file "%~n1.pdf" && ^ pdfclose --file "%~n1.pdf" & ^ pdflatex -synctex=1 -interaction=nonstopmode %1 && ^ synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --file '%%{output}' --page %%{page+1}"
ユーザーコマンドに
pdflatexA-nonstopmode.bat % "?c:am.tex" @
を入力します.
lualatexA-nonstopmode.bat を作成します.
@echo off tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^ findstr "AcroRd32.exe" > nul && ^ pdfopen --file "%~n1.pdf" && ^ pdfclose --file "%~n1.pdf" & ^ lualatex -synctex=1 -interaction=nonstopmode %1 && ^ synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --file '%%{output}' --page %%{page+1}"
ユーザーコマンドに
lualatexA-nonstopmode.bat % "?c:am.tex" @
を入力します.
luajitlatexA-nonstopmode.bat を作成します.
@echo off tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^ findstr "AcroRd32.exe" > nul && ^ pdfopen --file "%~n1.pdf" && ^ pdfclose --file "%~n1.pdf" & ^ luajitlatex -synctex=1 -interaction=nonstopmode %1 && ^ synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --file '%%{output}' --page %%{page+1}"
ユーザーコマンドに
luajitlatexA-nonstopmode.bat % "?c:am.tex" @
を入力します.
xelatexA-nonstopmode.bat を作成します.
@echo off tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^ findstr "AcroRd32.exe" > nul && ^ pdfopen --file "%~n1.pdf" && ^ pdfclose --file "%~n1.pdf" & ^ xelatex -synctex=1 -interaction=nonstopmode %1 && ^ synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --file '%%{output}' --page %%{page+1}"
ユーザーコマンドに
xelatexA-nonstopmode.bat % "?c:am.tex" @
を入力します.