Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What is the correct way to label and captionize a tkizpicture inside a tabular environment? (Since figures are not allowed inside a tabular)

Excerpt from my .tex:

\begin{tabular}{l r}

   ... % I want to label this tikzpicutre and give it a nice caption

Outside the tabular I would have done it like this:


Basically I want to create a page that looks like this:

|Text Text    TKIZ    TKIZ |
|TextText     TKIZ    TKIZ |
| Text Text   Figure X: ...|
|                          |
|This text is under the    |
|table and references above|
|TKIZ Figure with \ref{..} |
share|improve this question
The "correct" way depends on a lot of factors, including what else is in the tabular (and perhaps why a tabular is needed in the first place). Can you explain your exact problem a little more? –  ESultanik Dec 2 '10 at 21:55

1 Answer 1

up vote 9 down vote accepted

I recommend to use the \captionof command of the caption package (or load the tiny capt-of package instead). This command produces captions within other environments than figure or table and even lists them in the list of figures resp. tables.

Here's a complete example for demonstration:

\section*{Test table}
Text text text &
     \draw (0,0) -> (4,0);
   \captionof{figure}{Sample picture}

See fig. \ref{tikz}.

alt text

Btw. use \label after \caption, unlike in the example in your question.

share|improve this answer
Great solution! Thanks! –  Chris Dec 2 '10 at 22:27
Since v3.04, the KOMA-Script-classes also provide the \captionof command. –  lockstep Dec 3 '10 at 0:18
+1 for the tip "put \label after \caption", saved my day! –  qed Nov 18 '13 at 8:50
Super good answer, since it does not need figure to be used. –  G. Samaras Apr 17 at 0:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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