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

verbatim with c++ code #4669

Closed
ghost opened this issue May 23, 2018 · 5 comments
Closed

verbatim with c++ code #4669

ghost opened this issue May 23, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented May 23, 2018

I am trying to convert this: http://www.greenteapress.com/thinkcpp/thinkCScpp.tex.tgz by

tar -xzf thinkCScpp.tex.tgz
cd think*
pandoc -s -f latex+smart top.tex -t org+smart

I get

Error at "source" (line 38, column 17):
unexpected ()
\begin{document}

The issue starts with cha6.tex. If I copy the contents of cha6.tex and comment every \include below (not including) \include{cha5}, I get

Error at "source" (line 180, column 15):
expecting \end{document}
\end{verbatim}

It seems that it is related to this:

\begin{verbatim}
  int i = 1;
  while (i <= 6) {
    cout << 2*i << "   ";
    i = i + 1;
  }
  cout << endl;
\end{verbatim}

But it works if you use only that without an \include instead of \include{cha6} (and commenting every \include below that).

Thanks for pandoc! I looked for verbatim in the issue tracker, and none of the topics seemed relevant.

@mb21
Copy link
Collaborator

mb21 commented May 23, 2018

What pandoc version? Can you try with the latest?

@ghost
Copy link
Author

ghost commented May 23, 2018

I am very sorry. I read how to make a good bug report, and forgot the version:
pandoc --version

pandoc 2.2.1
Compiled with pandoc-types 1.17.4.2, texmath 0.11, skylighting 0.7.0.2

I will try the latest later today :)

@jgm
Copy link
Owner

jgm commented May 30, 2018

Minimal repro:

% pandoc -f latex+smart -t org 
{\tt <-}

\begin{verbatim}
  while (n > 0) {
\end{verbatim}
^D
Error at "source" (line 5, column 1):
unexpected \end
\end{verbatim}

@jgm
Copy link
Owner

jgm commented May 30, 2018

Looks like it's interpreting the < after \tt as an angle-bracketed argument (as used in beamer), and reading til the next >, which is in the middle of the verbatim block.

@jgm
Copy link
Owner

jgm commented May 30, 2018

Related issue #3368

@jgm jgm closed this as completed in 0dbbf16 May 30, 2018
jgm added a commit that referenced this issue Aug 5, 2018
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

3 participants