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.

This is my minimal example:

\documentclass{article} 
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw=black, rounded corners=2pt, rectangle, bottom color=black!80!white, text width=12cm]
    {text aligned on left margin  t.a. on the right margin};
\end{tikzpicture}
\end{document}

I'd like to have the first part of the text aligned on left margin of the node and the second on the right, but if I use for the second part the command \begin{flushright} ... \end{flushright} I get it on the next line. How can I get the whole text on a single line?

share|improve this question
1  
Does it have to be a single node? You could also use two nodes each 6cm wide, I guess? –  Tom Bombadil Sep 27 '11 at 17:55
    
I'd rather to have a single node, but any suggestion is really appreciated. Thanks for your attention! –  Arianna Angeletti Sep 28 '11 at 8:55
add comment

1 Answer

up vote 2 down vote accepted

Try \hfill:

\documentclass{article} 
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw=black, rounded corners=2pt, rectangle, bottom color=black!80!white,  text width=12cm] {text aligned on left margin \hfill t.a. on the right margin};
\end{tikzpicture}
\end{document}
share|improve this answer
    
Thanks! This is exactly what was missing. –  Arianna Angeletti Sep 28 '11 at 11:16
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.