I have a linked question that I previously found on here, but I cannot make any comment yet to post. The link being: Good way to make \textcircled numbers?
My question was how could we use this command more then once in our TeX file in different parts of our file without generating an error.
Example Code:
\documentclass{article}
\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
Numbers aligned with the text: \circled{1} \circled{2} \circled{3} end.
\end{document}
The error message is this:
! LaTeX Error: Command \circled already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
1.222 ...circle,draw,inner sep=2pt] (char) {#1};}}
When removing the \newcommand* it shows this next error message:
! You can't use 'macro parameter character #' in restricted horizontal mode.
<argument> ...ircle,draw,inner sep=2pt] (char {##
1}
Can someone help out please. Thank You so much.
\circledmultiple times, instead of using it. Make sure that you only have one\newcommandand that it isn't inside a macro you use. – Martin Scharrer Apr 08 '11 at 17:53\newcommand*in several different files, but it should only be once per file. – Martin Scharrer Apr 08 '11 at 18:07\circled. – Willie Wong Apr 08 '11 at 18:15\newcommand*\circledonce in the preamble and then you can use it multiple times, like in your example which works fine. If you want automatic numbering, so you don't have to add the number in\circledmanually, then please edit your question and ask explicitly for it. – Martin Scharrer Apr 08 '11 at 19:46http://i.imgur.com/NxEdq.jpg
– night owl Apr 08 '11 at 21:06!in front of the image code to turn it into a link. I can turn it back to an image for you. – Martin Scharrer Apr 08 '11 at 21:09