Closed Brilator closed 1 year ago
I am wondering about this too... It also says this in the readme.md file instructing how to move it to the pandoc templates folder. So I moved the eisvogel.tex file to templates and added th e.tex extension to the pandoc --template command and I get an error: "template" (line 466, column 16): unexpected "/" expecting "." or ")$"
The file eisvogel.latex
is part of every packaged release in the zip
or .tar.gz
file (https://github.com/Wandmalfarbe/pandoc-latex-template/releases). The repository contains the latest eisvogel.tex
that can be renamed manually. I would recommend to download a packaged release though.
The docs
folder contains unfinished GitHub pages based documentation that should not be used. The latest documentation is in the README.md
.
I've got the same problem with version 2.4.0, but not with 2.3.0:
Here is a POC:
Test file to convert to PDF from Markdown:
$ cat test.md
---
book: true
---
# test heading
test text.
To show the Dockerfile content:
$ cat Dockerfile
FROM ubuntu:20.04
LABEL maintainer="deadbeef edited this code from @noraj"
# Install dependencies.
ARG DEBIAN_FRONTEND="noninteractive"
RUN apt-get update \
&& apt-get install -y \
wget \
texlive-latex-recommended \
texlive-fonts-extra \
texlive-latex-extra \
pandoc \
p7zip-full
RUN mkdir /tmp/eisvogel \
&& latest=$(wget -vS --spider "https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest" 2>&1 | grep -i location | awk '{print $2}' | sort -u) \
&& download_url=$(echo -n $latest | sed 's|/tag.*||g') \
&& version=$(echo -n "v2.4.0") \
#&& version=$(echo -n "v2.3.0") works in this setup \
#&& version=$(echo -n $latest | rev | cut -d '/' -f 1 | rev) cannot use this one, because of the error in 2.4.0 \
&& wget --directory-prefix /tmp/eisvogel $download_url/download/$version/Eisvogel-$(echo -n $version | sed 's/v//g').tar.gz \
&& tar xf /tmp/eisvogel/Eisvogel-*.tar.gz --directory=/tmp/eisvogel \
&& mv /tmp/eisvogel/eisvogel.latex /usr/share/pandoc/data/templates/ \
&& rm -rf /tmp/eisvogel
RUN bash
Depending on the version what you filled in (v2.4.0 or v2.3.0) it will fail or generate the PDF.
podman build -t testing-pandoc . ; podman run -v $(pwd):/mnt/files testing-pandoc pandoc --from markdown+yaml_metadata_block+raw_html /mnt/files/test.md -o /mnt/files/test.pdf --from markdown+yaml_metadata_block+raw_html --template eisvogel --table-of-contents --toc-depth 6 --number-sections --top-level-division=chapter --highlight-style breezedark ; md5sum /usr/share/pandoc/data/templates/eisvogel.latex
With the latest version v2.4.0
:
STEP 1/6: FROM ubuntu:20.04
STEP 2/6: LABEL maintainer="deadbeef edited this code from @noraj"
--> Using cache d4322e78074fac95481f6105a77db5d6f36afbf12f6fa475b61e8e13c69c03be
--> d4322e78074f
STEP 3/6: ARG DEBIAN_FRONTEND="noninteractive"
--> Using cache d45004477fcbe4bede8cf7900db2cb6f5c9f2481464a815d57708208b6687c9b
--> d45004477fcb
STEP 4/6: RUN apt-get update && apt-get install -y wget texlive-latex-recommended texlive-fonts-extra texlive-latex-extra pandoc p7zip-full
--> Using cache 39af53993d411e2365f7c202a3abc6521f6a134cb7fb5caaf5c866f5401104fc
--> 39af53993d41
STEP 5/6: RUN mkdir /tmp/eisvogel && latest=$(wget -vS --spider "https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest" 2>&1 | grep -i location | awk '{print $2}' | sort -u) && download_url=$(echo -n $latest | sed 's|/tag.*||g') && version=$(echo -n "v2.4.0") && wget --directory-prefix /tmp/eisvogel $download_url/download/$version/Eisvogel-$(echo -n $version | sed 's/v//g').tar.gz && tar xf /tmp/eisvogel/Eisvogel-*.tar.gz --directory=/tmp/eisvogel && mv /tmp/eisvogel/eisvogel.latex /usr/share/pandoc/data/templates/ && rm -rf /tmp/eisvogel
--> Using cache 8770ac86a8581541c5c24553382b01df5dab7103e278f902033a3573896eb3bb
--> 8770ac86a858
STEP 6/6: RUN bash
--> Using cache 11a850bd8828de7c2b755fbf02ff0a23cd63edf98a7e5608f11f3219d7699289
COMMIT testing-pandoc
--> 11a850bd8828
Successfully tagged localhost/testing-pandoc:latest
11a850bd8828de7c2b755fbf02ff0a23cd63edf98a7e5608f11f3219d7699289
"template" (line 466, column 16):
unexpected "/"
expecting "." or ")$"
7b4ed419ed57fa16ec94712e9ef4649c /usr/share/pandoc/data/templates/eisvogel.latex
With version v2.3.0
:
STEP 1/6: FROM ubuntu:20.04
STEP 2/6: LABEL maintainer="deadbeef edited this code from @noraj"
--> Using cache d4322e78074fac95481f6105a77db5d6f36afbf12f6fa475b61e8e13c69c03be
--> d4322e78074f
STEP 3/6: ARG DEBIAN_FRONTEND="noninteractive"
--> Using cache d45004477fcbe4bede8cf7900db2cb6f5c9f2481464a815d57708208b6687c9b
--> d45004477fcb
STEP 4/6: RUN apt-get update && apt-get install -y wget texlive-latex-recommended texlive-fonts-extra texlive-latex-extra pandoc p7zip-full
--> Using cache 39af53993d411e2365f7c202a3abc6521f6a134cb7fb5caaf5c866f5401104fc
--> 39af53993d41
STEP 5/6: RUN mkdir /tmp/eisvogel && latest=$(wget -vS --spider "https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest" 2>&1 | grep -i location | awk '{print $2}' | sort -u) && download_url=$(echo -n $latest | sed 's|/tag.*||g') && version=$(echo -n "v2.3.0") && wget --directory-prefix /tmp/eisvogel $download_url/download/$version/Eisvogel-$(echo -n $version | sed 's/v//g').tar.gz && tar xf /tmp/eisvogel/Eisvogel-*.tar.gz --directory=/tmp/eisvogel && mv /tmp/eisvogel/eisvogel.latex /usr/share/pandoc/data/templates/ && rm -rf /tmp/eisvogel
--> Using cache 12d15dcd40137b576f3a2720f25c4a55d73268d4427e3b0d3854e543316f5e8f
--> 12d15dcd4013
STEP 6/6: RUN bash
--> Using cache a0de1dfd94319b711e584839751bffb604e9b3466d64334635c5056deebc1738
COMMIT testing-pandoc
--> a0de1dfd9431
Successfully tagged localhost/testing-pandoc:latest
a0de1dfd94319b711e584839751bffb604e9b3466d64334635c5056deebc1738
74f3b6df0ebc8d9ebf2d2032765d66cc /usr/share/pandoc/data/templates/eisvogel.latex
Thanks a lot for mentioning, version above v2.3.0 is not working well indeed. I tested on ubuntu 20.04, locally (not docker).
The README.md says
eisvogel.latex
, which does not exist (at least not in root). The docs/index.md refers to both. Best, DB