TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Has anyone an idea how to use tikzpicture WITHIN a figure caption? What I want is, plot a blue circle withing a figure caption, like:

\caption{CaptionText \begin{tikzpicture} \draw[thick, color=blue, fill=blue] plot[mark=*, mark options={scale=1.3}] (0,0); \end{tikzpicture} CaptionText.}

Within regular text, this works fine with

RegularText \begin{tikzpicture} \draw[thick, color=blue, fill=blue] plot[mark=*, mark options={scale=1.3}] (0,0); \end{tikzpicture} RegularText
share|improve this question

marked as duplicate by Jubobs, lockstep, Claudio Fiandrino, mafp, egreg May 21 '13 at 9:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Welcome to TeX.SX! You may have a look on our starter guide. – Jubobs May 21 '13 at 8:53

As Jubobs pointed out, this question has already been answered: Using TikZ inside a figure caption. For your situation, I got it to work by adding \protect to the tikz commands:




-- This is a figure --
\caption{Figure within caption {\protect\tikz \protect\draw[thick, color=blue, fill=blue] plot[mark=*, mark options={scale=1.3}] (0,0);} }

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.