Giter Club home page Giter Club logo

rexetexer's Introduction

GitHub GitHub repo size GitHub last commit


img

awesome cool logo

What is this?

img

It compiles Japanese (you can use English) TeX file to PDF without TeX Live on your local machine. Just required Docker. It includes BibTeX.

variation

Environment

  • Required
    • Docker (or Podman)
  • Optional
    • GNU Make
    • Text editor
    • PDF viewer (Skim)

How to use

0. Preparation

Download the latest version from releases. Then, unzip the .zip file.

.
├── LICENSE
├── Makefile
├── NotoSansJP-Regular.otf
├── NotoSerifJP-Regular.otf
├── README.md
├── RobotoMono.ttf
├── img
│   └── logo.png
├── ref.bib
├── report.pdf
├── report.tex
└── watch.sh

After that, run the below command at the directory where you unzip.

$ make init

If you want to use Podman.

If you want to use Podman, you should read and run as follows.

# General
$ make podman.${TARGET}

# Example: Run `make init` with Podman
$ make podman.init

1. Launch

$ make run

2. Connect

$ make exec

After running this command, your terminal will connect to the container. The following commands are executed in a container.

3. Launch auto compile script

$ make watch

If you want to compile just 1 time.

$ make tex

4. Write TeX

After make watch, edit . /report.tex will automatically generate a pdf. TeX Engine is XeTeX/XeLaTeX, see ./report.tex.

5. View PDF

Open ./report.pdf with Skim or your favorite PDF viewer.

6. Tips

Can be incompatible with AutoSave (VS Code)

AutoSave, such as VS Code, can cause incomplete .tex files to be compiled because it detects changes in the file and runs the compilation.

This can be resolved by setting .vscode to set AutoSave to onFocusChange for this workspace only. Or you can also solve this problem by extending the monitoring interval of watch.sh from 1 to about 5 seconds.

PDF Viewer that supports auto-reload of resources

If you want to stop this system.

Exit container($ exit), and do the below commands.

$ make stop

If you want to relaunch the system, use $ make start.

If you want to delete the container, do the below commands. (It does not delete the image. Safe.)

$ make rm

If you want to delete the image, do the below commands.

$ make rmi

thx

Support me!

Buy Me A Coffee

rexetexer's People

Contributors

glatan avatar terfno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

glatan sickleaf

rexetexer's Issues

Linux 環境におけるスーパーユーザーの実行でコンテナ内に作業ディレクトリをマウントできない

問題

Linux 環境において、スーパーユーザーで make exec を実行してもコンテナー内の /doc に作業ディレクトリがマウントされていない。

原因

Linux のスーパーユーザー (root ユーザー) には、環境変数 PWD が設定されていないことが原因である。

解決策

@${CONTAINER_ENGINE} run -v ${PWD}:/docs -w /docs --name ${CNAME} -itd ${INAME}:${TAG} sh

このうち ${PWD} を、 GNU Make が提供する、実行ディレクトリの絶対パスを示す変数 ${CURDIR} に変更する。

備考

非スーパーユーザーを docker グループに追加し、非スーパーユーザーで実行することで解決できるが、実行ユーザー如何に拘らず実行できるべきで、 docker グループに追加することのシステム上のセキュリティリスクは Docker daemon attack surface で詳述されている。

Makefile: chmodを削除する

Gitはファイルのパーミッションも管理してくれてるのでmake watchの中で実行権限の付与をする必要はないです。
クローン直後のリポジトリでwatch.shのパーミッションを確認すると、実行権限が付与されているはずです(現状のmasterにて)。

Podman対応

要望

現状のMakefileでは、Podman環境(最新のFedoraとかRHELとか)で動作しない。
これみたいにDockerとPodmanの両環境に対応させたい。

問題

Docker環境の場合make initmake docker.initになるなど、若干コマンドが長くなってしまう。

tex書いてる途中にauto saveされて、tex compileがfailする。

現象

tex書いてる途中にtex compileが走る→書き終えていないのでerrが出る→auto compileするwatch.shが止まる。

原因

VSCodeなどのテキストエディタによるauto save.

解決策?

  • auto saveをオフにする。
  • failしたら無視してそのループをbreak→数秒後に再試行するwatch.shにする。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.