jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.78k stars 3.39k forks source link

Should the latex reader recognize the columns, block, and frame environments from Beamer? #5828

Open Gullumluvl opened 5 years ago

Gullumluvl commented 5 years ago

(feature request, discussion)

I don't know if this is desirable with the global Pandoc scheme, but I am suggesting to convert the slide structures from a beamer document to the pandoc markdown.

Columns

Indeed, for columns, the manual defines a syntax in markdown using fenced_divs:

:::::::::::::: {.columns}
::: {.column width="40%"}
contents...
:::
::: {.column width="60%"}
contents...
:::
::::::::::::::

Is it possible that the equivalent latex code

\begin{columns}
\begin{column}{0.4\textwidth}
contents...
\end{column}
\begin{column}{0.6\textwidth}
contents...
\end{column}
\end{columns}

is parsed into the AST as the expected div with class and attributes?

Currently the markdown output of this latex code is:

0.4 contents\...

0.6 contents\...

which unfortunately contains the unwanted width parameters. And I checked the native output, every column information has been removed (is it removed by the latex reader?).

blocks

Could blocks be converted to divs with class "example"/"alert" etc, or maybe as "info"/"warning" divs? Or alternatively, as header of a greater level than "slide-level"?

frames

Frames seem trickier, because of the "slide-level" strategy, which uses the headers. This would be nice to have an horizontal rule for frames not directly preceded by a header.

pauses and overlays

I haven't tested if every topic from "Structuring the slide show" can be obtained from latex, but this definitely would be convenient to have pauses as well.

I admit that people would most often convert from markdown to beamer, but I'm currently in the inverse situation of recycling my beamer slides...!

What are your thoughts?

Temporarily, I think this is not too complicated to read the document with latex+raw_tex input format, and process the beamer environments with a filter.

jgm commented 5 years ago

I think it's a good idea. Columns using the divs. Blocks using subsidiary headers. Frames + frametitles -> section with a header, or if no frametitle, preceded by an hrule. Pauses and overlays may be a bit too difficult to do in full generality.