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 have trouble making a tikz picture label break into couple lines. Here is specific MWE:

    \documentclass{article}

    \usepackage[latin1]{inputenc}
    \usepackage{tikz}
    \usetikzlibrary{shapes,arrows}
    \begin{document}
    \tikzstyle{action} = [
                        rectangle, draw, 
                        fill=blue!20,
                        text width=6em,
                        node distance=3cm, 
                        text centered
                        ]

    \begin{tikzpicture}[scale=2, auto]
    % Place nodes
    \node [
            action, 
            label=below:Computer: (0 min)
            ] 
            (Receive) {Receive Order};
    \node [
            action, 
            left of=Receive,
            text width=10em,
            node distance=4cm,
            label=below: hey this is a big\\label; what should i do to break it? 
            ] 
            (identify) {I am a big process name};
    \end{tikzpicture}
\end{document}

As you can see, tikz doesn't break the line. Am I missing something?

share|improve this question
3  
The label behaves like a normal node: Line wrapping only works if you specify the alignment option (like align=center). In this case, you can use label={[align=center]below: hey this is a big\\label; what should i do to break it?}, or you can set the alignment option for all of your labels using every label/.append style={align=center} –  Jake Dec 30 '12 at 20:58
1  
@Jake sounds like an answer :) –  cmhughes Dec 30 '12 at 21:22
    
yeah, can you please write it as an answer? It works thank you :) –  N Nik Dec 30 '12 at 21:29
add comment

1 Answer

up vote 3 down vote accepted

The label behaves like normal nodes: Line wrapping only works if you specify the alignment option (like align=center), in which case you can manually break the lines using \\, or by specifying a text width, in which case the text will automatically wrap around.

For labels, you can use label={[align=center]below: hey this is a big\\label; what should i do to break it?}, or you can set the alignment option for all of your labels using every label/.append style={align=center}.

share|improve this answer
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.