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 just started using TikZ an it's amazing. But I can't find out how to change the position of the label inside a node. At the moment I've:

\node (DataAccess) at (0,2) [draw,thick,minimum width=8cm,minimum height=2cm,
      align=center, rounded corners] {Datenzugriff};

But I'd like to have the text in the upper center (but inside) of the rectangle. Any idea?

share|improve this question
add comment

1 Answer

up vote 10 down vote accepted

You can use text depth:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node (DataAccess) at (0,2) [draw,thick,minimum width=8cm,minimum height=2cm, align=center, text depth=2cm, rounded corners, label=below:User space] {Datenzugriff};\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
excellent, thank you a lot. –  john84 Aug 9 '12 at 17:28
add comment

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.