[OS X TeX] global macros

Rechtsanwalt Friedrich Vosberg vosberg at meinrechtsanwalt.com
Sun Mar 5 11:45:47 CET 2006


Morning.

Am 04.03.2006 um 23:24 schrieb Herbert Schulz:

> I think using \gdef rather than \def will do it.

For my purpose I'm afraid \gdef isn't the solution. The following  
example demonstrates the problem. Have you any idea how to make it  
working to use the commands *if* defined in the environment quote?

===== 8>< =====
\documentclass{ltxdoc}
\newcounter{member}
\makeatletter
\newcommand*{\member}[2]{%
   \stepcounter{member}%
   \@namedef{name\Alph{member}}{#1}%
   \@namedef{prof\Alph{member}}{#2}%
   \printmember%
}
\newcommand*\showProf[1]{%
	\@nameuse{prof#1}%
}
\gdef\printprof{%
	\@nameuse{prof\Alph{member}}
}
\gdef\printname{%
	\@nameuse{name\Alph{member}}
}
\newcommand*\printmember{%
	\framebox{%
		No.\,\arabic{member}: \printname\ (\printprof)
	}%
}
\makeatother
\begin{document}
%\begin{quote}
\member{Bush}{President}
\member{Blair}{Prime Minister}
\member{Merkel}{Chancellor}
%\end{quote}
\noindent The professions of some of our members are \showProf{C}.  
Others are \showProf{A}.
\begin{itemize}
\item \showProf{B}
\end{itemize}
\end{document}
===== ><8 =====

TIA and kind regards. Friedrich


--
Rechtsanwalt Friedrich Vosberg
Alt-Oetzsch 4, 04416 Markkleeberg
Ruf: 0341 3502074   Mobil: 0174 1602887
Fax: 0341 3502075   http://www.meinrechtsanwalt.com




------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list