3

How does one manually mark a frame as [fragile] in a Pandoc markdown file (to be converted into LaTeX Beamer)?

That is, I have a frame like this:

# Relations visualised

\begin{figure}

\centering
\begin{tikzpicture}
    [
      group/.style={ellipse, draw, minimum height=50pt, minimum width=30pt, label=above:#1},
      my dot/.style={circle, fill, minimum width=2.5pt, label={[xshift=0cm,yshift=-2.5pt]above:#1}, inner sep=0pt}
    ]
    \node (a) [my dot=a] {};
    \node (b) [below=of a, my dot=b] {};
    \node (c) [right=50pt of a, my dot=c] {};
    \node (e) [below=of c, my dot=e] {};
    \node (d) [xshift=-2.5pt, my dot=d] at ($(c)!1/2!(e)$) {};
    \foreach \i/\j in {a/c,a/e,b/d}
      \draw [->, shorten >=2pt] (\i) -- (\j);
    \node [fit=(a) (b), group=A] {};
    \node [fit=(d) (c) (e), group=B] {};
  \end{tikzpicture}

\caption{Relation $R: A \rightarrow B$}

\end{figure}

And it gets converted as:

\begin{frame}{Relations visualised}
\begin{figure}

\centering
\begin{tikzpicture}
    [
      group/.style={ellipse, draw, minimum height=50pt, minimum width=30pt, label=above:#1},
      my dot/.style={circle, fill, minimum width=2.5pt, label={[xshift=0cm,yshift=-2.5pt]above:#1}, inner sep=0pt}
    ]
    \node (a) [my dot=a] {};
    \node (b) [below=of a, my dot=b] {};
    \node (c) [right=50pt of a, my dot=c] {};
    \node (e) [below=of c, my dot=e] {};
    \node (d) [xshift=-2.5pt, my dot=d] at ($(c)!1/2!(e)$) {};
    \foreach \i/\j in {a/c,a/e,b/d}
      \draw [->, shorten >=2pt] (\i) -- (\j);
    \node [fit=(a) (b), group=A] {};
    \node [fit=(d) (c) (e), group=B] {};
  \end{tikzpicture}

\caption{Relation $R: A \rightarrow B$/}

\end{figure}


\end{frame}

I want to pass [fragile] as an optional argument to \begin{frame} (otherwise I get an error:

! Illegal parameter number in definition of \test.
<to be read again> 
                   1
l.392   \end{tikzpicture}

).

My current solution is just to input the entire frame as raw LaTeX; but that's an unhappy hack for a variety of reasons.

1
  • The linked answer does not answer this question at all. This question is about marking frames as [fragile] when using pandoc with markdown. The linked answer is about using a # character inside a verbatim that's inside a note. How does this even remotely relate? @egreg since you closed the question would you mind reopening it? Since you seem to know how the linked answer relates to this question, I would also be very grateful for you answering it.
    – 303
    Feb 6 at 10:46

Browse other questions tagged or ask your own question.