I'm having problems with my beamer presentation, I would like to insert 2 Tikz subfigures into only one slide. For that I'm using an adjustbox but I'm having errors.
When I put each tikzpicture separately there is no error, notwithstanding, when I try to get them into 2 subfigures the error comes out.
I've looking into answers to related problems. It looks that the problem is related to subfloats into the figure environment but I've no satisfactory answer.
My code:
\documentclass[serif, xcolor={usenames,dvipsnames,table}]{beamer}
\usepackage[portuguese]{babel}
\usepackage[utf8]{inputenc}
\usepackage{mathpazo}
\let\Tiny=\tiny
\mode<presentation> {
\usetheme{Malmoe}
\usecolortheme{beaver}
}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{enumerate}
\setbeamertemplate{section in head/foot}{\hfill\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{red!40}\hfill\insertsectionhead}
\setbeamertemplate{section in toc}{\inserttocsectionnumber.~\inserttocsection}
\usepackage{hyperref}
\usepackage[alf]{abntex2cite}
\usepackage{tikz}
\usetikzlibrary{arrows}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=2pt] (char) {#1};}} %texto circulado
\usepackage{adjustbox}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{multicol}
%------------------------------------------------
\begin{document}
\begin{frame}{Eliminação de \textit{subtour}}
\begin{adjustbox}{max totalsize={1\textwidth}{.9\textheight},center}
\begin{figure}[htpb]
\centering
\subfigure[Eliminado pela variável $ \gamma $ e os conjuntos $ \Xi $]{
\begin{tikzpicture}[->, >=stealth', shorten >=1pt, auto, node distance=3cm, thick, main node/.style={circle, draw, font=\sffamily}]
\node[main node, label={above:Q1}] (1) {a};
\node[main node, label={above:R1}] (2) [right of=1] {c};
\node[main node, label={above:Q2}] (3) [right of=2] {d};
\node[main node, label={above:S2}] (4) [right of=3] {b};
\node[](aux1) at (5,-0.5) {};
\node[main node, label={left:P1}] (5) [below of=aux1] {g};
\node[](aux2) [below left of=1] {};
\node[main node, label={right:P3}] (6) [above right of=5] {e};
\node[main node, label={right:P2}] (7) [below right of=5] {f};
\path[every node/.style={font=\sffamily\small}]
(1) edge [right] node[left, below] {} (2)
(2) edge [right] node[left, below] {} (3)
(3) edge [right] node[left, below] {} (4)
(5) edge [right] node[left] {} (7)
(7) edge [right] node[right] {} (6)
(6) edge [red, right, line width=1.8pt] node[left, red] {} (5);
\end{tikzpicture}}
\subfigure[Eliminado pelas restrições \eqref{eq:sd-subtour-lmo}]{
\begin{tikzpicture}[->, >=stealth', shorten >=1pt, auto, node distance=3cm, thick, main node/.style={circle, draw, font=\sffamily}]
\node[main node, label={above:Q1}] (1) {a};
\node[main node, label={above:R2}] (2) [right of=1] {c};
\node[main node, label={above:Q2}] (3) [right of=2] {d};
\node[main node, label={above:S2}] (4) [right of=3] {b};
\node[](aux1) at (3,-0.5) {};
\node[main node, label={left:R1}] (5) [below of=aux1] {g};
\node[](aux2) [left of=5] {};
\node[main node, label={right:P3}] (6) [above right of=5] {e};
\node[main node, label={right:P2}] (7) [below right of=5] {f};
\path[every node/.style={font=\sffamily\small}]
(1) edge [right] node[left, below] {} (2)
(2) edge [right] node[left, below] {} (3)
(3) edge [right] node[left, below] {} (4)
(5) edge [right] node[left] {} (7)
(7) edge [right] node[right] {} (6)
(6) edge [right] node[left, red] {} (5);
\end{tikzpicture}}
\end{figure}
\end{adjustbox}
\end{frame}
\end{document}
Thank you!
\setbeamertemplate{section in head/foot shaded}\color{red!40}\hfill\insertsectionhead} \setbeamertemplate{section in toc}\inserttocsectionnumber.~\inserttocsection}
correct is\setbeamertemplate{section in head/foot shaded}{\color{red!40}\hfill\insertsectionhead} \setbeamertemplate{section in toc}{\inserttocsectionnumber.~\inserttocsection}
– Zarko Apr 24 '17 at 22:55Error: Something's wrong--perhaps a missing \item. \end{frame}
– Víctor Mario Noble Ramos Apr 24 '17 at 23:03