pandoc-letter icon indicating copy to clipboard operation
pandoc-letter copied to clipboard

Example does not work for commit 31e603e

Open BenjaminRodenberg opened this issue 1 year ago • 4 comments

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.

BenjaminRodenberg avatar Apr 01 '23 10:04 BenjaminRodenberg

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 ...

CDSoft avatar Apr 08 '23 07:04 CDSoft

$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?

to-json avatar Jun 25 '23 09:06 to-json

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

jgrigera avatar Aug 10 '23 14:08 jgrigera

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

hasufell avatar May 24 '24 04:05 hasufell