\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}[
Node/.style = {rectangle, text width=#1, align=flush center}
]\tiny
\node[Node=5ex] {FFT};
\end{tikzpicture}
\end{frame}
\end{document}
It generate the following error:
! Illegal parameter number in definition of \test.
<to be read again>
1
l.11 \end{tikzpicture}
The same example with other documentclass work without above error (as
it is described in manual for TikZ. Do I miss something or this some
bug? I use beamer 3.07.
regards, Zarko
> \begin{frame}
Try to replace this with:
\begin{frame}[fragile]
and make sure your tikzpicture works in an article class or similar
before incorporating it into beamer.
Petter
--
.sig removed by request.
unfortunately, this doesn't help. I receive the same error in beamar.
Any way thank you for your concern.
regards, Zarko
> On 11.6.2010 8:30, Petter Gustad wrote:
>> "Zarko F. Cucej"<zarko...@google.com> writes:
>>
>>> \begin{frame}
>>
>> Try to replace this with:
>>
>> \begin{frame}[fragile]
>>
>> and make sure your tikzpicture works in an article class or similar
>> before incorporating it into beamer.
>>
>> Petter
>>
>
> unfortunately, this doesn't help. I receive the same error in beamar.
I don't get the same error. Using your code I get:
1
l.10 \end{tikzpicture}
After adding [fragile] to the frame I get:
l.4 \node[Node=5ex]
{FFT};
Which is a problem with your tikz code.
Hi
I don't know why but you need to define style
outside the frame environment
align=flush center ?? I don't know this style
rectangle ? I think that a text node is a minipage or a parbox
so it's a rectangle
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\tikzset{Node/.style = { text width=#1, text centered}}
\begin{frame}
\begin{tikzpicture}
\node[Node=5ex] {FFT FTF TTT DGDF};
\end{tikzpicture}
\end{frame}
\end{document}
Alain Matthes
Dear Alain Matthes,
Thank you for information. This approach is in case of many different
images with different need for parameters quite inconvenient to me. So,
temporary I will stay at direct writing variable parameters in node
options and use styles only for common features.
regards, Zarko
Yuo get this error if you try to use a parameter number inside the
definition of a command which doesn't have an argument:
\documentclass{article}
\begin{document}
\def\test{\def\abc#1{#1}}
\end{document}
The solution is to double the parameter:
\documentclass{article}
\begin{document}
\def\test{\def\abc##1{blub##1}}
\test \abc{cde}
\end{document}
In the case of beamer doubling is not enough, as the content of a
frame is stored twice: After doubling you get the same error but now
for the command \beamer@doifinframe instead of \test.
So the solution is to redouble the parameter sign:
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}[
Node/.style = {rectangle, text width=####1}
]\tiny
\node[Node=5ex] {FFT};
\end{tikzpicture}
\end{frame}
\end{document}
--
Ulrike Fischer
Waouu !
You fell into a marmite of Tex when you were a little girl !!! (chess notation)
Alain
> Yuo get this error if you try to use a parameter number inside the
> definition of a command which doesn't have an argument:
Impressive LaTeX knowledge! Thank you for clearing this up.