8000 GitHub - xzhub/pandoc-latex: Extended version of pandoc/latex, can build document with Eisvogel LaTeX template
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Extended version of pandoc/latex, can build document with Eisvogel LaTeX template

License

Notifications You must be signed in to change notification settings

xzhub/pandoc-latex

 
 

Repository files navigation

Pandoc LaTeX with Eisvogel

Trying to make this docker work for CJK document

build

# get the font files
sh GetSourceHanFont.sh
# build the docker
docker build -t your_pandoc .
# run it on your input file
docker run --rm -v `pwd`:/data -w /data your_pandoc -f markdown \
	--template /template/eisvogel_zh.tex -t latex \
	--metadata-file=/template/mydoc.yaml --pdf-engine=xelatex \
	-o output.pdf input.md

Introduction

Pandoc has an official Docker image pandoc/latex. I like to use the Eisvogel LaTeX template. Unfortunately, you cannot build PDFs from Markdown using this template with pandoc/latex. Some packages from TeX Live are missing.

Therefore, I created a Docker image based on pandoc/latex that can build PDFs using Eisvogel. You can find it on Docker Hub under rstropek/pandoc-latex.

Examples

The examples folder contains an example document (markdown content, YAML metadata) including the generated PDF document.

Usage

The following docker run statement will generate mydoc.pdf from the markdown file mydoc.md with the YAML metadata in mydoc.yaml. Try to run the statement inside the example folder.

Several optional packages, mentioned by pandoc/latex, are preinstalled in the image.
That includes sectsty, for those who want to add line breaks before chapters without using the book property. See this issue for more details.

Supported Versions

Tested with Eisvogel LaTeX template 1.4.0.

Linux

docker run --rm \
    -v `pwd`:/data \
    -w /data \
    rstropek/pandoc-latex \
    -f markdown \
    --template https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template/5f740f8de0fb4c96dfb2772ef86e861fd3971654/eisvogel.tex \
    -t latex \
    -o mydoc.pdf \
    --metadata-file=mydoc.yaml \
    mydoc.md

Windows

docker run --rm ^
    -v %cd%:/data ^
    -w /data ^
    rstropek/pandoc-latex ^
    -f markdown ^
    --template https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template/5f740f8de0fb4c96dfb2772ef86e861fd3971654/eisvogel.tex ^
    -t latex ^
    -o mydoc.pdf ^
    --metadata-file=mydoc.yaml ^
    mydoc.md

Development

Build

# Use a significative tag
# (e.g. here, follow the version of pandoc/latex used as the basis in the Dockerfile).
docker build -t rstropek/pandoc-latex:2.9.1.1 .

Tests

Make sure you have BATS installed.

bats tests

About

Extended version of pandoc/latex, can build document with Eisvogel LaTeX template

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TeX 93.1%
  • Shell 5.4%
  • Dockerfile 1.5%
0