├── .devcontainer ├── .latexmkrc ├── Dockerfile ├── devcontainer.json └── docker-compose.yml ├── .gitignore ├── .vscode ├── latex.json.code-snippets └── settings.json ├── README.md ├── docs ├── how_to_use_codespace.md ├── how_to_use_devContainer.md └── image │ ├── CyTeX.svg │ ├── account.png │ ├── create-codespace.png │ ├── vscode-git-icon.png │ └── vscode_><.png ├── main.tex └── out └── main.pdf /.devcontainer/.latexmkrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # LaTeX 4 | $latex = 'platex -synctex=1 -halt-on-error -file-line-error %O %S'; 5 | $max_repeat = 5; 6 | 7 | # BibTeX 8 | $bibtex = 'pbibtex %O %S'; 9 | $biber = 'biber --bblencoding=utf8 -u -U --output_safechars %O %S'; 10 | 11 | # index 12 | $makeindex = 'mendex %O -o %D %S'; 13 | 14 | # DVI / PDF 15 | $dvipdf = 'dvipdfmx %O -o %D %S'; 16 | $pdf_mode = 3; 17 | 18 | # preview 19 | $pvc_view_file_via_temporary = 0; 20 | if ($^O eq 'linux') { 21 | $dvi_previewer = "xdg-open %S"; 22 | $pdf_previewer = "xdg-open %S"; 23 | } elsif ($^O eq 'darwin') { 24 | $dvi_previewer = "open %S"; 25 | $pdf_previewer = "open %S"; 26 | } else { 27 | $dvi_previewer = "start %S"; 28 | $pdf_previewer = "start %S"; 29 | } 30 | 31 | # clean up 32 | $clean_full_ext = "%R.synctex.gz" -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # tanuking551/cytex-texlive 2 | # https://hub.docker.com/r/tanuking551/cytex-texlive 3 | 4 | FROM ubuntu:24.04 5 | 6 | ENV DEBIAN_FRONTEND=noninteractive 7 | 8 | RUN apt-get update && apt-get install -y 9 | 10 | # install texlive 11 | RUN apt-get install -y \ 12 | evince \ 13 | latexmk \ 14 | language-pack-ja \ 15 | texlive-latex-base \ 16 | texlive-lang-japanese \ 17 | texlive-latex-recommended \ 18 | texlive-latex-extra \ 19 | texlive-fonts-recommended \ 20 | texlive-extra-utils \ 21 | xzdec 22 | 23 | RUN apt-get install -y \ 24 | cpanminus \ 25 | make \ 26 | perl 27 | 28 | # install utilities 29 | RUN apt-get install -y \ 30 | git \ 31 | wget 32 | 33 | # clean up 34 | RUN rm -rf /var/lib/apt/lists/* \ 35 | && apt-get clean 36 | 37 | 38 | RUN tlmgr init-usertree 39 | # RUN kanji-config-updmap-sys ipaex 40 | 41 | CMD ["bash"] 42 | 43 | # RUN cpanm Log::Log4perl Log::Dispatch::File YAML::Tiny File::HomeDir Unicode::GCString 44 | # RUN cpan install Log::Log4perl File::HomeDir -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cytex", 3 | "dockerComposeFile": "docker-compose.yml", 4 | "service": "cytex-texlive", 5 | "workspaceFolder": "/workspaces/CyTeX", 6 | "shutdownAction": "stopCompose", 7 | "customizations": { 8 | "vscode": { 9 | "settings": { 10 | "extensions.verifySignature": false 11 | }, 12 | "extensions": [ 13 | "james-yu.latex-workshop", 14 | "MS-CEINTL.vscode-language-pack-ja", 15 | "mhutchie.git-graph", 16 | "eamodio.gitlens" 17 | ] 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /.devcontainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | cytex-texlive: 3 | image: ran350/cytex-texlive:0.1.0 4 | # build: . # if you want to build the image locally 5 | volumes: 6 | - ../:/workspaces/CyTeX 7 | - ./.latexmkrc:/root/.latexmkrc 8 | tty: true 9 | environment: 10 | SHELL: "/bin/bash" 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.dvi 3 | *.fdb_latexmk 4 | *.fls 5 | *.synctex.gz 6 | *.log 7 | 8 | .DS_Store 9 | 10 | out/* 11 | !out/*.pdf -------------------------------------------------------------------------------- /.vscode/latex.json.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | // Place your snippets for latex here. Each snippet is defined under a snippet name and has a prefix, body and 3 | // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 4 | // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 5 | // same ids are connected. 6 | // Example: 7 | // "Print to console": { 8 | // "prefix": "log", 9 | // "body": [ 10 | // "console.log('$1');", 11 | // "$2" 12 | // ], 13 | // "description": "Log output to console" 14 | // } 15 | "deviding-line": { 16 | "prefix": "dividing-line", 17 | "body": [ 18 | "% -------------------------------------------------------- % " 19 | ], 20 | "description": "区切り線" 21 | }, 22 | "itemize": { 23 | "prefix": "itemize", 24 | "body": [ 25 | "\\begin{itemize}", 26 | " \\item $1", 27 | "\\end{itemize}" 28 | ], 29 | "description": "箇条書き" 30 | }, 31 | "input-soruce-code": { 32 | "prefix": "input-source-code", 33 | "body": [ 34 | "\\begin{figure}[tb]", 35 | " \\centering", 36 | " \\lstinputlisting[caption=$1, label=list:$2]{$3}", 37 | "\\end{figure}" 38 | ], 39 | "description": "ソースコードの読み込み" 40 | }, 41 | "source-code": { 42 | "prefix": "source-code", 43 | "body": [ 44 | "\\begin{figure}[tb]", 45 | "\\begin{lstlisting}[language=$1, caption={$2}, label={list:$3}]", 46 | "$4", 47 | "\\end{lstlisting}", 48 | "\\end{figure}" 49 | ], 50 | "description": "ソースコード" 51 | }, 52 | "minted-source-code": { 53 | "prefix": "minted-source-code", 54 | "body": [ 55 | "\\begin{listing}[tb]", 56 | "\\begin{minted}[bgcolor=bg]{$1}", 57 | "$2", 58 | "\\end{minted}", 59 | "\\caption{$3}", 60 | "\\label{list:$4}", 61 | "\\end{listing}" 62 | ], 63 | "description": "色付きソースコード" 64 | }, 65 | "figure": { 66 | "prefix": "figure", 67 | "body": [ 68 | "\\begin{figure}[tb]", 69 | " \\centering", 70 | " \\includegraphics[clip,width=$1]{assets/$2.png}", 71 | " \\caption{$3}", 72 | " \\label{fig:$4}", 73 | "\\end{figure}" 74 | ], 75 | "description": "図" 76 | }, 77 | "row-figure": { 78 | "prefix": "row-figure", 79 | "body": [ 80 | "\\begin{figure}[tb]", 81 | " \\begin{minipage}{0.5hsize}", 82 | " \\centering", 83 | " \\includegraphics[width=70mm]{$1}", 84 | " \\caption{$2}", 85 | " \\label{fig:$3}", 86 | " \\end{minipage}", 87 | " \\begin{minipage}{0.5hsize}", 88 | " \\centering", 89 | " \\includegraphics[width=70mm]{$4}", 90 | " \\caption{$5}", 91 | " \\label{fig:$6}", 92 | " \\end{minipage}", 93 | "\\end{figure}" 94 | ], 95 | "description": "横並びの図" 96 | }, 97 | "formula": { 98 | "prefix": "formula", 99 | "body": [ 100 | "\\begin{eqnarray}", 101 | " $1", 102 | "\\end{eqnarray}" 103 | ], 104 | "description": "数式" 105 | }, 106 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click", 3 | "latex-workshop.latex.outDir": "./out", 4 | "latex-workshop.latex.autoBuild.run": "onSave", 5 | "latex-workshop.formatting.latex": "latexindent", 6 | "editor.wordSeparators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~? 、。「」【】『』()!?てにをはがのともへでや", 7 | "latex-workshop.latex.tools": [ 8 | // latexmk を利用した uplatex によるビルドコマンド 9 | { 10 | "name": "Latexmk (upLaTeX)", 11 | "command": "latexmk", 12 | "args": [ 13 | "-f", 14 | "-gg", 15 | "-synctex=1", 16 | "-interaction=nonstopmode", 17 | "-file-line-error", 18 | "-outdir=%OUTDIR%", 19 | "%DOC%" 20 | ] 21 | }, 22 | // latexmk を利用した platex によるビルドコマンド 23 | // 古い LaTeX のテンプレートを使いまわしている (ドキュメントクラスが jreport や jsreport ) 場合のため 24 | { 25 | "name": "Latexmk (pLaTeX)", 26 | "command": "latexmk", 27 | "args": [ 28 | "-f", 29 | "-gg", 30 | "-pv", 31 | "-latex='platex'", 32 | "-latexoption='-kanji=utf8 -no-guess-input-env'", 33 | "-synctex=1", 34 | "-interaction=nonstopmode", 35 | "-file-line-error", 36 | "%DOC%" 37 | ] 38 | }, 39 | ], 40 | // latex-workshop.latex.recipes: Recipe の定義 41 | "latex-workshop.latex.recipes": [ 42 | // LaTeX(upLaTeX) で書かれた文書のビルドレシピ 43 | { 44 | "name": "upLaTeX", 45 | "tools": [ 46 | "Latexmk (upLaTeX)" 47 | ] 48 | }, 49 | // LaTeX(pLaTeX) で書かれた文書のビルドレシピ 50 | { 51 | "name": "pLaTeX", 52 | "tools": [ 53 | "Latexmk (pLaTeX)" 54 | ] 55 | }, 56 | ], 57 | // latex-workshop.latex.magic.args: マジックコメント付きの LaTeX ドキュメントをビルドする設定 58 | // '%!TEX' で始まる行はマジックコメントと呼ばれ、LaTeX のビルド時にビルドプログラムに解釈され、 59 | // プログラムの挙動を制御する事ができる。 60 | // 参考リンク: https://blog.miz-ar.info/2016/11/magic-comments-in-tex/ 61 | "latex-workshop.latex.magic.args": [ 62 | "-f", 63 | "-gg", 64 | "-pv", 65 | "-synctex=1", 66 | "-interaction=nonstopmode", 67 | "-file-line-error", 68 | "%DOC%" 69 | ], 70 | // latex-workshop.latex.clean.fileTypes: クリーンアップ時に削除されるファイルの拡張子 71 | // LaTeX 文書はビルド時に一時ファイルとしていくつかのファイルを生成するが、最終的に必要となるのは 72 | // PDF ファイルのみである場合などが多い。また、LaTeX のビルド時に失敗した場合、失敗時に生成された 73 | // 一時ファイルの影響で、修正後のビルドに失敗してしまう事がよくある。そのため、一時的なファイルを 74 | // 削除する機能 (クリーンアップ) が LaTeX Workshop には備わっている。 75 | "latex-workshop.latex.clean.fileTypes": [ 76 | "*.aux", 77 | "*.bbl", 78 | "*.blg", 79 | "*.idx", 80 | "*.ind", 81 | "*.lof", 82 | "*.lot", 83 | "*.out", 84 | "*.toc", 85 | "*.acn", 86 | "*.acr", 87 | "*.alg", 88 | "*.glg", 89 | "*.glo", 90 | "*.gls", 91 | "*.ist", 92 | "*.fls", 93 | "*.log", 94 | "*.fdb_latexmk", 95 | "*.synctex.gz", 96 | // for Beamer files 97 | "_minted*", 98 | "*.nav", 99 | "*.snm", 100 | "*.vrb", 101 | ], 102 | // latex-workshop.view.pdf.viewer: PDF ビューアの開き方 103 | // VSCode 自体には PDF ファイルを閲覧する機能が備わっていないが、 104 | // LaTeX Workshop にはその機能が備わっている。 105 | // "tab" オプションを指定すると、今開いているエディタを左右に分割し、右側に生成されたPDFを表示するようにしてくれる 106 | // この PDF ビュアーは LaTeX のビルドによって更新されると同期して内容を更新してくれる。 107 | "latex-workshop.view.pdf.viewer": "tab", 108 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # ![CyTeX](docs/image/CyTeX.svg) 4 | 5 |
6 | 7 | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/cysec-lab/cytex) 8 | 9 | CyTeX(読み方:さいてふ)は、DevContainer を用いた、環境構築が容易な日本語用の LaTeX 論文執筆環境テンプレートです。 10 | ローカル環境の Docker コンテナ、あるいは GitHub Codespace 上のクラウド開発環境に LaTeX 環境を構築できます。 11 | 12 | 18 | 19 | ## 使用手順 20 | 21 | 以下のファイル/フォルダをあなたの LaTeX 執筆環境にコピーしてください。 22 | 23 | - [.devcontainer/\*](.devcontainer/) 24 | - [.vscode/\*](.vscode/) 25 | - [main.tex(名前は変更可)](main.tex) 26 | - [.gitignore](.gitignore) 27 | 28 | また、執筆論文指定の形式に合わせて、任意のスタイルファイルを追加してください。 29 | 30 | ### LaTeX コンパイル環境の構築手順 31 | 32 | 以下 2 通りの方法があります。 33 | 34 | 1. [Codespaces を用いてクラウド開発環境に構築する方法](docs/how_to_use_codespace.md) 35 | - 注意:[無料で使用できる月間ストレージとコア時間](https://docs.github.com/ja/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) の上限に達した場合、2 の方法か、他の執筆環境を構築する必要がある 36 | 2. [devContainer を用いてローカル環境に構築する方法](docs/how_to_use_devContainer.md) 37 | 38 | ### ビルド手順 39 | 40 | 以下 2 通りの方法でビルドできます。 41 | 42 | 1. `*.tex` ファイルを保存する 43 | 2. ターミナルで `latexmk ./main.tex` を実行する 44 | 45 | ビルドすると、`out/` に PDF ファイルが生成されます。 46 | 47 | ## Codespaces 利用上の注意 48 | 49 | - [無料で使用できる月間ストレージとコア時間](https://docs.github.com/ja/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) には**上限**があります。 50 | - GitHub Pro アカウントの場合は 180 コア時間/月で、2 コアから選択できるので**月 90 時間分**に相当します。 51 | - コア時間は、Codespace が Active 状態の時間がカウントされます。 52 | - Codespace の状態は、[github.com/codespaces](https://github.com/codespaces)から確認、管理できます。 53 | - 現在の請求月に使用した Codespaces コンピューティング使用量は、[github.com/settings/billing](https://github.com/settings/billing) の `Codespaces` から確認できます。 54 | - 非アクティブな時間が経過すると、codespace は**自動停止**します。 55 | - タイムアウト時間はデフォルトで 30 分に設定されています。 56 | - 参考:[GitHub Codespaces のタイムアウト期間を設定する](https://docs.github.com/ja/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces?tool=webui) 57 | - Active な Codespace は以下のいずれかの方法で**手動停止**できます。 (参考:[codespace の停止と開始](https://docs.github.com/ja/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace)) 58 | - VSCode または Browser Codespace で、左下の`><`アイコン > `Stop Current Codespace` を選択する 59 | - [github.com/codespaces](https://github.com/codespaces) にアクセスし、Active な Codespace の `…` から `Stop Codespace` を選択する 60 | 61 | ## Welcome Contribution 62 | 63 | 不具合・要望を記載した[issue](https://github.com/cysec-lab/CyTeX/issues) を作成した上で、Pull Request してください。 64 | 65 | ## Author 66 | 67 | [Ran350](https://github.com/Ran350/) 68 | -------------------------------------------------------------------------------- /docs/how_to_use_codespace.md: -------------------------------------------------------------------------------- 1 | # Codespace での構築手順 2 | 3 | ## Requirements 4 | 5 | 以下がインストール済みであること。 6 | 7 | - Codespaces 対応ブラウザ(Chromium 系、firefox、safari) 8 | - VSCode で執筆する場合のみ 9 | - VSCode 拡張機能 [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) 10 | - VSCode で GitHub アカウントにログインしておくこと 11 | - VSCode サイドバーのアイコンからログインできる 12 | 13 | ## 手順 14 | 15 | 1. 作成した作業用リポジトリで Codespace を作成する 16 | 17 | - `Code<>` ボタン > `Codespaces` タブ > `+` ボタン押下 18 | 19 | - codespace 用のウィンドウが開かれ、ビルドが始まる 20 | - ビルドが完了すると、ブラウザ版 VSCode が起動する 21 | - ブラウザで執筆する場合は以上で環境構築完了 22 | 23 | 2. さらに、ブラウザではなく VSCode で編集したい場合は 24 | 25 | - VSCode の画面左下の `><`アイコン > `Connect to Codespace` から作成した Codespace を選択する 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/how_to_use_devContainer.md: -------------------------------------------------------------------------------- 1 | # devContainer での構築手順 2 | 3 | ## Requirements 4 | 5 | 以下がインストール済みであること。 6 | 7 | - VSCode 8 | - VSCode 拡張機能 [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) 9 | - Git 10 | - Docker 11 | - Docker Compose 12 | 13 | ## 手順 14 | 15 | 1. VSCode で執筆環境のワークスペースを開く 16 | 2. devContainer を起動する 17 | - 左下の`><`アイコン > `Reopen in Container` > `コンテナーで再度開く`を選択する 18 | - 初回起動時はビルドに 10 分ほどかかります 19 | -------------------------------------------------------------------------------- /docs/image/CyTeX.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 |
24 | 25 | CYTEX 26 | 27 |
28 | 29 |
30 |
31 | -------------------------------------------------------------------------------- /docs/image/account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cysec-lab/CyTeX/1fcac6519cf911ef7bfb09c232d5c8bc5df704f1/docs/image/account.png -------------------------------------------------------------------------------- /docs/image/create-codespace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cysec-lab/CyTeX/1fcac6519cf911ef7bfb09c232d5c8bc5df704f1/docs/image/create-codespace.png -------------------------------------------------------------------------------- /docs/image/vscode-git-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cysec-lab/CyTeX/1fcac6519cf911ef7bfb09c232d5c8bc5df704f1/docs/image/vscode-git-icon.png -------------------------------------------------------------------------------- /docs/image/vscode_><.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cysec-lab/CyTeX/1fcac6519cf911ef7bfb09c232d5c8bc5df704f1/docs/image/vscode_><.png -------------------------------------------------------------------------------- /main.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{url} 3 | 4 | \begin{document} 5 | ビルド方法は README.md の \#\#\#ビルド章 を参照してください. 6 | 7 | \url{https://github.com/cysec-lab/cytex} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /out/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cysec-lab/CyTeX/1fcac6519cf911ef7bfb09c232d5c8bc5df704f1/out/main.pdf --------------------------------------------------------------------------------