Menu

#216 misalignment with font=[size], align, and text width=[rel]

v1.0 (example)
closed-duplicate
nobody
None
5
2013-07-17
2012-08-25
Anonymous
No

I believe this is the same problem as reported at http://old.nabble.com/Tikz---font-size%2C-em-ex-and-text-%28badly%29-centered-td27887298.html but I can't see any replies to that thread.
I would expect the four nodes in the following example to look the same, however the third is incorrectly aligned (also attached in case the formatting breaks here). The key participants are the combinations of setting the font size using a key to the node and using a relative text size in the same:
\documentclass{article}
\usepackage{tikz}
\begin{document}
%3em in \tiny = 20.41695pt
%3em in \normalsize = 30.00005pt
\begin{tikzpicture}[y=-0.5cm]
\node[draw,align=right,font=,text width=3em,] at (0,0) {\tiny hello};
\node[draw,align=right,font=,text width=30pt,] at (0,1) {\tiny hello};
\node[draw,align=right,font=\tiny,text width=3em,] at (0,2) {hello};
\node[draw,align=right,font=\tiny,text width=30pt] at (0,3) {hello};
\end{tikzpicture}
\end{document}

Discussion

  • Anonymous

    Anonymous - 2012-08-25

    I've just noticed that ID 3002522 (http://sourceforge.net/tracker/?func=detail&aid=3002522&group_id=142562&atid=752792) is a duplicate of this, but that issue did not clearly describe the dependence on the font key.

     

    Last edit: Anonymous 2016-01-13
  • Till Tantau

    Till Tantau - 2013-07-17
    • status: open --> closed-duplicate
    • Group: --> v1.0 (example)
     
  • Till Tantau

    Till Tantau - 2013-07-17

    This was the same as bug #131, which is now fixed in CVS.