On 02/03/2011 08:37 AM, Christoph Mayer wrote:
Dear all,
I have a graph which i need to explain in the caption. Unfortunately I need
numbers and letters with a circle around in order to explain it (which is a
scanned image). Therefore, I defined a new command in the preamble of the main
document
\usepackage{tikz}
\newcommand*\mycirc[1]{%
\begin{tikzpicture}[baseline=(C.base)]
\node[draw,circle,inner sep=1pt](C) {#1};
\end{tikzpicture}}
and here the preview of the latex-code, I inserted the command via ERT:
\begin{figure}
\noindent \begin{centering}
\includegraphics[scale=0.5]{\string"../Pics/Chapter/1_\string".png}
\par\end{centering}
\caption{ diagram displaying the corrosion
\mycirc{1}\label{fig:1} }
\end{figure}
I cannot compile it, even when I insert the command directly into the caption,
like
\begin{tikzpicture}[baseline=(C.base)] \node[draw,circle,inner sep=1pt](C) {1};
\end{tikzpicture}
it only produces errors, while both possible ways work outside the caption in
standard environment.
Could anybody help me to get around that problem inside the caption environment?
thanks a lot and all the best!
pifont provides circled numbers. So \usepackage{pifont} and then:
\ding{172} for a circled `1'. See
http://willbenton.com/wb-images/pifont.pdf
// for the codepoints.
rh