[Tex/LaTex] How to Label and Caption a Tikzpicture inside a tabular environment


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{..} |

Best Answer

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.

Related Question