hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
312 stars 60 forks source link

\Verb generated by format pdflatex #15

Closed schuang closed 9 years ago

schuang commented 9 years ago

Is there an option to make doconce generate \verb instead of \Verb when using "format pdflatex"?

When I run

doconce format pdflatex test1.do.txt

where

$ cat test1.do.txt 
The word `test` is in verbatim.

the generated .tex file contains \Verb, causing the "undefined control sequence" error:

$ pdflatex test1.p.tex
... <snipped>
! Undefined control sequence.
l.93 The word \Verb
                   !test! is in verbatim.

If I replace the \Verb with \verb, then pdflatex test1.p.tex runs ok:

$ doconce subst '\\Verb' '\\verb' test1.p.tex
\\Verb replaced by \\verb in test1.p.tex
$ pdflatex test1.p.tex
# this is ok
hplgit commented 9 years ago

This is a bug due to a recent change (generation of latex code environments directly with doconce format rather than using doconce ptex2tex or ptex2tex): \usepackage{fancyvrb} is needed for \Verb if the text contains inline verbatim but no verbatim code blocks. This is now fixed. Try again and it will work, but note that you cannot (normally) run pdflatex on test1.p.tex, you have to do the doconce ptex2tex step, or you can use the new option --latex_code_style=vrb (or lst or pyg) to generate a .tex file directly.

schuang commented 9 years ago

Yes, it works now. Thank you!