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.

I created a tree using TikZ and would like to add tabular explanation data to the right of it.

The figure definition currently looks like this:

\begin{figure*}[h!]
  \input{tikz/praefixeigenschaft}
  \label{f:praefixeigenschaft}
\end{figure*}

...and renders to the following tree:

tree

The explanation text is defined as follows:

\begin{tabular}{l l}
  A = 100 & p = 0.2 \\
  B = 1101 & p = 0.1 \\
  C = 1100 & p = 0.1 \\
  D = 111 & p = 0.2 \\
  E = 0 & p = 0.4 \\
\end{tabular}

CEBA: 1100 / 0 / 1101 / 100

...and renders to:

text

I tried both placing the figure in a table and floating the figure using the wrapfig package, but both attempts were not fruitful.

How can I add the explanation text to the right of the figure (like in simple HTML table layout)?

share|improve this question
    
Hi Danilo. It is always preferable to post complete minimal working examples rather than code snippets because this helps people to answer you. –  Claudio Fiandrino Dec 30 '12 at 13:28
    
@ClaudioFiandrino thanks, I'll do that next time! :) –  Danilo Bargen Dec 30 '12 at 13:34
    
add comment

1 Answer

up vote 1 down vote accepted

As you don't give a caption to the figure and try to fix it at the position in text with the [!h] parameter, you maybe won't need the figure environment at all. You could consider my example code below, where I replaced your figure with some text as you don't give the source code of it.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\noindent\begin{minipage}{.5\linewidth}%
The image
\end{minipage}%
\begin{minipage}{.5\linewidth}
\begin{tabular}{l l}
  A = 100 & p = 0.2 \\
  B = 1101 & p = 0.1 \\
  C = 1100 & p = 0.1 \\
  D = 111 & p = 0.2 \\
  E = 0 & p = 0.4 \\
\end{tabular}

CEBA: 1100 / 0 / 1101 / 100
\end{minipage}
\end{document}

This renders as follows:

enter image description here

share|improve this answer
1  
[!h] doesn't fix the position of the figure, it can still float. –  Torbjørn T. Dec 30 '12 at 13:43
    
Thanks for your answer. This seems to work using the standalone documentclass, but not inside the normal scrartcl class. Is there a way to fix this, or do I have to include the standalone file in the main document? –  Danilo Bargen Dec 30 '12 at 13:44
    
@TorbjørnT. right, I should have written "try to fix it". –  Benedikt Bauer Dec 30 '12 at 13:47
    
@DaniloBargen Benedikt's code works fine in scrartcl as well, so there is something else that's wrong. –  Torbjørn T. Dec 30 '12 at 13:48
    
@DaniloBargen What exactly does not work? Do you get errors or warnings? Does it render correctly? If you get an overfull box warning you have to add a % sign right after the first \end{minipage}. I will edit my post to take this into account. –  Benedikt Bauer Dec 30 '12 at 13:50
show 2 more comments

Your Answer

 
discard

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.