jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.65k stars 3.38k forks source link

Conflict with LaTeX output and class tutfe-book #501

Closed ghost closed 12 years ago

ghost commented 12 years ago

It almost works. I'm generating LaTeX source with:

pandoc -s -S --toc -N input.md -o input.tex -V documentclass=book

and replacing the document class with tufte-book. Hey, I'm being really optimistic here. :) If I use documentclass=tufte-book it outputs article-style sections which are incompatible with tufte-book Which you can get more info from here.

pdflatex chokes on it with:

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.40 \fi
?
! You can't use `macro parameter character #' in horizontal mode.
\in@ #1#2->\def \in@@ ##1#1##
                         2##3\in@@ {\ifx \in@ ##2\in@false \else \in@tru...
l.40 \fi

If I just hit enter a bunch of times, it eventually outputs a book, but the front matter has some garbage on the first page involving the author's name. Deciphering TeX errors is not my strong suit and I'm hoping a TeX-wizard has already seen this problem with pandoc and tufte-book.

jgm commented 12 years ago

+++ Simon Janes [Apr 29 12 08:51 ]:

It almost works. I'm generating LaTeX source with:

pandoc -s -S --toc -N input.md -o input.tex -V documentclass=book

and replacing the document class with tufte-book. Hey, I'm being really optimistic here. :) If I use documentclass=tufte-book it outputs article-style sections which are incompatible with tufte-book Which you can get more info from here.

This problem is easily solved. Add --chapters to your command line.

pdflatex chokes on it with:

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.40 \fi
?
! You can't use `macro parameter character #' in horizontal mode.
\in@ #1#2->\def \in@@ ##1#1##
                         2##3\in@@ {\ifx \in@ ##2\in@false \else \in@tru...
l.40 \fi

There seems to be some incompatibility with the hyperref definitions in the preamble and the tufte-book class. I note that the tufte-book class has an option 'nohyper', and when I used it this problem went away. However, there were several further problems, which seemed to have something to do with ctable and fancyvrb. You might need someone with detailed knowledge of the tufte-book class to help with this.

John

ghost commented 12 years ago

Thank you for looking into it, I think I can get by with nohyper so this enough of a fix for me. :)