[[秀丸エディタ]] > マクロ

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

#contents

*マクロ [#m32041fb]

-[[秀まるおのホームページ(サイトー企画) ヘルプファイルサイト:http://homepage3.nifty.com/kons/hidemaru/helpsite/]]
--[[秀丸エディタ マクロ言語ヘルプ目次:http://homepage3.nifty.com/kons/hidemaru/helpsite/hidemac/]]

マクロを使うと LaTeX 環境を簡単に作ることができます.~

**[[祝鳥 (のりてふ)>祝鳥]] [#mdf32e5b]

[[祝鳥 - TeX Wiki>祝鳥]] を参照.~

//**RaTeX0e [#s1e27527]
//-[[RaTeX0e:http://uca-works.com/program/ratex.html]]
//(福中 公輔 さん)
//
//**AutoHotKey スクリプト [#va7fd93d]
//-[[AutoHotKey スクリプト:http://ryo-t.com/diary/?p=94]]
//(谷内 稜 さん)
//
//**秀丸エディタで LaTeX [#ubdba7fd]
//-[[秀丸エディタで LaTeX (hidemacro-070502.tar.gz):http://www.cymric.jp/old/tex/hidemaru.html]]
//(Maxima 普及委員会)
//
//**秀丸で簡単コンパイル [#m6700653]
//-[[秀丸で簡単コンパイル:http://imawamukashi.web.fc2.com/TeX/hidemacro.html]]
//(Outsider's Website)
//
//**秀丸マクロ for TeX editing [#h3f49b53]
//-[[秀丸マクロ for TeX editing:http://wiki.livedoor.jp/fuhmi/d/%CA%AA%C3%D6]]
//(fuhmi さん)
//
//**トリビュート [#qac4762a]
//-[[トリビュート:http://www.vector.co.jp/soft/win95/writing/se259789.html]], [[LaTeX2e 用強調表示定義ファイル:http://homepage2.nifty.com/masema/software/LaTeX_hilight.html]]
//(ませま さん)
//
//**LaTeX Compile HIDEMARU Macro [#w6e15581]
//-[[LaTeX Compile HIDEMARU Macro (LaTeXコンパイル用秀丸マクロ):http://hide.maruo.co.jp/lib/macro/lcm11.html]]
//(岩里 さん)
//
//**TeX用改行コード挿入マクロ [#ndf01264]
//-[[TeX用改行コード挿入マクロ:http://hide.maruo.co.jp/lib/macro/il-fc093.html]] (haze さん)
//
//**TeX Module Control with HIDEMARU Macro [#rff2c60d]
//-[[TeX Module Control with HIDEMARU Macro:http://www.ceres.dti.ne.jp/~sugiura/hidemaru/macros/tex_mc/index.html]]
//(杉浦 方紀 さん)
//
//**LaTeX コンパイル支援マクロ [#ob9080ba]
//-[[LaTeX コンパイル支援マクロ:http://www.seman.cs.uec.ac.jp/~inuzuka/hidemac.html]]
//(犬塚 敦史 さん)
//
//**飛鳥 (ひちょう) HiTeX [#y3147877]
//-[[飛鳥 (ひちょう) HiTeX:https://www.yatex.org/HiTeX/]]
//(安田 晴行 さん)

**Typeset.mac [#p8973c54]
----
 mousemenu
     "upLaTeX (ptex2pdf)",
     "upLaTeX (dvips + ps2pdf)",
     "pdfLaTeX",
     "LuaLaTeX",
     "LuaJITLaTeX",
     "XeLaTeX",
     "\x01",
     "upLaTeX (ptex2pdf) [Adobe Reader]",
     "upLaTeX (dvips + ps2pdf) [Adobe Reader]",
     "pdfLaTeX [Adobe Reader]",
     "LuaLaTeX [Adobe Reader]",
     "LuaJITLaTeX [Adobe Reader]",
     "XeLaTeX [Adobe Reader]",
     "\x01",
     "upBibTeX",
     "BibTeX",
     "BibTeXu",
     "\x01",
     "Mendex",
     "MakeIndex",
     "TeXindy",
     "\x01",
     "TeXworks",
     "SumatraPDF",
     "fwdsumatrapdf",
     "pdfopen",
     "\x01",
     "Quit";
 if (result == 0) {
     endmacro;
 } else if (result == 1) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$ptex2pdf = "ptex2pdf -l -u -ot \"-synctex=1 -no-guess-input-enc -kanji=utf8 -sjis-terminal\"" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$ptex2pdf;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 2) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$latex = "uplatex -synctex=1 -no-guess-input-enc -kanji=utf8 -sjis-terminal" + " " + "\"" + $$b + "\"";
     $$dvips = "dvips -Ppdf -z -f" + " " + "\"" + $$b + ".dvi" + "\"" + " | convbkmk -u > " + "\"" + $$b + ".ps" + "\"";
     $$ps2pdf = "ps2pdf.bat" + " " + "\"" + $$b + ".ps" + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$latex + " && " + $$dvips + " && " + $$ps2pdf;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 3) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$pdflatex = "pdflatex -synctex=1" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$pdflatex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 4) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$lualatex = "lualatex -synctex=1" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$lualatex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 5) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$luajitlatex = "luajitlatex -synctex=1" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$luajitlatex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 6) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$xelatex = "xelatex -synctex=1" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$xelatex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 8) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$ptex2pdf = "ptex2pdf -l -u -ot \"-no-guess-input-enc -kanji=utf8 -sjis-terminal\"" + " " + "\"" + $$b + "\"";
     $$pdf = "\"" + $$b + ".pdf" + "\"";
     $$pdfopen = "powershell -Command \"& {$pdf = \"\"" + $$pdf + "\"\"; $pages = (pdfinfo $pdf | Select-String \"^Pages:\"); $page = (-split $pages)[1]; pdfopen --rxi --file $pdf --page $page}\"";
     $$pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --rxi --file " + $$pdf + " && pdfclose --rxi --file " + $$pdf;
     $$cmd = "cmd /c " + $$cd + " && " + $$pdfclose + " & " + $$ptex2pdf + " && " + $$pdfopen;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 9) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$latex = "uplatex -no-guess-input-enc -kanji=utf8 -sjis-terminal" + " " + "\"" + $$b + "\"";
     $$dvips = "dvips -Ppdf -z -f" + " " + "\"" + $$b + ".dvi" + "\"" + " | convbkmk -u > " + "\"" + $$b + ".ps" + "\"";
     $$ps2pdf = "ps2pdf.bat" + " " + "\"" + $$b + ".ps" + "\"";
     $$pdf = "\"" + $$b + ".pdf" + "\"";
     $$pdfopen = "powershell -Command \"& {$pdf = \"\"" + $$pdf + "\"\"; $pages = (pdfinfo $pdf | Select-String \"^Pages:\"); $page = (-split $pages)[1]; pdfopen --rxi --file $pdf --page $page}\"";
     $$pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --rxi --file " + $$pdf + " && pdfclose --rxi --file " + $$pdf;
     $$cmd = "cmd /c " + $$cd + " && " + $$pdfclose + " & " + $$latex + " && " + $$dvips + " && " + $$ps2pdf + " && " + $$pdfopen;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 10) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$pdflatex = "pdflatex" + " " + "\"" + $$b + "\"";
     $$pdf = "\"" + $$b + ".pdf" + "\"";
     $$pdfopen = "powershell -Command \"& {$pdf = \"\"" + $$pdf + "\"\"; $pages = (pdfinfo $pdf | Select-String \"^Pages:\"); $page = (-split $pages)[1]; pdfopen --rxi --file $pdf --page $page}\"";
     $$pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --rxi --file " + $$pdf + " && pdfclose --rxi --file " + $$pdf;
     $$cmd = "cmd /c " + $$cd + " && " + $$pdfclose + " & " + $$pdflatex + " && " + $$pdfopen;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 11) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$lualatex = "lualatex" + " " + "\"" + $$b + "\"";
     $$pdf = "\"" + $$b + ".pdf" + "\"";
     $$pdfopen = "powershell -Command \"& {$pdf = \"\"" + $$pdf + "\"\"; $pages = (pdfinfo $pdf | Select-String \"^Pages:\"); $page = (-split $pages)[1]; pdfopen --rxi --file $pdf --page $page}\"";
     $$pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --rxi --file " + $$pdf + " && pdfclose --rxi --file " + $$pdf;
     $$cmd = "cmd /c " + $$cd + " && " + $$pdfclose + " & " + $$lualatex + " && " + $$pdfopen;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 12) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$luajitlatex = "luajitlatex" + " " + "\"" + $$b + "\"";
     $$pdf = "\"" + $$b + ".pdf" + "\"";
     $$pdfopen = "powershell -Command \"& {$pdf = \"\"" + $$pdf + "\"\"; $pages = (pdfinfo $pdf | Select-String \"^Pages:\"); $page = (-split $pages)[1]; pdfopen --rxi --file $pdf --page $page}\"";
     $$pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --rxi --file " + $$pdf + " && pdfclose --rxi --file " + $$pdf;
     $$cmd = "cmd /c " + $$cd + " && " + $$pdfclose + " & " + $$luajitlatex + " && " + $$pdfopen;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 13) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$xelatex = "xelatex" + " " + "\"" + $$b + "\"";
     $$pdf = "\"" + $$b + ".pdf" + "\"";
     $$pdfopen = "powershell -Command \"& {$pdf = \"\"" + $$pdf + "\"\"; $pages = (pdfinfo $pdf | Select-String \"^Pages:\"); $page = (-split $pages)[1]; pdfopen --rxi --file $pdf --page $page}\"";
     $$pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --rxi --file " + $$pdf + " && pdfclose --rxi --file " + $$pdf;
     $$cmd = "cmd /c " + $$cd + " && " + $$pdfclose + " & " + $$xelatex + " && " + $$pdfopen;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 15) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$bibtex = "upbibtex" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$bibtex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 16) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$bibtex = "bibtex" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$bibtex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 17) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$bibtex = "bibtexu" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$bibtex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 19) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$makeindex = "mendex -U -T" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$makeindex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 20) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$makeindex = "makeindex" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$makeindex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 21) {
     ##fso = createobject("Scripting.FileSystemObject");
     $$c = callmethod_returnstr(##fso, "GetParentFolderName", filename2);
     $$b = callmethod_returnstr(##fso, "GetBaseName", filename2);
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$c + "\"";
     $$makeindex = "texindy" + " " + "\"" + $$b + "\"";
     $$cmd = "cmd /c " + $$cd + " && " + $$makeindex;
 
     save;
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 23) {
     ##fso = createobject("Scripting.FileSystemObject");
     ##re = createobject("VBScript.RegExp");
     $$currentTeXFile = filename2;
     setpropstr ##re, "Pattern", "\.[^.]*$";
     $$pdfFile = callmethod_returnstr(##re, "Replace", $$currentTeXFile, ".pdf");
     $$texworks = "texworks";
 
     if (!existfile($$pdfFile)) {
         $$mainTeXFile = input("Input the path to main TeX file.", callmethod_returnstr(##re, "Replace", $$pdfFile, ".tex"));
         if ($$mainTeXFile != "") {
             $$pdfFile = callmethod_returnstr(##re, "Replace", $$mainTeXFile, ".pdf");
         }
     }
 
     $$mainTeXDir = callmethod_returnstr(##fso, "GetParentFolderName", $$pdfFile);
     releaseobject ##re;
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$mainTeXDir + "\"";
     $$pdfFile = "\"" + $$pdfFile + "\"";
     $$args = $$texworks + " " + $$pdfFile;
     $$cmd = "cmd /c " + $$cd + " && echo " + $$args + " | cmd";
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 24) {
     ##fso = createobject("Scripting.FileSystemObject");
     ##re = createobject("VBScript.RegExp");
     $$hidemaru = hidemarudir + "\\Hidemaru.exe";
     $$currentTeXFile = filename2;
     setpropstr ##re, "Pattern", "\.[^.]*$";
     $$pdfFile = callmethod_returnstr(##re, "Replace", $$currentTeXFile, ".pdf");
     $$line = str(lineno);
     $$sumatraPDF = "C:\\Program Files\\SumatraPDF\\SumatraPDF.exe";
     ##existSumatraPDF = 1;
 
     openreg "LOCALMACHINE", "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\SumatraPDF.exe";
     if (result == 1) {
         $$sumatraPDF = getregstr("");
         if (!existfile($$sumatraPDF)) {
             $$sumatraPDF = input("Input the path to SumatraPDF.exe.", "SumatraPDF.exe");
             if (!existfile($$sumatraPDF)) {
                 $$sumatraPDF = "rundll32 shell32,ShellExec_RunDLL SumatraPDF";
                 ##existSumatraPDF = 0;
             }
         }
         closereg;
     } else {
         $$sumatraPDF = input("Input the path to SumatraPDF.exe.", "SumatraPDF.exe");
         if (!existfile($$sumatraPDF)) {
             $$sumatraPDF = "rundll32 shell32,ShellExec_RunDLL SumatraPDF";
             ##existSumatraPDF = 0;
         }
     }
 
     if (##existSumatraPDF == 1) {
         $$sumatraPDF = "\"" + $$sumatraPDF + "\"";
     }
 
     if (!existfile($$pdfFile)) {
         $$mainTeXFile = input("Input the path to main TeX file.", callmethod_returnstr(##re, "Replace", $$pdfFile, ".tex"));
         if ($$mainTeXFile != "") {
             $$pdfFile = callmethod_returnstr(##re, "Replace", $$mainTeXFile, ".pdf");
         }
     }
 
     $$mainTeXDir = callmethod_returnstr(##fso, "GetParentFolderName", $$pdfFile);
     releaseobject ##re;
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$mainTeXDir + "\"";
     $$currentTeXFile = "\"" + $$currentTeXFile + "\"";
     $$pdfFile = "\"" + $$pdfFile + "\"";
     $$args = $$sumatraPDF + " -reuse-instance " + $$pdfFile + " -inverse-search \"\\\"" + $$hidemaru + "\\\" /m3 /j%%l,%%c \\\"%%f\\\"\"" + " -forward-search " + $$currentTeXFile + " " + $$line;
     $$cmd = "cmd /c " + $$cd + " && echo " + $$args + " | cmd";
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 25) {
     ##fso = createobject("Scripting.FileSystemObject");
     ##re = createobject("VBScript.RegExp");
     $$currentTeXFile = filename2;
     setpropstr ##re, "Pattern", "\.[^.]*$";
     $$pdfFile = callmethod_returnstr(##re, "Replace", $$currentTeXFile, ".pdf");
     $$line = str(lineno);
     $$fwdsumatrapdf = "fwdsumatrapdf.exe";
 
     if (!existfile($$pdfFile)) {
         $$mainTeXFile = input("Input the path to main TeX file.", callmethod_returnstr(##re, "Replace", $$pdfFile, ".tex"));
         if ($$mainTeXFile != "") {
             $$pdfFile = callmethod_returnstr(##re, "Replace", $$mainTeXFile, ".pdf");
         }
     }
 
     $$mainTeXDir = callmethod_returnstr(##fso, "GetParentFolderName", $$pdfFile);
     releaseobject ##re;
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$mainTeXDir + "\"";
     $$currentTeXFile = "\"" + $$currentTeXFile + "\"";
     $$pdfFile = "\"" + $$pdfFile + "\"";
     $$args = $$fwdsumatrapdf + " " + $$pdfFile + " " + $$currentTeXFile + " " + $$line;
     $$cmd = "cmd /c " + $$cd + " && echo " + $$args + " | cmd";
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 26) {
     ##fso = createobject("Scripting.FileSystemObject");
     ##re = createobject("VBScript.RegExp");
     $$currentTeXFile = filename2;
     setpropstr ##re, "Pattern", "\.[^.]*$";
     $$pdfFile = callmethod_returnstr(##re, "Replace", $$currentTeXFile, ".pdf");
     $$pdfopen = "pdfopen";
 
     if (!existfile($$pdfFile)) {
         $$mainTeXFile = input("Input the path to main TeX file.", callmethod_returnstr(##re, "Replace", $$pdfFile, ".tex"));
         if ($$mainTeXFile != "") {
             $$pdfFile = callmethod_returnstr(##re, "Replace", $$mainTeXFile, ".pdf");
         }
     }
 
     $$mainTeXDir = callmethod_returnstr(##fso, "GetParentFolderName", $$pdfFile);
     releaseobject ##re;
     releaseobject ##fso;
     $$cd = "cd /d " + "\"" + $$mainTeXDir + "\"";
     $$pdfFile = "\"" + $$pdfFile + "\"";
     $$args = $$pdfopen + " --rxi --file " + $$pdfFile;
     $$cmd = "cmd /c " + $$cd + " && echo " + $$args + " | cmd";
     runex $$cmd, 0, 0, "", 7, "", 1, "", 1, "", 0, 0, 0;
     endmacro;
 } else if (result == 28) {
     endmacro;
 } else {
     endmacro;
 }
----

*SumatraPDF との連携 [#r1840cf4]

[[祝鳥]]は SumatraPDF の forward and inverse search に対応しています.

**forward and inverse search (SumatraPDF を前面に表示したい場合) [#k083ca2e]

Typeset.mac を実行して

-upLaTeX (ptex2pdf)
-upLaTeX (dvips + ps2pdf)
-pdfLaTeX
-LuaLaTeX
-LuaJITLaTeX
-XeLaTeX

を選択します.

再び Typeset.mac を実行して SumatraPDF を選択します.~

**forward search (SumatraPDF を前面に表示したくない場合) [#od122e97]

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

Typeset.mac を実行して

-upLaTeX (ptex2pdf)
-upLaTeX (dvips + ps2pdf)
-pdfLaTeX
-LuaLaTeX
-LuaJITLaTeX
-XeLaTeX

を選択します.

再び Typeset.mac を実行して fwdsumatrapdf を選択します.~

**inverse search [#zd12c371]

-64-bit版 Windows で 64-bit版の秀丸エディタを使用する場合
-32-bit版 Windows で 32-bit版の秀丸エディタを使用する場合

 "C:\Program Files\Hidemaru\Hidemaru.exe" /m3 /j%l,%c "%f"

-64-bit版 Windows で 32-bit版の秀丸エディタを使用する場合

 "C:\Program Files (x86)\Hidemaru\Hidemaru.exe" /m3 /j%l,%c "%f"

*Adobe Reader との連携 [#z5e51515]

[[祝鳥]]は Adobe Reader の DDE, Adobe Acrobat の DDE, OLE に対応しています.

Typeset.mac を実行して

-upLaTeX (ptex2pdf) [Adobe Reader]
-upLaTeX (dvips + ps2pdf) [Adobe Reader]
-pdfLaTeX [Adobe Reader]
-LuaLaTeX [Adobe Reader]
-LuaJITLaTeX [Adobe Reader]
-XeLaTeX [Adobe Reader]

を選択します.