0

I have following tikzpicture in my presentation:

\begin{frame}{Unitary bounds}
\begin{figure}
    \scalebox{.7}{
\begin{center}
\begin{tikzpicture}
\fill[red,opacity=.2] (-.5,-1) rectangle (4,3);
\fill[green!80!black,opacity=.2] (-.5,3) rectangle (4,5);
\draw[very thick,green!80!black] (-1,3) -- (5,3) node[right, black] {$\Delta=\Delta_A$};
\draw[very thick, green!80!black] (-1,1) -- (5,1) node[right,black] {$\Delta=\Delta_B$};
\draw[thick,->] (0,-1) -- (0,5.5) node[right] {$\Delta$};
\node at (2,2) {non-unitary};
\node at (2,0) {non-unitary};
\node at (2,4) {unitary};
\end{tikzpicture}
\end{center}}
\caption{Unitarity structure of superconformal multiplets.}\label{fig:unitarity}
\end{figure}
\end{frame}

But unfortunately this lead to

Something's wrong--perhaps a missing \item. \end{frame}

Nikita
  • 103

1 Answers1

3
  • After commenting out center environment and loading tikz package, your problem disappears.
  • Also, you can void \scalebox by using tikz option scale=0.7 instead. If you do want to scale the node text as well, use every node/.append style={scale=0.7} as suggested in How to scale a tikzpicture including texts?.
  • In the following example, center environment is replaced with \centering. Using \centering is not necessary, since figure environment centers its contents by default.
\documentclass{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}{Unitary bounds} \begin{figure} \begin{tikzpicture}[scale=0.7, every node/.append style={scale=0.7}] \fill[red,opacity=.2] (-.5,-1) rectangle (4,3); \fill[green!80!black,opacity=.2] (-.5,3) rectangle (4,5); \draw[very thick,green!80!black] (-1,3) -- (5,3) node[right, black] {$\Delta=\Delta_A$}; \draw[very thick, green!80!black] (-1,1) -- (5,1) node[right,black] {$\Delta=\Delta_B$}; \draw[thick,->] (0,-1) -- (0,5.5) node[right] {$\Delta$}; \node at (2,2) {non-unitary}; \node at (2,0) {non-unitary}; \node at (2,4) {unitary}; \end{tikzpicture} \caption{Unitarity structure of superconformal multiplets.}\label{fig:unitarity} \end{figure} \end{frame}

\end{document}

enter image description here

muzimuzhi Z
  • 26,474