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] "%" in the \verb comand are interpreted as comments. #7939

Closed
sumi35 opened this issue Feb 25, 2022 · 8 comments
Closed

[LaTeX] "%" in the \verb comand are interpreted as comments. #7939

sumi35 opened this issue Feb 25, 2022 · 8 comments
Labels

Comments

@sumi35
Copy link

sumi35 commented Feb 25, 2022

problem
This problem occurs when converting LaTeX.
If I convert the following text, the "%" in the \verb command are interpreted as a comment.

\hbox{\verb|\begin{minipage}[t]%|}

How to execute
pandoc --from=latex --to=json "sample.tex"

@sumi35 sumi35 added the bug label Feb 25, 2022
@mb21
Copy link
Collaborator

mb21 commented Feb 25, 2022

@jgm
Copy link
Owner

jgm commented Feb 25, 2022

This appears to work correctly in recent versions; you just need to upgrade.

@jgm jgm closed this as completed Feb 25, 2022
@sumi35
Copy link
Author

sumi35 commented Feb 28, 2022

I updated to version 12.17.1.1, but it did not solve the problem.
I will share the file that I actually used for the conversion.

I tried to convert, but got the following error.

pandoc --from=latex --to=json "jsample.tex" 
Error at "jsample.tex" (line 8, column 2):
unexpected end of input

jsample.zip

@jgm
Copy link
Owner

jgm commented Feb 28, 2022

OK, what's going on in your document is that it first defines | as \verb|:

\def\|{\verb|}

so that the % in the following line is not a comment but a verbatim %:

\hbox{\|\begin{minipage}[t]%|}

Pandoc understands that when you write

\hbox{\verb|\begin{minipage}[t]%|}

but not with the defined \|, apparently.

@jgm jgm reopened this Feb 28, 2022
@jgm
Copy link
Owner

jgm commented Feb 28, 2022

Actually it's more complex than that. The defined \| normally works fine, but there's some kind of interaction with the \vbox.

\def\|{\verb|}
\vbox{
\hbox{\|\begin{minipage}[t]%|}
}

yields the error, but

\def\|{\verb|}
\hbox{\|\begin{minipage}[t]%|}

works perfectly.

@jgm jgm closed this as completed in 97c4f3f Feb 28, 2022
@jgm
Copy link
Owner

jgm commented Feb 28, 2022

Pushed a change that fixes this.

@sumi35
Copy link
Author

sumi35 commented Mar 2, 2022

Thank you for the fixes.
I'm sorry, but could you please let me know the next release date?

@jgm
Copy link
Owner

jgm commented Mar 2, 2022

I don't know when the next release will come out. You can grab a nightly, though.

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

No branches or pull requests

3 participants