1

The answers here have helped me get the PDF to asctually compile, but the product is not what I need just yet Beamer Tikz-cd Problem

I am trying to produce this diagram, which compiles just fine in my thesis, just not in beamer

enter image description here

which in the thesis has the code

\[
  \begin{tikzcd}[sep=huge]
    \large{\text{Poincaré}} \arrow[r,"\text{C}"] \arrow[rd, red, "\text{E} \hspace{1 em}\circ\hspace{1 em} \text{C}"'] & \large{\text{Galilei}} \arrow[d,"\text{E}"] \\
     & \large{\text{Bargmann}}
  \end{tikzcd}
\]

In the beamer, I followed some suggestions from the above Stack answer but so far I only have

enter image description here with the following code

\[
\begin{tikzcd}[ampersand replacement=\&,sep=huge]
    \large{\text{Poincaré}} \arrow[r,"\text{C}"] \arrow[rd, red, "\text{E} \hspace{1 em}\circ\hspace{1 em} \text{C}"'] \& \large{\text{Galilei}} \arrow[d,"\text{E}"] \\
     \& \large{\text{Bargmann}}
  \end{tikzcd}
  \]

and the following errors

enter image description here

Sebastiano
  • 54,118
  • 3
    \documentclass{beamer} \usepackage{amsmath} \usepackage{tikz-cd} \begin{document} \begin{frame}[t] \frametitle{\dots} \[ \begin{tikzcd}[ampersand replacement=\&,sep=huge] \text{\large{Poincar\'e}} \arrow[r,"\text{C}"] \arrow[rd, red, "\text{E} \hspace{1 em}\circ\hspace{1 em} \text{C}"'] \& \text{\large{Galilei}} \arrow[d,"\text{E}"] \\ \& \text{\large{Bargmann}} \end{tikzcd} \] \end{frame} \end{document} compiles without error. Can you please provide a minimal document that shows the problems? –  Jun 08 '20 at 20:07
  • 1
    From the error message I suppose that you need \usetikzlibrary{babel} in the preamble. That is, you probably load the babel package, and since tikz-cd is loading and using the quotes library, you also need the babel TikZ library. –  Jun 08 '20 at 20:09
  • @Schrödinger'scat I have put \usepackage[utf8]{inputenc} instead of \usetikzlibrary{babel}. – Sebastiano Jun 08 '20 at 20:10
  • 2
    @Sebastiano Well, do you reproduce the OP's error messages if you remove \usepackage[utf8]{inputenc}? Probably not. So presumably this does not fix the problem. (Please do not get me wrong, I am also guessing, but since the OP uses \usepackage[czech]{babel} in other codes, and since adding \usepackage[czech]{babel} allows me to reproduce the error messages, I feel that there is a chance that my guess is correct.) –  Jun 08 '20 at 20:18
  • @Schrödinger'scat I have deleted my answer. :-). – Sebastiano Jun 08 '20 at 20:20
  • 1
    @Sebastiano I did not mean to suggest that you delete your answer, I was only suggesting changes so that others feel more comfortable upvoting it. –  Jun 08 '20 at 20:21
  • @Schrödinger'scat thank you very much. In the meanwhile I'm working for my school. I am very tired :-( – Sebastiano Jun 08 '20 at 20:26
  • OOOOO I see! I had no idea that babel would effect tikz! Thank you both so much :) – Lopey Tall Jun 08 '20 at 20:33

1 Answers1

2

With the suggestion of the very nice user Schrödinger's cat.....

\documentclass[a4paper,12pt]{beamer}
\usepackage[czech]{babel}
\usepackage{tikz-cd}
\usetikzlibrary{babel}


\begin{document}
\begin{tikzcd}[ampersand replacement=\&,sep=huge]
\text{\large Poincaré}\arrow[r,"\text{C}"] \arrow[rd, red, "\text{E} \hspace{1 em}\circ\hspace{1 em} \text{C}"'] \& \large{\text{Galilei}} \arrow[d,"\text{E}"] \\
     \& \large{\text{Bargmann}}
  \end{tikzcd}
\end{document}

[1]: https://i.stack.imgur.com/PFLFV.png

Sebastiano
  • 54,118