# node shadowed extra } error

try to get pgf manuals title page code into own areas. I have copied the code snippet of titlepage for nodeshadowed, but get error: \nodeshadowed has an extra }. I don't see the error. Additionally it seems I have troubles to put the code right in here (following mwe). But I try anyway. Thanks for your ideas.

    \documentclass[fontsize=10pt]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[margin=1cm,a5paper]{geometry}

\usepackage{tikz}

\usepackage[ngerman]{babel}

\begin{document}
\parbox[]{\textwidth}{%

\begin{tikzpicture}[]
\node[scale=2,above,#1]{\global\setbox\mybox=\hbox{#2}\copy\mybox};
}
\end{tikzpicture}
}%end parbox

\end{document}

• Have you defined \mybox? – Sebastiano Dec 9 '18 at 16:17
• No, i have thought it was defined by/in first node (newbie). Insert of \newsavebox\mybox leads to same error. – gizeh Dec 10 '18 at 16:32

I do not know why you are doing all the \mybox stuff. If you want to do it, you may want, as suggested by @Sebastiano, define it, i.e. do \newsavebox\mybox. But I don't see what this will be good for.

\documentclass[fontsize=10pt]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[margin=1cm,a5paper]{geometry}

\usepackage{tikz}

\node[scale=2,above,#1]{#2};
{#2};
}
\begin{document}
\parbox[]{\textwidth}{%

\begin{tikzpicture}[]
\end{tikzpicture}
}%end parbox

\end{document}


• code is at least original code from pgf-manual 301a i have met many problems to realize the code in an own area. i wanted to use the same code as on title. the nodeshadowed was unsolvable for me. So many thanks for your solution. Code of manual seems to include many pitfalls. – gizeh Dec 10 '18 at 16:28
• @gizeh The manual is great except that one never really knows with libraries are to be loaded. – marmot Dec 10 '18 at 16:30
• your code solves the problem, but is not able to set the lindenmayer fadings correctly. Origins of the "plants" doesn't suit, Slightly shifted. With Tantau's corrected code of nodeshadowed it works. – gizeh Dec 22 '18 at 11:08

Two corrections for mwe.

1) Declare mybox (\newbox\mybox). Thanks @Sebastiano Corr.1

2) Consider the syntax of \def in Tikz. See below Corr.2

So it works for me compiling with pdflatex. Unfortunately I don't know how to include the resulting pdf here.

\documentclass[fontsize=10pt]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[margin=1cm,a5paper]{geometry}
\usepackage[a5,frame,center]{crop}

\usepackage{tikz}

\usepackage[ngerman]{babel}

\begin{document}
\centering
\newbox\mybox %necessary for use in following def. Corr.1
\parbox[]{\textwidth}{%
\begin{tikzpicture}[]
\def\nodeshadowed[#1]#2;{%syntax error in first mwe, corrected. [ and ] and ; are part of def!
%cmp. pgf man. 301a p.82 for a def - example. Corr.2
\node[scale=2,above,#1]{\global\setbox\mybox=\hbox{#2}\copy\mybox};
}%end of \def needs no ";".
\draw[step=.5cm,help lines] (-6,-5.5) grid (6,5.5);

\foreach \x in {-6,...,6}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\x$};
\foreach \y in {-5.5,...,5.5}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east] {$\y$};
\draw (1pt,0 cm) -- (-1pt,0 cm) node[anchor=east] {};

\foreach \where in {-3.5cm,3.5cm} {%
{ \tikz
\draw [green!20!black,
rotate=90,
l-system={rule set={F -> FF-[-F+F]+[+F-F]},
axiom=F,
order=4,%sets the number of iterations the L-System will perform 301a p.638
step=1pt,
randomize step percent=50,
angle=30,
randomize angle percent=5}
]
l-system;