Table of Contents

Use Japanese in Pandoc Docker Image

pandoc/latex Docker image does not support Japanese by default. To use Japanese, collection-langjapanese package must be installed.

Create a Dockerfile with the following content:

FROM pandoc/latex:3.6.4.0-ubuntu
RUN apt-get update && \
    apt-get upgrade -y && \
    tlmgr update --self --all && \
    tlmgr install collection-langjapanese

tlmgr is a TeX Live package manager. The above command updates the package list, upgrades all packages, and installs the collection-langjapanese package.

Then, build the Docker image.

docker build -t pandoc/japanese .

You can now use the pandoc/japanese image to convert documents with Japanese support.

docker run --rm \
    --volume "$(pwd):/data" \
    --user $(id -u):$(id -g) \
    pandoc/japanese doc.md -o doc.pdf \
    --pdf-engine=lualatex -V documentclass=ltjsarticle

References