-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Parse LaTeX Parallel Environment #4512
Comments
I wonder if this is too special-case. We can't support every
last package on CTAN without things getting too complicated.
And here, parsing into a Div structure with a style attribute
would really only help for HTML output.
|
Perhaps what we need is the ability to tell pandoc to create
Div or Span environments from certain latex commands and environments.
Then you can handle them in a filter.
See #3145.
It's a bit tricky, though. Environments can take optional arguments,
as in your example. Sometimes they have verbatim contents. How
does pandoc know how to parse the thing?
Thinking out loud: What if the latex reader knew how to handle
a few special macros, like
PandocDiv
PandocSpan
PandocCode
PandocCodeBlock
Then you could define a latex macro to convert your target latex
environment into one of these, and pandoc could take it from there.
E.g. using xparse
\DeclareDocumentEnvironment{Parallel}{m}{m}
{\begin{PandocDiv}[Parallel]}
{\end{PandocDiv}[Parallel]}
\newcommand{ParallelLText}[1]{\PandocSpan[ParallelLText]{#1}}
\newcommand{ParallelRText}[1]{\PandocSpan[ParallelRText]{#1}}
(Here I assume you aren't usepackage'ing parallel, or you'd need
to renew the environment.) The idea is that you'd put this in
your header to tell pandoc how to interpret this latex environment
in Pandoc terms, and pandoc would give you a native pandoc structure,
which you could manipulate with a filter.
|
I tried to parse the I'm not sure about the special pandoc environments because it would not give me the ability to do more that by declaring a custom LaTeX command in a separate file which defines the environment. For example, I'm not sure if I'm able to add a style or anything else. I'm imagine to parse these command in pandoc (along the style) and the writers (e. g. |
Pandoc should be able to parse
Parallel
environments, such as:pandoc -f latex -t html
should produce following content:The text was updated successfully, but these errors were encountered: