aaronwolen / pandoc-letter

Pandoc template for writing letters in markdown
GNU General Public License v3.0
409 stars 124 forks source link

Example does not work for commit 31e603e #37

Open BenjaminRodenberg opened 1 year ago

BenjaminRodenberg commented 1 year ago

First of all: Thank you a lot for providing this template!

I cloned this repository and discovered that the example does not work. Then I went back by one commit and it worked again. I guess that 31e603e somehow introduced a bug here. I ran the following commands:

pandoc-letter$ pandoc --template=template-letter.tex example/letter.md -o example/letter.pdf
Error producing PDF.
! Undefined control sequence.
<recently read> \signature 

l.64 \signature

pandoc-letter$ git checkout b0fd7342b352ebb87aea17614ec014f68d48747f
M   example/letter.pdf
Note: switching to 'b0fd7342b352ebb87aea17614ec014f68d48747f'.
...
pandoc-letter$ pandoc --template=template-letter.tex example/letter.md -o example/letter.pdf

The for b0fd7342b352ebb87aea17614ec014f68d48747f the command worked as expected and a pdf was produced.

CDSoft commented 1 year ago

I'm facing the same issue. The diff between both commits shows the document class can be overridden by the documentclass variable. For some reasons it may be set somewhere to something different. If I set documentclass in the document, it works:

---
documentclass: letter
...

This variable can also be set with the pandoc command:

pandoc --template=template-letter.tex -V documentclass:letter ...
to-json commented 1 year ago

$documentclass$ appears to be shadowing \documentclass

PR inbound that would keep the change but rename $documentclass$ to $userdocumentclass$, but, given that some of those constructs in the template are part of letter I'm not actually sure accommodating user-specified documentclass is good?

jgrigera commented 1 year ago

Hi! I am sorry I provided the patch without noticing that pandoc sets the documentclass to article by default and thus broke this template. See: https://github.com/jgm/pandoc/blob/cc371a9485241db3e0101180432e2122d023a9bd/src/Text/Pandoc/Writers/LaTeX.hs#L109

I see that @to-json made a good fix - changing this to userdocumentclass if people want to specify a different documentclass and avoid the hassle of having to provide letter by default. Thanks!

Apologies! Juan

hasufell commented 6 months ago

This repo is a mess.

Even with the suggested change, you get errors:

Error producing PDF.
! LaTeX Error: File `wallpaper.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name:
! Emergency stop.
<read *>

l.80 \ThisULCornerWallPaper