Dockerを使ってJSKのlatexテンプレートを使った文章をコンパイルできます。latexを直接インストールしなくてもコンパイルできるようになります。(ci-thesisでのみ確認)
also includes latexdiff to make submitting revisions easier!
- Dockerhub: https://hub.docker.com/repository/docker/yasu31/jsk-latex-docker
- Repository: https://github.com/Yasu31/jsk-latex-docker
docker run ...
時にDockerhubからプルしてくれるので、このレポジトリをcloneする必要はないです
cd /path/to/your-thesis
# on Linux
docker run --rm -it -v $(pwd):/workdir yasu31/jsk-latex-docker
# on Windows
docker run --rm -it -v ${pwd}:/workdir yasu31/jsk-latex-docker
デフォルトではmake
を実行しますが、コマンドの最後にmake clean
、pdfcrop hogehoge.pdf
(PDFの余白をクロップしてくれる)とかを追加すればそっちが実行されます。もっと凝ったコマンドを送りたければコマンドの最後に/bin/bash -c "cd robomech; ls -l"
とすればbashコマンドが送れます。
以下の内容でレポジトリのrootに.gitlab-ci.yml
というファイルを作成します。CIが通ったら、"Download artifacts"で、コンパイルされた結果のPDFをダウンロードすることができます。
image: yasu31/jsk-latex-docker
compile-latex:
script:
- make
artifacts:
paths:
- main.pdf
GitHubにpushされるたびにGitHub Actions上でコンパイルされ、出力されたPDFをダウンロードすることができます。GitHub Actionsの無料枠には制限があるので注意。無料枠は毎月3000分ですが、自分の場合ci-thesisだと全体の処理に2分程度かかりました。
レポジトリのrootに.github/workflows/compile_pdf.yml
というファイルを作成し、以下をコピペしてpushすれば動いてくれるはずです
on: [push]
jobs:
compile-pdf:
runs-on: ubuntu-latest
container:
image: yasu31/jsk-latex-docker
steps:
- name: Set up Git repository
uses: actions/checkout@v1
- name: Compile LaTeX document
run: make
- name: Upload PDF to workflow tab
uses: actions/upload-artifact@v2
with:
name: PDF
path: main.pdf