Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX Reader: Allow environments other than "document" while parsing header #1338

Closed
smheidrich opened this issue Jun 13, 2014 · 0 comments
Closed

Comments

@smheidrich
Copy link

For example, allow the filecontents environment (see ltclass.dtx for a description) before \begin{document}.

Test case:

filecontents_test.latex

\documentclass[a4paper,12pt]{article}
\begin{filecontents}{blubb.txt}
File text.
\end{filecontents}
\begin{document}
Document text.
\end{document}

Try to convert this to LaTeX (e.g. when you just want to use the --filter facility) or anything else:

pandoc --standalone --parse-raw --from latex --to latex filecontents_test.latex -o filecontents_test_output.latex

Output is:

pandoc: 
Error at "source" (line 2, column 7):
unexpected "f"
expecting "{document}"
\begin{filecontents}{blubb.txt}
      ^

Expected output was:

  • Pandoc executes without errors.
  • filecontents_test_output.latex contains the filecontents environment from filecontents_test.latex in its header.
  • When translating to anything other than LaTeX, the environment is ignored instead.

Version info:

pandoc 1.12.3.3

The filecontents environment is just an example and very low-priority since almost nobody uses it. However, its existence means the Reader's assumption that the only environment that can be opened from the header is document might be wrong.

@jgm jgm closed this as completed in 459805d Jun 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant