lua-filters icon indicating copy to clipboard operation
lua-filters copied to clipboard

issues with mintinline and curly braces

Open DanySK opened this issue 4 years ago • 4 comments

Hi, I am using minted to highlight yaml in my document, and apparently this gives a hard time to pandoc. In particular, I get an error at this line of code:

Seeds are set at the top level of the simulation specification, as in the following snippet: \mintinline{yaml}{seeds: { simulation: 0, scenario: 0 }}.

when running pandoc --to=plain --wrap=none alchemist-tutorial.tex I get:

Error at "source" (line 679, column 150):
unexpected }
expecting \end{document}
Seeds are set at the top level of the simulation specification, as in the following snippet: \mintinline{yaml}{seeds: { simulation: 0, scenario: 0 } }.
                                                                                                                                                     ^

Is this a bug in Pandoc? Thanks

DanySK avatar Mar 30 '21 16:03 DanySK

Hey @DanySK this seems like a bug in the filter, can you look at #43 and see if there are some changes that fix your issue? When I wrote it I didn't consider { brace problems } but that PR fixed them to my knowledge.

Otherwise, please include alchemist-tutorial.tex and the generated output and any other information you can (e.g., pandoc version). I'm not familiar with that specific usage of pandoc (the plain format and wrap), but \mintinline{yaml}{seeds: { simulation: 0, scenario: 0 }} looks extremely suspicious -- if the minted.lua filter emitted that then it should get fixed (the interior braces for the actual yaml code are a problem) :slightly_smiling_face:

svenevs avatar Mar 31 '21 08:03 svenevs

Hi @svenevs, I cannot attach the whole file as it is protected by NDA. Should I try to produce an excerpt?

❯ pandoc --version
pandoc 2.11.4
Compiled with pandoc-types 1.22, texmath 0.12.1.1, skylighting 0.10.4,
citeproc 0.3.0.9, ipynb 0.1.0.1
User data directory: /home/danysk/.local/share/pandoc or /home/danysk/.pandoc
Copyright (C) 2006-2021 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

I'm not sure #43 applies: braces are correctly matched there.

DanySK avatar Apr 09 '21 15:04 DanySK

I wrote that filter and tried to give some educated guesses but I'm not going to be able to help fix this anytime soon (personal reasons). Please provide a minimal example that can be reproduced if you would like somebody to help fix it. It doesn't seem like you are even using the minted filter here, which is why a reproducible example will help identify where the bug is.

svenevs avatar Apr 09 '21 16:04 svenevs

@svenevs could you point me to the instructions to appropriately use the minted filter? At this point, it is possible that I am doing something wrong and this report is actually invalid.

DanySK avatar Apr 12 '21 13:04 DanySK