## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Drawing a spider web (tikz example) in a frame of beamer class

Information and discussion about graphics, figures & tables in LaTeX documents.
DaneelOlivaw
Posts: 4
Joined: Sun May 20, 2018 12:57 pm

### Drawing a spider web (tikz example) in a frame of beamer class

Hi,

I am just preparing a slide using beamer class. On this frame I want to draw a spider web.
I found a very useful example at http://www.texample.net/community/ . It works in beamer class as long as I do not put it into a frame. As long as the code is not surrounded by \begin{frame}...\end{frame} everything works well. But after surrounding the code by a frame I got "undefined symbol" error message.I tried to put the suggested variables into a global but either a \setlength within a frame is recognized as "undefined" or the symbol.
It looks like either I am missing something in my code or there is something missing at all.

Error message in the test was:

.\test.vrb:7: Undefined contrl sequence
<argument> \X *\A
:0
l.7 }
?

The atteched file is in the state "workin, frame commented out".

I appreciate any hints

Regards
Attachments
test.tex

Tags:

Johannes_B
Site Moderator
Posts: 3906
Joined: Thu Nov 01, 2012 4:08 pm
The standalone code will give you a cropped pdf. Just include that. It will also reduce compile time.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

DaneelOlivaw
Posts: 4
Joined: Sun May 20, 2018 12:57 pm
That's right, with class standalone everything works. But standalone does not support the beamer features.
The problem seems to be the frame-environment in the beamer class.

Johannes_B
Site Moderator
Posts: 3906
Joined: Thu Nov 01, 2012 4:08 pm
Not what i meant. Finish the image, compile with the standalone class to get the image as a high quality vector pdf image.
Use that pdf-image in a frame for your presentation.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

DaneelOlivaw
Posts: 4
Joined: Sun May 20, 2018 12:57 pm
I've got your point. That's a very nice workaround. I do this with any other pictures but did not expect it here.
But I still think there is something in the frame environment which holds back the basic features. Any other drawings work well. I did many slides with rectangles lines and more. But I cannot define variables either in the environment (or I missed something) nor outside and use them within.

Please refer to the notes at the end of this post. I found out that it will work - somehow but useful

Even this does not work and that sounds strange.
%\RequirePackage{luatex85}
%\documentclass[border=0pt]{standalone}
\documentclass[utf8,german,ignorenonframetext]{beamer}

\usepackage{verbatim}
\usetheme{metropolis}
\usepackage{tikz}

\begin{document}ols as globals
\begin{frame}[fragile]
well done
\end{frame}
\newcommand{\welldone}{well done}
\begin{frame}[fragile]
\welldone %% undefined symbol
\end{frame}
\end{document}

After searching a bit around I found that \new* commands need to be WIHTIN the frame environment (https://tex.stackexchange.com/questions ... amer-frame).
Then the shown example above works nicely.

I tried a bit more and the latets is: it was not an undedfined symbol but something which lead to multiple definitions of a symbol. Dont now why in the test \UU and other gave the multiply defined symbol error.

At the end I did the following:
put the \new*-commands within the frame environment then use symbol names which are NEVER used somewhere else.

Thanks for assistance. It lead to a more deeply look in to the problem.

I still appreciate hints on the basic problems why the frame environment does not accept outer definitions of \new*-commands. Is there something in the documentation of beamer class which I probably read over?

Regards

Stefan Kottwitz
Posts: 9201
Joined: Mon Mar 10, 2008 9:44 pm
Hi Daneel,

welcome to the forum!

The code example defined \AA but used \A. Here you can see that it works, defining the macros in the preamble:


Stefan

DaneelOlivaw
Posts: 4
Joined: Sun May 20, 2018 12:57 pm
Great,

thank you I will try it.

Regards

Stefan Kottwitz