[[Texmaker]] > [[設定>Texmaker/設定]] > [[Windows>Microsoft Windows]]

&color(White,#5F2F2F){  ''◆目次◆''  };&br;

----
#contents
----

*設定 [#ha179b3b]
**コマンド [#cab65285]

[オプション(O)]-[Texmaker の設定]-[コマンド]
%%%O%%%ptions > Configure Texmaker > Commands

PDF ビューアは,組み込みビューアと外部ビューアを選択するようになっているので好きな方を選択してください.~
コマンドの LaTeX に設定されている latex を uplatex に変更してコマンドのオプションに -synctex=1 を追加します.~
コマンドの LuaLaTeX に設定されているコマンドのオプションに -synctex=1 を追加します.~
コマンドの Bib(la)tex に設定されている bibtex を upbibtex に変更します.~
コマンドの Dvipdfm に設定されている dvipdfm を dvipdfmx に変更します.~
Texmaker のデフォルトの文字コードは UTF-8 です.~
コンパイルエラーが発生する場合は[[サクラエディタ]]で文字コードを UTF-8,改行コードを CR+LF にして保存するとコンパイルが通るそうです. → [[やっと見つけたTeXエディタ:http://yaplog.jp/stdwave/archive/215]]~
W32TeX の場合は latexmk の実行には [[Strawberry Perl:http://strawberryperl.com/]] が必要です.~
コマンドの LaTeX に設定されている latex を uplatex に変更してコマンドのオプションに -synctex=1 を追加します.

コマンドの LuaLaTeX に設定されているコマンドのオプションに -synctex=1 を追加します.

コマンドの Bib(la)tex に設定されている bibtex を biber --bblencoding=utf8 -u -U --output_safechars または bibtexu に変更します.

コマンドの Dvipdfm に設定されている dvipdfm を dvipdfmx に変更します.
----
&color(#9BC527,#9BC527){%%%                                             &color(Black){''Texmaker の設定''};                                    &color(#9BC527,#9BC527){%%%[ &color(Black){''?''}; ]%%%};&color(#DD4444,#DD4444){%%%[ &color(White){''×''}; ]%%%};%%%};&br;
:コマンド (% : 拡張子を除いたファイル名 - @ : 行番号)|

#ref(https://bitbucket.org/srazi/biditexmaker3/raw/tip/images/configtools.png,left,around,nolink,コマンド)
&color(Black,#F5F5F5){コマンド (% : 拡張子を除いたファイル名 - @ : 行番号)};&br;
&color(Black,#F5F5F5){LaTeX    };%%%uplatex -no-guess-input-enc -kanji=utf8 -synctex=1 -interaction=nonstopmode %.tex%%%&br;
&color(Black,#F5F5F5){PdfLaTeX  };%%%pdflatex -synctex=1 -interaction=nonstopmode %.tex%%%&br;
&color(Black,#F5F5F5){☐ 出力ファイルを "build" サブフォルダーに出力する};&br;
  &color(Black,#DAEAFF){   ''コマンド''   };  &color(Black,#F5F5F5){XeLaTeX  };%%%xelatex -synctex=1 -interaction=nonstopmode %.tex%%%     &color(Black,#F5F5F5){LuaLaTeX  };%%%lualatex -synctex=1 -interaction=nonstopmode %.tex%%% または %%%luajitlatex -synctex=1 -interaction=nonstopmode %.tex%%%&br;
#img(,clear)
#ref(https://bitbucket.org/srazi/biditexmaker3/raw/tip/images/configquick.png,left,around,nolink,クイックビルド)
&color(Black,#F5F5F5){Latexmk   };%%%powershell -Command "& {$s = """%.tex"""; $latex = [char]0x24+'latex'; $bibtex = [char]0x24+'bibtex'; $makeindex = [char]0x24+'makeindex'; $dvipdf = [char]0x24+'dvipdf'; $opt = [char]0x25+'O'; $base = [char]0x25+'B'; $dst = [char]0x25+'D'; $src = [char]0x25+'S'; latexmk -e """$latex=q/uplatex $opt -kanji=utf8 -no-guess-input-enc -synctex=1 -interaction=nonstopmode $src/""" -e """$bibtex=q/upbibtex $opt $base/""" -e """$makeindex=q/mendex $opt -U -o $dst $src/""" -e """$dvipdf=q/dvipdfmx $opt -o $dst $src/""" -norc -gg -pdfdvi $s}"%%%&br;または %%%powershell -Command "& {$s = """%.tex"""; $pdflatex = [char]0x24+'pdflatex'; $bibtex = [char]0x24+'bibtex'; $makeindex = [char]0x24+'makeindex'; $opt = [char]0x25+'O'; $base = [char]0x25+'B'; $dst = [char]0x25+'D'; $src = [char]0x25+'S'; latexmk -e """$pdflatex=q/pdflatex $opt -synctex=1 -interaction=nonstopmode $src/""" -e """$bibtex=q/bibtex $opt $base/""" -e """$makeindex=q/makeindex $opt -o $dst $src/""" -norc -gg -pdf $s}"%%%&br;または %%%powershell -Command "& {$s = """%.tex"""; $pdflatex = [char]0x24+'pdflatex'; $bibtex = [char]0x24+'bibtex'; $makeindex = [char]0x24+'makeindex'; $opt = [char]0x25+'O'; $base = [char]0x25+'B'; $dst = [char]0x25+'D'; $src = [char]0x25+'S'; latexmk -e """$pdflatex=q/lualatex $opt -synctex=1 -interaction=nonstopmode $src/""" -e """$bibtex=q/bibtexu $opt $base/""" -e """$makeindex=q/texindy $opt -o $dst $src/""" -norc -gg -pdf $s}"%%%&br;または %%%powershell -Command "& {$s = """%.tex"""; $pdflatex = [char]0x24+'pdflatex'; $bibtex = [char]0x24+'bibtex'; $makeindex = [char]0x24+'makeindex'; $opt = [char]0x25+'O'; $base = [char]0x25+'B'; $dst = [char]0x25+'D'; $src = [char]0x25+'S'; latexmk -e """$pdflatex=q/luajitlatex $opt -synctex=1 -interaction=nonstopmode $src/""" -e """$bibtex=q/bibtexu $opt $base/""" -e """$makeindex=q/texindy $opt -o $dst $src/""" -norc -gg -pdf $s}"%%%&br;または %%%powershell -Command "& {$s = """%.tex"""; $pdflatex = [char]0x24+'pdflatex'; $bibtex = [char]0x24+'bibtex'; $makeindex = [char]0x24+'makeindex'; $opt = [char]0x25+'O'; $base = [char]0x25+'B'; $dst = [char]0x25+'D'; $src = [char]0x25+'S'; latexmk -e """$pdflatex=q/xelatex $opt -synctex=1 -interaction=nonstopmode $src/""" -e """$bibtex=q/bibtexu $opt $base/""" -e """$makeindex=q/texindy $opt -o $dst $src/""" -norc -gg -pdf $s}"%%%&br;
   ''クイックビルド''&br;
#img(,clear)
#ref(https://bitbucket.org/srazi/biditexmaker3/raw/tip/images/configeditor.png,left,around,nolink,エディタ)
&color(Black,#F5F5F5){[[Bib(la)tex>BibTeX関連ツール]]   };%%%upbibtex %%%% または %%%bibtex %%%% または %%%bibtexu %%%% または %%%biber %%%%&br;
&color(Black,#F5F5F5){Makeindex  };%%%mendex -U %.idx%%% または %%%makeindex %.idx%%% または %%%texindy %.idx%%%&br;
&color(Black,#F5F5F5){[[dvips]]     };%%%dvips -Ppdf -o %.ps %.dvi%%%&br;
&color(Black,#F5F5F5){Dvipdfm   };%%%dvipdfmx %.dvi%%%&br;
     ''エディタ''     &color(Black,#F5F5F5){ps2pdf    };%%%ps2pdf.bat %.ps%%% または %%%ps2pdf.exe %.ps%%%&br;
#img(,clear)
#ref(https://bitbucket.org/srazi/biditexmaker3/raw/tip/images/configkeys.png,left,around,nolink,ショートカット)
&color(Black,#F5F5F5){[[metapost>MetaPost]]  };%%%upmpost -interaction=nonstopmode %%%% または %%%mpost -interaction=nonstopmode %%%%&br;
&color(Black,#F5F5F5){[[Asymptote]] };%%%asy %.asy%%%&br;
&color(Black,#F5F5F5){[[ghostscript>Ghostscript]] };%%%rungs.exe%%% または %%%gswin64c.exe%%% または %%%gswin32c.exe%%%&br;
&color(Black,#F5F5F5){R Sweave  };%%%R CMD Sweave %.Rnw%%%&br;
   ''ショートカット''   &color(Black,#F5F5F5){Add to PATH    };&br;
:LaTeX|
:|uplatex -no-guess-input-enc -kanji=utf8 -synctex=1 -interaction=nonstopmode %.tex
:PdfLaTeX|
:|pdflatex -synctex=1 -interaction=nonstopmode %.tex

:|☐ Use a "build" subdirectory for output files

:XeLaTeX|
:|xelatex -synctex=1 -interaction=nonstopmode %.tex
:LuaLaTeX|
:|lualatex -synctex=1 -interaction=nonstopmode %.tex
:|luajitlatex -synctex=1 -interaction=nonstopmode %.tex
:Latexmk|
:|ruby -e "cmd='latexmk -e '+0x22.chr+'$latex=q/uplatex '+0x25.chr+'O'+' -kanji=utf8 -no-guess-input-enc -synctex=1 -interaction=nonstopmode '+0x25.chr+'S'+'/'+0x22.chr+' -e '+0x22.chr+'$bibtex=q/bibtexu '+0x25.chr+'O'+' '+0x25.chr+'B'+'/'+0x22.chr+' -e '+0x22.chr+'$biber=q/biber '+0x25.chr+'O'+' --bblencoding=utf8 -u -U --output_safechars '+0x25.chr+'B'+'/'+0x22.chr+' -e '+0x22.chr+'$makeindex=q/upmendex '+0x25.chr+'O'+' -o '+0x25.chr+'D'+' '+0x25.chr+'S'+'/'+0x22.chr+' -e '+0x22.chr+'$dvipdf=q/dvipdfmx '+0x25.chr+'O'+' -o '+0x25.chr+'D'+' '+0x25.chr+'S'+'/'+0x22.chr+' -norc -gg -pdfdvi '+'%.tex';system(cmd)"
:Bib(la)tex|
:|biber --bblencoding=utf8 -u -U --output_safechars %
:|bibtexu %
:Makeindex|
:|upmendex %.idx
:dvips|
:|ruby -e "cmd='dvips -Ppdf -z -f '+0x22.chr+ARGV[0]+'.dvi'+0x22.chr+' '+0x7c.chr+' '+'convbkmk -u'+' '+0x3e.chr+' '+0x22.chr+ARGV[0]+'.ps'+0x22.chr;system(cmd)" %
:Dvipdfm|
:|dvipdfmx %.dvi
:ps2pdf|
:|ps2pdf.exe %.ps
:metapost|
:|upmpost -interaction=nonstopmode %
:Asymptote|
:|asy %.asy
:ghostscript|
:|rungs.exe
:R Sweave|
:|R CMD Sweave %.Rnw
:Add to PATH|


:PDF Viewer|
:|🔘 Built-in Viewer
:|☑ Embed
:|◯ External Viewer
:|powershell -Command "& {$line=[char]0x22+@+[char]0x22;$tex=[char]0x22+'#.tex'+[char]0x22;$pdf=[char]0x22+'%.pdf'+[char]0x22;$texmaker='C:\Program Files\Texmaker\texmaker.exe';$f=[char]0x25+'f';$l=[char]0x25+'l';$inverse_search=[char]0x22+[char]0x5c+[char]0x22+$texmaker+[char]0x5c+[char]0x22+' '+[char]0x5c+[char]0x22+$f+[char]0x5c+[char]0x22+' -line '+$l+[char]0x22;$sumatrapdf=[char]0x22+'C:\Program Files\SumatraPDF\SumatraPDF.exe'+[char]0x22;Start-Process $sumatrapdf -ArgumentList ('-reuse-instance','-inverse-search',$inverse_search,$pdf,'-forward-search',$tex,$line)}"
:|"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance %.pdf -forward-search #.tex @
:|powershell -Command "& {$param=[char]0x22+'@:0:#.tex'+[char]0x22; $pdf=[char]0x22+'%.pdf'+[char]0x22; $page=[char]0x25+'{page+1}'; $o=[char]0x27+[char]0x25+'{output}'+[char]0x27; synctex view -i $param -o $pdf -x """texworks --position=$page $o"""}"
//:|texworks %.pdf
//:|cmd /c start firefox -new-window %.pdf
//:|cmd /c start chrome --new-window !/%.pdf
//:|pdfopen --file %.pdf
----
                  &color(Black,#F5F5F5){''PDF ビューア''};&br;
&color(Black,#F5F5F5){(●) 組み込みビューア};&br;
&color(Black,#F5F5F5){☑ 埋め込み};&br;
&color(Black,#F5F5F5){◯ 外部ビューア};&br;
%%%"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" -reuse-instance %.pdf -forward-search #.tex @%%%&br;
%%%"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance %.pdf -forward-search #.tex @%%%&br;
//%%%texworks %.pdf%%%&br;
//%%%cmd /c start firefox -new-window %.pdf%%%&br;
//%%%cmd /c start chrome --new-window !/%.pdf%%%&br;
//%%%pdfopen --rxi --file %.pdf%%%&br;
#img(,clear)
&br;
                                                                                &color(Black,#EEEEEE){[   OK   ]}; &color(Black,#EEEEEE){[ キャンセル ]};&br;
----

*[[SumatraPDF]] との連携 [#f10825ae]

LaTeX コマンド, PdfLaTeX コマンド, XeLaTeX コマンド, LuaLaTeX コマンドのオプションに -synctex=1 を追加します.

**forward and inverse search [#xf457e6c]

***SumatraPDF を前面に表示したい場合 [#r4dc6964]

forward and inverse search は PDFビューアの外部ビューアに以下のように設定します.~

 powershell -Command "& {$line=[char]0x22+@+[char]0x22;$tex=[char]0x22+'#.tex'+[char]0x22;$pdf=[char]0x22+'%.pdf'+[char]0x22;$texmaker='C:\Program Files\Texmaker\texmaker.exe';$f=[char]0x25+'f';$l=[char]0x25+'l';$inverse_search=[char]0x22+[char]0x5c+[char]0x22+$texmaker+[char]0x5c+[char]0x22+' '+[char]0x5c+[char]0x22+$f+[char]0x5c+[char]0x22+' -line '+$l+[char]0x22;$sumatrapdf=[char]0x22+'C:\Program Files\SumatraPDF\SumatraPDF.exe'+[char]0x22;Start-Process $sumatrapdf -ArgumentList ('-reuse-instance','-inverse-search',$inverse_search,$pdf,'-forward-search',$tex,$line)}"

**forward search [#y08c577b]

***SumatraPDF を前面に表示したい場合 [#id9fc839]

forward search は PDFビューアの外部ビューアに以下のように設定します.~

■ 64-bit Windows の場合~
 "C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" -reuse-instance %.pdf -forward-search #.tex @

■ 32-bit Windows の場合~
 "C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance %.pdf -forward-search #.tex @

***SumatraPDF を前面に表示したくない場合 [#j0fbd66f]

[[SumatraPDF/fwdsumatrapdf]] の fwdsumatrapdf.exe を使用します.~

forward search は PDFビューアの外部ビューアに以下のように設定します.~

 fwdsumatrapdf.exe %.pdf #.tex @

**inverse search [#p850b553]
inverse search は SumatraPDF の [設定(S)]-[オプション(O)...]-[逆順検索コマンドラインの設定] に以下のように設定します.~
inverse search は SumatraPDF の [☰]-[設定(S)]-[オプション(O)...] の逆順検索コマンドラインの設定に以下のように設定します.~

■ 64-bit Windows の場合
 "C:\Program Files (x86)\Texmaker\texmaker.exe" "%f" -line %l
■ 32-bit Windows の場合
 "C:\Program Files\Texmaker\texmaker.exe" "%f" -line %l

ダブルクリックで対応する TeX 文書の該当箇所にジャンプします.

*[[Adobe Reader]] との連携 [#u27e1718]
*[[TeXworks]] との連携 [#o9f4b99c]

**pdfupLaTeXA [#v915ab85]
**forward search [#a41fe59c]

pdfuplatexA-nonstopmode.bat を作成します.
forward search は PDFビューアの外部ビューアに以下のように設定します.~

----
-pdfuplatexA-nonstopmode.bat
----
 @echo off
 tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^
 findstr "AcroRd32.exe" > nul && ^
 pdfopen --rxi --file "%~n1.pdf" && ^
 pdfclose --rxi --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 --rxi --file '%%{output}' --page %%{page+1}"
----
 powershell -Command "& {$param=[char]0x22+'@:0:#.tex'+[char]0x22; $pdf=[char]0x22+'%.pdf'+[char]0x22; $page=[char]0x25+'{page+1}'; $o=[char]0x27+[char]0x25+'{output}'+[char]0x27; synctex view -i $param -o $pdf -x """texworks --position=$page $o"""}"

クイックビルドのコマンドのユーザー定義または [ユーザー(U)]-[ユーザー定義コマンド(C)]-[ユーザー定義コマンドの編集(C)] で
 pdfuplatexA-nonstopmode.bat % #.tex @
を入力します.
*Adobe Acrobat Reader との連携 [#u27e1718]

**pdfupLaTeX2A [#pf77769a]
**forward search [#l5bfe340]

pdfuplatex2A-nonstopmode.bat を作成します.
***pdfupLaTeXA [#v915ab85]

----
-pdfuplatex2A-nonstopmode.bat
----
 @echo off
 tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^
 findstr "AcroRd32.exe" > nul && ^
 pdfopen --rxi --file "%~n1.pdf" && ^
 pdfclose --rxi --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.bat "%~n1.ps" && ^
 synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --rxi --file '%%{output}' --page %%{page+1}"
----
pdfuplatexA-nonstopmode.bat を作成します.

クイックビルドのコマンドのユーザー定義または [ユーザー(U)]-[ユーザー定義コマンド(C)]-[ユーザー定義コマンドの編集(C)] で
 pdfuplatex2A-nonstopmode.bat % #.tex @
を入力します.

**pdfLaTeXA [#j7c9b397]

pdflatexA-nonstopmode.bat を作成します.

----
-pdflatexA-nonstopmode.bat
-pdfuplatexA-nonstopmode.bat
----
 @echo off
 tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^
 findstr "AcroRd32.exe" > nul && ^
 pdfopen --rxi --file "%~n1.pdf" && ^
 pdfclose --rxi --file "%~n1.pdf" & ^
 pdflatex -synctex=1 -interaction=nonstopmode %1 && ^
 synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --rxi --file '%%{output}' --page %%{page+1}"
 tasklist /fi "IMAGENAME eq Acrobat.exe" /nh | ^
 findstr "Acrobat.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}"
----

クイックビルドのコマンドのユーザー定義または [ユーザー(U)]-[ユーザー定義コマンド(C)]-[ユーザー定義コマンドの編集(C)] で
 pdflatexA-nonstopmode.bat % #.tex @
 pdfuplatexA-nonstopmode.bat % #.tex @
を入力します.

**LuaLaTeXA [#b2053ddc]
***LuaLaTeXA [#b2053ddc]

lualatexA-nonstopmode.bat を作成します.

----
-lualatexA-nonstopmode.bat
----
 @echo off
 tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^
 findstr "AcroRd32.exe" > nul && ^
 pdfopen --rxi --file "%~n1.pdf" && ^
 pdfclose --rxi --file "%~n1.pdf" & ^
 tasklist /fi "IMAGENAME eq Acrobat.exe" /nh | ^
 findstr "Acrobat.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 --rxi --file '%%{output}' --page %%{page+1}"
 synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --file '%%{output}' --page %%{page+1}"
----

クイックビルドのコマンドのユーザー定義または [ユーザー(U)]-[ユーザー定義コマンド(C)]-[ユーザー定義コマンドの編集(C)] で
 lualatexA-nonstopmode.bat % #.tex @
を入力します.

**LuaJITLaTeXA [#z4aadf43]

luajitlatexA-nonstopmode.bat を作成します.

----
-luajitlatexA-nonstopmode.bat
----
 @echo off
 tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^
 findstr "AcroRd32.exe" > nul && ^
 pdfopen --rxi --file "%~n1.pdf" && ^
 pdfclose --rxi --file "%~n1.pdf" & ^
 luajitlatex -synctex=1 -interaction=nonstopmode %1 && ^
 synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --rxi --file '%%{output}' --page %%{page+1}"
----

クイックビルドのコマンドのユーザー定義または [ユーザー(U)]-[ユーザー定義コマンド(C)]-[ユーザー定義コマンドの編集(C)] で
 luajitlatexA-nonstopmode.bat % #.tex @
を入力します.

**XeLaTeXA [#md09c195]

xelatexA-nonstopmode.bat を作成します.

----
-xelatexA-nonstopmode.bat
----
 @echo off
 tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | ^
 findstr "AcroRd32.exe" > nul && ^
 pdfopen --rxi --file "%~n1.pdf" && ^
 pdfclose --rxi --file "%~n1.pdf" & ^
 xelatex -synctex=1 -interaction=nonstopmode %1 && ^
 synctex view -i "%~n3:0:%~n2.tex" -o "%~n1.pdf" -x "pdfopen --rxi --file '%%{output}' --page %%{page+1}"
----

クイックビルドのコマンドのユーザー定義または [ユーザー(U)]-[ユーザー定義コマンド(C)]-[ユーザー定義コマンドの編集(C)] で
 xelatexA-nonstopmode.bat % #.tex @
を入力します.