changeset 7:18eff4ddae61

fix readme
author matac42 <matac@cr.ie.u-ryukyu.ac.jp>
date Fri, 01 Dec 2023 12:59:59 +0900
parents 8e0c6a7e9b7f
children 147d41a32066
files Paper/master_paper.pdf README.md
diffstat 2 files changed, 79 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
Binary file Paper/master_paper.pdf has changed
--- a/README.md	Tue Nov 21 12:08:58 2023 +0900
+++ b/README.md	Fri Dec 01 12:59:59 2023 +0900
@@ -1,24 +1,40 @@
 ## How to build tex
 
-1. Create an environment in which `ptex2pdf` and `pbibtex` can run.
+1. Create an environment in which `latexmk` can run.
 2. Add the following to the VSCode configuration JSON.
 
 ```
 {
+    // ---------- Language ----------
+
     "[tex]": {
+        // スニペット補完中にも補完を使えるようにする
         "editor.suggest.snippetsPreventQuickSuggestions": false,
+        // インデント幅を2にする
+        "editor.tabSize": 2
+    },
+
+    "[latex]": {
+        // スニペット補完中にも補完を使えるようにする
+        "editor.suggest.snippetsPreventQuickSuggestions": false,
+        // インデント幅を2にする
         "editor.tabSize": 2
     },
-    "[latex]": {
-        "editor.suggest.snippetsPreventQuickSuggestions": false,
-        "editor.tabSize": 2,
-        "editor.formatOnSave": false
-    },
+
     "[bibtex]": {
+        // インデント幅を2にする
         "editor.tabSize": 2
     },
+
+
+    // ---------- LaTeX Workshop ----------
+
+    // 使用パッケージのコマンドや環境の補完を有効にする
     "latex-workshop.intellisense.package.enabled": true,
-    "latex-workshop.latex.autoBuild.cleanAndRetry.enabled": true,
+
+    // 生成ファイルを削除するときに対象とするファイル
+    // デフォルト値に "*.synctex.gz" を追加
+    "latex-workshop.latex.autoClean.run": "onBuilt",
     "latex-workshop.latex.clean.fileTypes": [
         "*.aux",
         "*.bbl",
@@ -42,61 +58,71 @@
         "*.snm",
         "*.nav",
         "*.dvi",
+        "*.ilg",
         "*.synctex.gz"
     ],
-    "latex-workshop.latex.outDir": ".",
+
+    // 生成ファイルを現在のディレクトリに吐き出す
+    "latex-workshop.latex.outDir": "",
+
+    // ビルドのレシピ
+    "latex-workshop.latex.recipes": [
+        {
+            "name": "latexmk",
+            "tools": [
+                "latexmk"
+            ]
+        },
+    ],
+
+    // ビルドのレシピに使われるパーツ
     "latex-workshop.latex.tools": [
         {
-            "command": "ptex2pdf",
+            "name": "latexmk",
+            "command": "latexmk",
             "args": [
-                "-l",
-                "-ot",
-                "-kanji=utf8 -synctex=1",
+                "-silent",
+                "-outdir=%OUTDIR%",
                 "%DOC%"
             ],
-            "name": "Step 1: ptex2pdf"
         },
-        {
-            "command": "pbibtex",
-            "args": [
-                "%DOCFILE%",
-                "-kanji=utf8"
-            ],
-            "name": "Step 2: pbibtex"
-        },
-        {
-            "command": "ptex2pdf",
-            "args": [
-                "-l",
-                "-ot",
-                "-kanji=utf8 -synctex=1",
-                "%DOC%"
-            ],
-            "name": "Step 3: ptex2pdf"
-        },
-        {
-            "command": "ptex2pdf",
-            "args": [
-                "-l",
-                "-ot",
-                "-kanji=utf8 -synctex=1",
-                "%DOC%"
-            ],
-            "name": "Step 4: ptex2pdf"
-        }
     ],
-    "latex-workshop.latex.recipes": [
-        {
-            "name": "toolchain",
-            "tools": [
-                "Step 1: ptex2pdf",
-                "Step 2: pbibtex",
-                "Step 3: ptex2pdf",
-                "Step 4: ptex2pdf"
-            ]
-        }
-    ],
-    "latex-workshop.view.pdf.viewer": "tab",
 }
 ```
 
+1. Add following the .latexmk files in home dir.
+
+```
+#!/usr/bin/env perl
+
+# LaTeX
+$latex = 'platex -synctex=1 -halt-on-error -file-line-error %O %S';
+$max_repeat = 5;
+
+# BibTeX
+$bibtex = 'pbibtex %O %S';
+$biber = 'biber --bblencoding=utf8 -u -U --output_safechars %O %S';
+
+# index
+# $makeindex = 'mendex %O -o %D %S';
+
+# DVI / PDF
+$dvipdf = 'dvipdfmx %O -o %D %S';
+$pdf_mode = 3;
+
+# preview
+$pvc_view_file_via_temporary = 0;
+if ($^O eq 'linux') {
+    $dvi_previewer = "xdg-open %S";
+    $pdf_previewer = "xdg-open %S";
+} elsif ($^O eq 'darwin') {
+    $dvi_previewer = "open %S";
+    $pdf_previewer = "open %S";
+} else {
+    $dvi_previewer = "start %S";
+    $pdf_previewer = "start %S";
+}
+
+# clean up
+$clean_full_ext = "%R.synctex.gz"
+```
\ No newline at end of file