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

If you use two commands defined in your document without a space between them, pandoc gets stuck in latex mode. #4589

Closed
atomicwrites opened this issue Apr 24, 2018 · 1 comment

Comments

@atomicwrites
Copy link

If you use two commands defined in your document without a space between them, pandoc gets stuck in latex mode (ignoring markdown formatting). Using built in latex commands does not cause the issue.I'm running pandoc 2.1.3 on Arch Linux.

\newcommand{\one}[1]{#1}
\newcommand{\two}[1]{#1}

Formatting *is* working **here**. But sticking \one{two }\two{comands} together *breaks* formatting. 

This applies also to:

- Lists
- `Code`
- Code Blocks

``` shell
ls -l /
```

shot

test.pdf

@jgm
Copy link
Owner

jgm commented Apr 26, 2018

I think I see the problem. Line 258 of LaTeX reader, in rawLaTeXParser:

           rawstring <- takeP (T.length (untokenize raw))

raw here is the parsed token string AFTER macro expansion, but we're taking tokens from the input before macro expansion, so we take too many tokens. At least that's my current theory. We should be able to use source positions in the tokens instead.

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