mathematicalcoffee / pandocfilter-parse-latex-environments

[work in progress] pandoc filter that will recursively parse within user-specified environments, e.g. one could specify that everything in `\begin{columns}` and `\end{columns}` be parsed (block environments within that would not be parsed as per usual pandoc, unless they were also specified in this filter).
0 stars 0 forks source link

Idea #1

Open sergiocorreia opened 8 years ago

sergiocorreia commented 8 years ago

I've been thinking a bit about this issue and found two other possible alternatives:

  1. Wrap the environments with divs instead, and then apply a filter to the divs (which is cleaner/easier than with codeblocks). There is at least one filter that does this (with the older pandocfilters package): https://github.com/chdemko/pandoc-latex-environment
  2. Create a new tex command \Begin and \End that get ignored by Pandoc, as discussed here:

Ideally, I would go with option 1 if there was a neat way to create divs, but there is yet no agreement on that in the Pandoc project: https://github.com/jgm/pandoc/issues/168

Cheers, S

mathematicalcoffee commented 8 years ago

Thanks much.

I also think div is the natural way to go, but it's just a pain to write due to there being no nice shorthand for divs as you say. I wish there was. (I'm lazy, <div class="columns"> takes longer than \begin{columns} and given that I'm essentially writing a mostly-latex document anyway [beamerposter] just using markdown for things like bold/italic/links/lists rather than headings/structure, \begin{} and \end{} makes more sense).

Had not seen the trick you mention for 2., I'll check it out. Thanks!

ickc commented 8 years ago

You could take a look into 2 filters I wrote (modified from others) that uses div as LaTeX environment too:

The first one is very simple syntax, the second one is bigger and more specialized.