4

I'm drawing a diagram with nodes and I have to have the inner text of one node at the END of the line, i.e. at the right side, not left, not centered. Unfortunately I didn't find a way nor information in the web.

That's how my picture now looks like:

As you can see the text in the node "Client" (right side) is covered by the "Anwendungsprogramm"-node. How can I shove the text on the right side of the node?

The code:
(It's a large document, that's why I use this many packages. For I'm not sure which packages do influence my graphics, I'll take all.)

\usepackage[babel, german=quotes]{csquotes}
\usepackage{array}
\usepackage[style=alphabetic, backend=bibtex8]{biblatex}
\usepackage{setspace}
\usepackage{geometry}
\usepackage[table]{xcolor} 
\usepackage[arrow, matrix, curve]{xy}
\usepackage{calc}
\usepackage{multirow}
\usepackage{tikz}
\usetikzlibrary{matrix,calc,positioning,arrows}

\begin{document}

\begin{figure}[htbp]
\begin{center}      
\begin{tikzpicture}     

    \node [rectangle, rounded corners=1mm, minimum size=25mm, text width=40mm,
            anchor=base, very thick, draw=black!50, fill=black!10]                      
           (server)     {Server};

    \node [rectangle, rounded corners=1mm, minimum size=20mm, text width=25mm, 
            anchor=base, very thick, draw=black!50, text centered, 
           right=20mm of server]    
           (webservice) {Webservice};              

    \node [rectangle, rounded corners=1mm, minimum size=20mm, text width=20mm, 
            anchor=base, very thick, draw=black!50, fill=white!100, text centered, 
           right=-25mm of server]   
           (server-p)   {Anwen-\\ dungs-\\ programm};              

    \node [rectangle, rounded corners=1mm, minimum size=25mm, text width=40mm, 
            anchor=base, very thick, draw=black!50, fill=black!10, text centered, 
           right=20mm of webservice]    
           (client) {Client};          

    \node [rectangle, rounded corners=1mm, minimum size=20mm, text width=20mm, 
            anchor=base, very thick, draw=black!50, fill=white!100, text centered, 
           left=-25mm of client]    
           (client-p)   {Anwen-\\ dungs-\\ programm};

    \draw [<->, very thick] (webservice) to (server-p);
    \draw [<->, very thick] (webservice) to (client-p);

\end{tikzpicture}
\bigskip
\label{fig-funktionaleebenen}   
\end{center}    
\end{figure}

\end{document}
  • 1
    \node[align=right] {Client}; – Gonzalo Medina Sep 11 '13 at 16:48
  • 1
    Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. — How did you do it with the Server node? – Qrrbrbirlbel Sep 11 '13 at 16:51
  • @Gonzalo Medina, you're right, this works! (I aded the alignment to the wrong node first, that's why it did not work.) Thanks a lot. – Jana Sep 11 '13 at 17:14
4

If you delete text centered as one of the \node options for client and then do as @GonzaloMedina suggested: add align=right, this will right align the content of the node.enter image description here

  • Yes I noticed this just now. Tried the alignment on wrong node first. @_@ – Jana Sep 11 '13 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.