8000 Problem with custom Latex environment inside of custom list environment items · Issue #7953 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Problem with custom Latex environment inside of custom list environment items #7953
Closed
@abenthy

Description

@abenthy

Hello, I'm trying to read a Latex document in Pandoc with the following structure:

\documentclass{article}

\newenvironment{myenumerate}{\begin{enumerate}}{\end{enumerate}}
\newenvironment{myenvironment}{}{}

\begin{document}

\begin{myenumerate}
\item{foo\begin{myenvironment}bar\end{myenvironment}}
\end{myenumerate}

\end{document}

Pandoc v. 2.17.1.1 (pandoc -t json example.tex) gives me the following error

Error at "example.tex" (line 13, column 2):
unexpected end of input
expecting \end{enumerate}

 ^

The document compiles without errors with pdflatex.

What I have tried / observed:

  • The problem seems to be somehow related to the curly brackets after \item. If I replace \item{...} by \item... it works (I don't know why).
  • If I remove the text foo, it works (again, I don't know why).
  • Replacing myenumerate by a list defined with \newlist from the enumitem package doesn't fix the error.
  • If I replace the usage of myenumerate with the standard enumerate environment, it works.
  • If I replace \begin{myenvironment}bar\end{myenvironment} with \begin{center}bar\end{center}, it works.

Does someone know what cause the problem here? I have a document that uses custom lists like above that I would like to convert with Pandoc, if possible without changes to the document. However, changes to the macro definitions would be no problem as a fix for me.

Thanks for your fantastic work on parsing Latex by the way, most of my documents work great!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0