LaTeX forum ⇒ Graphics, Figures & TablesBeamer vs tikz Topic is solved

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

Beamer vs tikz

Postby thomasb » Thu Jun 13, 2019 3:41 pm

This works :

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{beamer}
  2. \usepackage{tikz}
  3. \usetikzlibrary{calc}
  4. \usetikzlibrary{intersections}
  5. \usetikzlibrary{decorations.pathmorphing}
  6. \usetikzlibrary{decorations.markings}
  7. \usetikzlibrary{arrows.meta}
  8. \begin{document}
  9. \begin{frame}
  10. \frametitle{Title}
  11. \framesubtitle{Subtitle}
  12. Text
  13. \begin{figure}
  14. \centering
  15. \begin{tikzpicture}% [domain=-3:0.2, label/.style={postaction={
  16. % decorate,decoration={
  17. % markings,
  18. % mark=at position 0.9 with {\node[above, transform shape] {#1};}}}}]
  19.  
  20. \end{tikzpicture}
  21. \caption{Figure}
  22. \end{figure}
  23. \end{frame}
  24. \end{document}


--------------------------------------------------
but this doesn't :

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{beamer}
  2. \usepackage{tikz}
  3. \usetikzlibrary{calc}
  4. \usetikzlibrary{intersections}
  5. \usetikzlibrary{decorations.pathmorphing}
  6. \usetikzlibrary{decorations.markings}
  7. \usetikzlibrary{arrows.meta}
  8. \begin{document}
  9. \begin{frame}
  10. \frametitle{Title}
  11. \framesubtitle{Subtitle}
  12. Text
  13. \begin{figure}
  14. \centering
  15. \begin{tikzpicture}[domain=-3:0.2, label/.style={postaction={
  16. decorate,decoration={
  17. markings,
  18. mark=at position 0.9 with {\node[above, transform shape] {#1};}}}}]
  19.  
  20. \end{tikzpicture}
  21. \caption{Figure}
  22. \end{figure}
  23. \end{frame}
  24. \end{document}

MinimalBeamer.log
(36.6 KiB) Downloaded 28 times

The log is in attachment. Any idea ?

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

Postby Stefan Kottwitz » Thu Jun 13, 2019 9:06 pm

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
Site admin

User avatar
thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am

Postby thomasb » Fri Jun 14, 2019 8:06 am

Wow ! Thanks...


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 14 guests