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

Parts environment in LaTeX exam class does not work anymore #4023

Closed
obcode opened this issue Nov 1, 2017 · 3 comments
Closed

Parts environment in LaTeX exam class does not work anymore #4023

obcode opened this issue Nov 1, 2017 · 3 comments

Comments

@obcode
Copy link

obcode commented Nov 1, 2017

See example code at https://github.com/obcode/pandocProblem.

I am generating exams using Pandoc and the LaTeX exam class since many years now.

With Pandoc >= 2.0.0 the parts environment does not work anymore (with unchanged sources).

exam.tex:

\documentclass{exam}
\begin{document}
\begin{questions}
$body$
\end{questions}
\end{document}

exam.md

\question
\begin{parts}
\part[6]
Hello World!
\end{parts}

using

pandoc --template=exam.tex -o exam.pdf exam.md

gives exam.pdf

while

fullexam.tex

\documentclass{exam}
\begin{document}
\begin{questions}
\question
\begin{parts}
\part[6]
Hello World!
\end{parts}
\end{questions}
\end{document}

gives fullexam.pdf, which is what I want and what I got using an older pandoc version.

Since I am doing all my work with Pandoc, it would be nice to use it for the upcoming exams.

@jgm
Copy link
Owner

jgm commented Nov 2, 2017

Here's the problem. We added support for the standard LaTeX \part command. This requires an argument (not just an optional argument), so the \part[6] is unexpected.

Here's a workaround that should work. Add this to your template, before the body:

\let\oldpart\part
\renewcommand{\part}[1][]{\oldpart[#1]{}}

@obcode
Copy link
Author

obcode commented Nov 2, 2017

Thanks. It works. But it is necessary to add curly braces after the part command in the Markdown sources, e.g.,

\part[8]{}

using \part[8] does not work.

No big deal, thanks to sed 😄

@obcode obcode closed this as completed Nov 2, 2017
@obcode
Copy link
Author

obcode commented Nov 3, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants