#author("2018-05-28T20:17:38+09:00","default:hoge","hoge")
#author("2018-05-28T20:17:58+09:00","default:hoge","hoge")
Sakura Editor

-https://sakura-editor.github.io/
-https://ja.osdn.net/projects/sakura-editor/
-https://ja.osdn.net/projects/sfnet_sakura-editor/
-[[SakuraEditorWiki:FrontPage]]
-[[サクラエディタBBS:http://sakura-editor.sourceforge.net/cgi-bin/cyclamen/cyclamen.cgi?log=data]]
-[[GoogleSearch:サクラエディタ]]
-[[YahooSearch:サクラエディタ]]
-[[Bing:サクラエディタ]]
-[[DuckDuckGo:サクラエディタ]]
-[[TwitterSearch.ja:サクラエディタ]]
-[[TeXWiki:サクラエディタ]]
//-[[Mocaのブログ:http://mocaskr.blog42.fc2.com/]]
-https://twitter.com/SakuraEditorFC
-[[サクラエディタ上に Vim を実装した話:http://tchssk.hatenablog.com/entry/2015/12/09/215245]]
-[[サクラエディタのインストール(64ビット版):http://gao-hp.net/%E3%82%B5%E3%82%AF%E3%83%A9%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%EF%BC%88%EF%BC%96%EF%BC%94%E3%83%93%E3%83%83%E3%83%88%E7%89%88%EF%BC%89/]]
-[[Macでサクラエディタ:http://qiita.com/pe-suke/items/ec59569356467976e1a5]]
-[[サクラエディタでEclipse風コメントアウト:http://qiita.com/cat2151/items/d195489f80857a1c59c6]]

**Download [#hc07a5e3]

official build

-http://sakura-editor.sourceforge.net/download.html
-https://sakura-editor.github.io/download.html
-https://sourceforge.net/projects/sakura-editor/files/
-http://jaist.dl.sourceforge.net/project/sakura-editor/

64-bit build

-https://sourceforge.net/p/sakura-editor/wiki/64bit/
-[[sakura2-3-2-0_x64.zip:https://ux.getuploader.com/sakura_editor/download/149]]

test build

//-http://mocaskr.web.fc2.com/weekly/sakura_weekly.html
-http://ux.getuploader.com/sakura_editor/

fork

//-https://github.com/mocaskr/sakura/releases
-https://bitbucket.org/suzzsegv/benizakura/downloads

**Repository [#q40dd591]

-https://github.com/sakura-editor/sakura
-https://sourceforge.net/p/sakura-editor/code/
-http://svn.code.sf.net/p/sakura-editor/code/
//-https://github.com/mocaskr/sakura/

**Changelog [#r4cd4550]

-https://github.com/sakura-editor/sakura/commits/master
-[[SakuraEditorWiki:History]]
-http://sakura-editor.sourceforge.net/htmlhelp2/HLP000009.html
-https://sourceforge.net/p/sakura-editor/activity/
-https://sourceforge.net/p/sakura-editor/code/log/
//-https://github.com/mocaskr/sakura/commits/

**bregonig.dll [#waad6042]

Sakura Editor で正規表現を使用する場合は正規表現ライブラリ bregonig.dll を使用する

-[[K.Takata's software: bregonig.dll:http://k-takata.o.oo7.jp/mysoft/bregonig.html]]

bregonig.dll がインストールされていれば [設定(O)] > [共通設定(%%%C%%%)...] > [検索] の 検索/置換/Grep で
>
bregonig.dll Ver.4.12 with Onigmo 6.1.2
<
のように bregonig.dll のバージョンが表示される

>
&color(#FF77AA,#FF77AA){%%%&nbsp;&color(white){共通設定};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&color(#FF77AA,#FF87BA){%%%&#x7c;&nbsp;&nbsp;&nbsp;&color(White){&#x2754;};&nbsp;&nbsp;&nbsp;&#x7c;%%%};&color(#DD4444,#DD4444){%%%&#x7c;&nbsp;&nbsp;&nbsp;&color(White){&#x1f5d9;};&nbsp;&nbsp;&nbsp;&#x7c;%%%};%%%};&br;
&nbsp;&nbsp;&color(Black,#EEEEEE){%%%&#x7c;&nbsp;&nbsp;&nbsp;カスタムメニュー&nbsp;&nbsp;&nbsp;&#x7c;&nbsp;&nbsp;&nbsp;強調キーワード&nbsp;&nbsp;&nbsp;&#x7c;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支援&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x7c;&nbsp;&nbsp;&nbsp;&nbsp;マクロ&nbsp;&nbsp;&nbsp;&nbsp;&#x7c;&nbsp;&nbsp;&nbsp;&nbsp;プラグイン&nbsp;&nbsp;&nbsp;&nbsp;&#x7c;%%%};&br;
&nbsp;&nbsp;&color(Black,#EEEEEE){%%%&#x7c;&nbsp;&nbsp;全般&nbsp;&nbsp;&#x7c;&nbsp;ウィンドウ&nbsp;&#x7c;&nbsp;メインメニュー&nbsp;&#x7c;&nbsp;ツールバー&nbsp;&#x7c;&nbsp;タブバー&nbsp;&#x7c;&nbsp;ステータスバー&nbsp;&#x7c;&nbsp;&nbsp;編集&nbsp;&nbsp;&#x7c;%%%};&br;
&nbsp;&nbsp;&color(Black,#EEEEEE){%%%&#x7c;&nbsp;&nbsp;&nbsp;ファイル&nbsp;&nbsp;&nbsp;&#x7c;&nbsp;&nbsp;ファイル名表示&nbsp;&nbsp;&#x7c;&nbsp;&nbsp;バックアップ&nbsp;&nbsp;&#x7c;&nbsp;&nbsp;&nbsp;書式&nbsp;&nbsp;&nbsp;&#x7c;%%%};&nbsp;&nbsp;&nbsp;検索&nbsp;&nbsp;&nbsp;&color(Black,#EEEEEE){%%%&#x7c;&nbsp;&nbsp;&nbsp;キー割り当て&nbsp;&nbsp;&nbsp;&#x7c;%%%};&br;
&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;検索/置換/Grep&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x2611;&nbsp;カーソル位置の文字列をデフォルトの検索文字列にする(C)&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x2611;&nbsp;次・前検索で他のビューでの検索条件変更を引き継ぐ(I)&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;正規表現ライブラリ指定(L)&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bregonig.dll Ver.4.12 with Onigmo 6.1.2&br;
&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Grep&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;Grepモードで保存確認する(V)&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;リアルタイムで表示する(R)&br;
&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Grep結果からのタブジャンプ&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x2611;&nbsp;エンターキーでタグジャンプ(E)&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x2611;&nbsp;ダブルクリックでタグジャンプ(W)&br;
&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;タグジャンプ&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;タグジャンプの検索(T):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&color(Black,#EEEEEE){[ヒットしたら次のファイルを検索しない&nbsp;&nbsp;&#x142f;]};&br;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;キーワード指定のタグファイル検索(K):&nbsp;&nbsp;&color(Black,#EEEEEE){[次のファイルを検索する&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x142f;]};&br;
%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%%&br;
<

**LaTeX macro [#kc4e067f]

***Typeset.js [#pbd9fdd8]

Sakura Editor Ver. 2.2.0.0 以降が必要.

----
 (function () {
     var menuItem = Editor.CreateMenu(0, "\
 []upLaTeX (ptex2pdf),\
 []upLaTeX (dvips + ps2pdf),\
 []pLaTeX-ng,\
 []pdfLaTeX,\
 []LuaLaTeX,\
 []LuajitLaTeX,\
 []XeLaTeX,\
 []Latexmk,\
 []Latexmk-upLaTeX-pdfdvi,\
 []Latexmk-upLaTeX-pdfps,\
 []Latexmk-pLaTeX-ng,\
 []Latexmk-pdfLaTeX,\
 []Latexmk-LuaLaTeX,\
 []Latexmk-LuajitLaTeX,\
 []Latexmk-XeLaTeX,\
 []Latexmk-upLaTeX-pdfdvi-acroread,\
 []Latexmk-upLaTeX-pdfps-acroread,\
 []Latexmk-pLaTeX-ng-acroread,\
 []Latexmk-pdfLaTeX-acroread,\
 []Latexmk-LuaLaTeX-acroread,\
 []Latexmk-LuajitLaTeX-acroread,\
 []Latexmk-XeLaTeX-acroread,\
 -,\
 []SumatraPDF,\
 []fwdsumatrapdf,\
 []TeXworks,\
 []TeXstudio,\
 []Adobe Acrobat Reader DC,\
 -,\
 []Quit");
     switch (menuItem) {
     case 1:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var ptex2pdf = "ptex2pdf -u -l -ot \"-no-guess-input-enc -kanji=utf8 -synctex=1\"" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + ptex2pdf;
         execute(cmd, true);
         break;
     case 2:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latex = "uplatex -no-guess-input-enc -kanji=utf8 -synctex=1" + " " + ["\"", b, "\""].join("");
         var dvips = "dvips -Ppdf -z -f" + " " + ["\"", b, ".dvi", "\""].join("") + " | convbkmk -u > " + ["\"", b, ".ps", "\""].join("");
         var ps2pdf = "ps2pdf.exe" + " " + ["\"", b, ".ps", "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latex + " && " + dvips + " && " + ps2pdf;
         execute(cmd, true);
         break;
     case 3:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var platex_ng = "platex-ng -synctex=1" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + platex_ng;
         execute(cmd, true);
         break;
     case 4:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var pdflatex = "pdflatex -synctex=1" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + pdflatex;
         execute(cmd, true);
         break;
     case 5:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var lualatex = "lualatex -synctex=1" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + lualatex;
         execute(cmd, true);
         break;
     case 6:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var luajitlatex = "luajitlatex -synctex=1" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + luajitlatex;
         execute(cmd, true);
         break;
     case 7:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var xelatex = "xelatex -synctex=1" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + xelatex;
         execute(cmd, true);
         break;
     case 8:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 9:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$latex=q/uplatex %O -kanji=utf8 -no-guess-input-enc -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -e \"$$dvipdf=q/dvipdfmx %O -o %D %S/\" -norc -gg -pdfdvi" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 10:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$latex=q/uplatex %O -kanji=utf8 -no-guess-input-enc -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -e \"$$dvips=q/dvips %O -z -f %S | convbkmk -u > %D/\" -e \"$$ps2pdf=q/ps2pdf.exe %O %S %D/\" -norc -gg -pdfps" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 11:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$pdflatex=q/platex-ng %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdf" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 12:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$pdflatex=q/pdflatex %O -synctex=1 %S/\" -e \"$$bibtex=q/bibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/makeindex %O -o %D %S/\" -norc -gg -pdf" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 13:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$lualatex=q/lualatex %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdflua" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 14:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$lualatex=q/luajitlatex %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdflua" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 15:
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$xelatex=q/xelatex %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdfxe" + " " + ["\"", b, "\""].join("");
         var cmd = "cmd /c " + cd + " && " + latexmk;
         execute(cmd, true);
         break;
     case 16:
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$latex=q/uplatex %O -kanji=utf8 -no-guess-input-enc -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -e \"$$dvipdf=q/dvipdfmx %O -o %D %S/\" -norc -gg -pdfdvi" + " " + ["\"", b, "\""].join("");
         var pdf = ["\"", b, ".pdf", "\""].join("");
         var pdfopen = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"pdfopen --page %{page+1} --file \"%{output}\"\"";
         var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --file " + pdf + " && pdfclose --file " + pdf;
         var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + latexmk + " && " + pdfopen;
         execute(cmd, true);
         break;
     case 17:
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$latex=q/uplatex %O -kanji=utf8 -no-guess-input-enc -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -e \"$$dvips=q/dvips %O -z -f %S | convbkmk -u > %D/\" -e \"$$ps2pdf=q/ps2pdf.exe %O %S %D/\" -norc -gg -pdfps" + " " + ["\"", b, "\""].join("");
         var pdf = ["\"", b, ".pdf", "\""].join("");
         var pdfopen = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"pdfopen --page %{page+1} --file \"%{output}\"\"";
         var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --file " + pdf + " && pdfclose --file " + pdf;
         var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + latexmk + " && " + pdfopen;
         execute(cmd, true);
         break;
     case 18:
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$pdflatex=q/platex-ng %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdf" + " " + ["\"", b, "\""].join("");
         var pdf = ["\"", b, ".pdf", "\""].join("");
         var pdfopen = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"pdfopen --page %{page+1} --file \"%{output}\"\"";
         var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --file " + pdf + " && pdfclose --file " + pdf;
         var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + latexmk + " && " + pdfopen;
         execute(cmd, true);
         break;
     case 19:
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$pdflatex=q/pdflatex %O -synctex=1 %S/\" -e \"$$bibtex=q/bibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/makeindex %O -o %D %S/\" -norc -gg -pdf" + " " + ["\"", b, "\""].join("");
         var pdf = ["\"", b, ".pdf", "\""].join("");
         var pdfopen = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"pdfopen --page %{page+1} --file \"%{output}\"\"";
         var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --file " + pdf + " && pdfclose --file " + pdf;
         var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + latexmk + " && " + pdfopen;
         execute(cmd, true);
         break;
     case 20:
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$lualatex=q/lualatex %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdflua" + " " + ["\"", b, "\""].join("");
         var pdf = ["\"", b, ".pdf", "\""].join("");
         var pdfopen = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"pdfopen --page %{page+1} --file \"%{output}\"\"";
         var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --file " + pdf + " && pdfclose --file " + pdf;
         var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + latexmk + " && " + pdfopen;
         execute(cmd, true);
         break;
     case 21:
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$lualatex=q/luajitlatex %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdflua" + " " + ["\"", b, "\""].join("");
         var pdf = ["\"", b, ".pdf", "\""].join("");
         var pdfopen = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"pdfopen --page %{page+1} --file \"%{output}\"\"";
         var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --file " + pdf + " && pdfclose --file " + pdf;
         var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + latexmk + " && " + pdfopen;
         execute(cmd, true);
         break;
     case 22:
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var c = Editor.ExpandParameter("$e");
         var b = Editor.ExpandParameter("$g");
         var cd = "cd /d " + ["\"", c, "\""].join("");
         var latexmk = "latexmk -e \"$$xelatex=q/xelatex %O -synctex=1 %S/\" -e \"$$bibtex=q/upbibtex %O %B/\" -e \"$$biber=q/biber %O --bblencoding=utf8 -u -U --output_safechars %B/\" -e \"$$makeindex=q/upmendex %O -o %D %S/\" -norc -gg -pdfxe" + " " + ["\"", b, "\""].join("");
         var pdf = ["\"", b, ".pdf", "\""].join("");
         var pdfopen = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"pdfopen --page %{page+1} --file \"%{output}\"\"";
         var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --file " + pdf + " && pdfclose --file " + pdf;
         var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + latexmk + " && " + pdfopen;
         execute(cmd, true);
         break;
     case 23:
         var fso = new ActiveXObject("Scripting.FileSystemObject");
         var wshShell = new ActiveXObject("WScript.Shell");
         var sakuraEditor = Editor.ExpandParameter("$S");
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var sumatraPDF = "C:\\Program Files\\SumatraPDF\\SumatraPDF.exe";
         var existSumatraPDF = true;
 
         try {
             sumatraPDF = wshShell.RegRead("HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\SumatraPDF.exe\\");
         } catch (e) {
             if (!fso.FileExists(sumatraPDF)) {
                 sumatraPDF = Editor.InputBox("Input the path to SumatraPDF.exe.", "SumatraPDF.exe", 255);
                 if (!fso.FileExists(sumatraPDF)) {
                     sumatraPDF = "rundll32 shell32,ShellExec_RunDLL SumatraPDF";
                     existSumatraPDF = false;
                 }
             }
         }
 
         if (existSumatraPDF) {
             sumatraPDF = ["\"", sumatraPDF, "\""].join("");
         }
 
         if (!fso.FileExists(pdfFile)) {
             var mainTeXFile = Editor.InputBox("Input the path to main TeX file.", pdfFile.replace(suffix, ".tex"), 255);
             if (mainTeXFile != "") {
                 pdfFile = mainTeXFile.replace(suffix, ".pdf");
             }
         }
 
         var mainTeXDir = fso.GetParentFolderName(pdfFile);
         var cd = "cd /d " + ["\"", mainTeXDir, "\""].join("");
         currentTeXFile = ["\"", currentTeXFile, "\""].join("");
         pdfFile = ["\"", pdfFile, "\""].join("");
 
         var args = sumatraPDF + " -reuse-instance " + pdfFile + " -inverse-search \"\\\"" + sakuraEditor + "\\\" -X=%c -Y=%l \\\"%f\\\"\"" + " -forward-search " + currentTeXFile + " " + line;
         var cmd = "cmd /c " + cd + " && echo " + args + " | cmd";
         execute(cmd, false);
         break;
     case 24:
         var fso = new ActiveXObject("Scripting.FileSystemObject");
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var fwdsumatrapdf = "fwdsumatrapdf.exe";
 
         if (!fso.FileExists(pdfFile)) {
             var mainTeXFile = Editor.InputBox("Input the path to main TeX file.", pdfFile.replace(suffix, ".tex"), 255);
             if (mainTeXFile != "") {
                 pdfFile = mainTeXFile.replace(suffix, ".pdf");
             }
         }
 
         var mainTeXDir = fso.GetParentFolderName(pdfFile);
         var cd = "cd /d " + ["\"", mainTeXDir, "\""].join("");
         currentTeXFile = ["\"", currentTeXFile, "\""].join("");
         pdfFile = ["\"", pdfFile, "\""].join("");
 
         var args = fwdsumatrapdf + " " + pdfFile + " " + currentTeXFile + " " + line;
         var cmd = "cmd /c " + cd + " && " + args;
         execute(cmd, false);
         break;
     case 25:
         var fso = new ActiveXObject("Scripting.FileSystemObject");
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var texworks = "texworks";
 
         if (!fso.FileExists(pdfFile)) {
             var mainTeXFile = Editor.InputBox("Input the path to main TeX file.", pdfFile.replace(suffix, ".tex"), 255);
             if (mainTeXFile != "") {
                 pdfFile = mainTeXFile.replace(suffix, ".pdf");
             }
         }
 
         var mainTeXDir = fso.GetParentFolderName(pdfFile);
         var cd = "cd /d " + ["\"", mainTeXDir, "\""].join("");
         var args = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"" + texworks + " --position=%{page+1} \"%{output}\"\"";
 
         var cmd = "cmd /c " + cd + " && echo " + args + " | cmd";
         execute(cmd, false);
         break;
     case 26:
         var fso = new ActiveXObject("Scripting.FileSystemObject");
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var texstudio = "texstudio";
 
         if (!fso.FileExists(pdfFile)) {
             var mainTeXFile = Editor.InputBox("Input the path to main TeX file.", pdfFile.replace(suffix, ".tex"), 255);
             if (mainTeXFile != "") {
                 pdfFile = mainTeXFile.replace(suffix, ".pdf");
             }
         }
 
         var mainTeXDir = fso.GetParentFolderName(pdfFile);
         var cd = "cd /d " + ["\"", mainTeXDir, "\""].join("");
         var args = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"" + texstudio + " --pdf-viewer-only --page %{page+1} \"%{output}\"\"";
 
         var cmd = "cmd /c " + cd + " && echo " + args + " | cmd";
         execute(cmd, false);
         break;
     case 27:
         var fso = new ActiveXObject("Scripting.FileSystemObject");
         var currentTeXFile = Editor.ExpandParameter("$F");
         var suffix = /\.[^.]*$/;
         var pdfFile = currentTeXFile.replace(suffix, ".pdf");
         var line = Editor.ExpandParameter("$y");
         var pdfopen = "pdfopen";
 
         if (!fso.FileExists(pdfFile)) {
             var mainTeXFile = Editor.InputBox("Input the path to main TeX file.", pdfFile.replace(suffix, ".tex"), 255);
             if (mainTeXFile != "") {
                 pdfFile = mainTeXFile.replace(suffix, ".pdf");
             }
         }
 
         var mainTeXDir = fso.GetParentFolderName(pdfFile);
         var cd = "cd /d " + ["\"", mainTeXDir, "\""].join("");
         var args = "synctex view -i \"" + line + ":0:" + currentTeXFile + "\" -o \"" + pdfFile + "\" -x \"" + pdfopen + " --page %{page+1} --file \"%{output}\"\"";
 
         var cmd = "cmd /c " + cd + " && echo " + args + " | cmd";
         execute(cmd, false);
         break;
     case 28:
         return;
         break;
     default:
         return;
         break;
     }
 
     function execute(commandLine, save) {
         Editor.StatusMsg(commandLine, 0);
         if (save) {
             Editor.FileSave();
         }
         Editor.ExecCommand(commandLine, 0x81);
     }
 })();
----