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.

How do I get paragraphs inside a node to indent?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw,text width=9cm] {
        indent in paragraph long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text.

indent in paragraph long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text.
};
\end{tikzpicture}
\end{document}
share|improve this question

1 Answer 1

up vote 7 down vote accepted

The easiest way is to put a minipage environment within the node, and to set \parindent to whatever indent width you want:

\begin{tikzpicture}
\node[draw,text width=9cm] {
   \begin{minipage}{9cm}
      \parindent=3em
      indent in paragraph long text long text long text...

      indent in paragraph long text long text long text ...
    \end{minipage}
};
\end{tikzpicture}

If you leave out the minipage, then your first paragraph will not be indented. You could force the indent by saying \indent before the first line:

\node[draw,text width=9cm] {
      \parindent=3em
      \indent indent in paragraph long text long text long text...
};

which would also work. The second way is probably more efficient for TeX (one fewer minipage to compute), but the first may be somewhat more robust.

share|improve this answer
2  
Or a more latex-y way: \setlength{\parindent}{3em}. In the second solution, only the first paragraph needs the \indent command. –  Alan Munn Jul 9 '11 at 3:31
    
thank you for all. –  Regis da Silva Jul 9 '11 at 3:54

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.