- 追加された行はこの色です。
- 削除された行はこの色です。
* TeXでコンパイル→Adobe Readerで表示 [#z27b03ee]
* LaTeX用タイプセットスクリプト [#z27b03ee]
-ページ: [[Macro/投稿]]
-作者: sai
-カテゴリー: js
-投稿日: 2014-01-22 (水) 11:00:00
-投稿日: 2015-10-27 (火) 00:00:00
** メッセージ [#cc3bd5df]
#code(javascript){{
(function () {
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 ptex2pdf = "ptex2pdf -u -l -ot \"-no-guess-input-enc -kanji=utf8 -synctex=1\"" + " " + ["\"", b, "\""].join("");
var pdf = ["\"", b, ".pdf", "\""].join("");
var pdfopen = "powershell -Command \"& {$$line = \"\"\"" + line + "\"\"\"; $$src = \"\"\"" + currentTeXFile + "\"\"\"; $$pdf = \"\"\"" + pdfFile + "\"\"\"; $$param = $$line + \"\"\":0:\"\"\" + $$src; $$pageInfo = (synctex view -i $$param -o $$pdf | Select-String \"^Page:\"); $$page = ($$pageInfo -split \"\"\":\"\"\")[1]; pdfopen --rxi --file $$pdf --page $$page}\"";
var pdfclose = "tasklist /fi \"IMAGENAME eq AcroRd32.exe\" /nh | findstr \"AcroRd32.exe\" > nul && pdfopen --rxi --file " + pdf + " && pdfclose --rxi --file " + pdf;
var cmd = "cmd /c " + cd + " && " + pdfclose + " & " + ptex2pdf + " && " + pdfopen;
*** LaTeX用タイプセットスクリプト [#ae3ef185]
-Typeset.js
Editor.StatusMsg(cmd, 0);
Editor.FileSave();
Editor.ExecCommand(cmd, 0x81);
}.call(this));
}}
サクラエディタ Ver. 2.2.0.0 以降が必要です.
#code(javascript,Typeset.js)
----
#comment