Graphics, Figures & TablesBeamer vs tikz

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

Beamer vs tikz

Post by thomasb »

This works :

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{frame}
  \frametitle{Title}
  \framesubtitle{Subtitle}
  Text
  \begin{figure}
    \centering
    \begin{tikzpicture}% [domain=-3:0.2, label/.style={postaction={
      % decorate,decoration={
      % markings,
      % mark=at position 0.9 with {\node[above, transform shape] {#1};}}}}]

    \end{tikzpicture}
    \caption{Figure}
  \end{figure}
\end{frame}
\end{document}
--------------------------------------------------
but this doesn't :

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{frame}
  \frametitle{Title}
  \framesubtitle{Subtitle}
  Text
  \begin{figure}
    \centering
    \begin{tikzpicture}[domain=-3:0.2, label/.style={postaction={
      decorate,decoration={
      markings,
      mark=at position 0.9 with {\node[above, transform shape] {#1};}}}}]

    \end{tikzpicture}
    \caption{Figure}
  \end{figure}
\end{frame}
\end{document}
MinimalBeamer.log
(36.6 KiB) Downloaded 358 times
The log is in attachment. Any idea ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Beamer vs tikz

Post by Stefan Kottwitz »

Hi Thomas!

That's caused by the #1 argument. The syntax is ok, but the beamer way of processing frames breaks it. You can prevent it by declaring the frame as fragile:

\begin{frame}[fragile]

Stefan
LaTeX.org admin
thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

Beamer vs tikz

Post by thomasb »

Wow ! Thanks...
Post Reply