varkor / quiver

A modern commutative diagram editor for the web.
https://q.uiver.app
MIT License
2.44k stars 83 forks source link

how to use it in beamer? #52

Closed rhocos3theta closed 4 years ago

rhocos3theta commented 4 years ago

\begin{frame}

[\begin{tikzcd} {M(f,d,y)} && {G} \ \ {E} &&&&& {A} \arrow["{(m_0,m_1)\longleftarrow F^G(E)}"', from=3-6, to=3-1, shift right=1, curve={height=18pt}] \arrow["{\alpha \longleftarrow y||s}"', from=3-1, to=3-6, shift right=1, curve={height=18pt}] \arrow["{r \ or \ random \ string }"', from=3-6, to=1-3] \end{tikzcd}]

\end{frame}

when i compile it tells me wrong,but i can compile without \begin{frame}

varkor commented 4 years ago

I wasn't able to get your code to compile even without frame, but I think this may be caused by frame overriding the cell spacing character & (see this question or this question on TeX.SE). There are two ways to get around this: by using \begin{frame}[fragile], or by using \begin{tikzcd}[ampersand replacement=\&] and replacing the ampersands in the diagram with \& instead. It's a little hard to get around this in quiver itself, as this fix is dependent on the context in which the diagram appears. Could you try those and see if it works?

rhocos3theta commented 4 years ago

I success after using \begin{frame}[fragile] .Thank you very much for your help !!!💯

varkor commented 4 years ago

Glad to hear that worked!