[Tex/LaTex] Insert raw LaTeX between beamer slides, using pandoc markdown


I'd like to insert some raw latex (in my case \appendix) between two frames in a beamer presentation. Normally, any latex code in the markdown document is passed through into the final .tex document, but it is placed within the frame.

My input:

First Frame

Some stuff


Appendix Frame

More stuff


\begin{frame}{First Frame}

Some stuff



\begin{frame}{Appendix Frame}

More stuff


And my desired output is to have the \appendix come after the first \end{frame}. Is there a way to explicitly end the frame environment? Of course adding \end{frame} to the markdown file leaves me with two \end{frame} lines in the tex file.

Best Answer

I found a workaround (Pandoc 3.2.1)

Define the following command...

   \begin{frame}<0| handout:0>}

...and use it normally

    ## Final frame



    ## My Appendix


This will generate matching begin-end frame environments and hide the extra frame it creates with <0| handout:0>.