# How to make \parshape work inside a tikz node?

Expected output (2nd line has 5mm more indent than 1st, 3rd and following lines have 5mm more indent than 2nd):

\documentclass{article}
\begin{document}
\setlength{\parindent}{0pt}
\parshape=3 5mm 40mm 10mm 35mm 15mm 30mm
This is sentence 1. This is sentence 2. This is sentence 3. This is sentence 4. This is sentence 5.
\end{document}


\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path node[draw,text width=50mm]
{ \setlength{\parindent}{0pt}
\parshape=3 5mm 40mm 10mm 35mm 15mm 30mm
This is sentence 1. This is sentence 2. This is sentence 3. This is sentence 4. This is sentence 5.
};
\end{tikzpicture}
\end{document}


Just introduce \par command will solve the issue:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path node[draw,text width=50mm]
{ \setlength{\parindent}{0pt}
\parshape=3 5mm 40mm 10mm 35mm 15mm 30mm
This is sentence 1. This is sentence 2. This is sentence 3.
This is sentence 4. This is sentence 5.\par
};
\end{tikzpicture}
\end{document}

• I think you need a trailing % following \setlength{}{}. – Peter Grill May 21 at 6:53
• @PeterGrill I have followed the tag what the user provided as MWE...anyhow, thanks... – MadyYuvi May 21 at 6:55

Put the text in a \parbox:

Also it appears that you can use the font= to set the \parshape and then it just works (although I am not sure that this is a good idea).

## Code:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path node[draw,text width=50mm]
{\parbox{\linewidth}{%
\setlength{\parindent}{0pt}
\parshape=3 5mm 40mm 10mm 35mm 15mm 30mm
This is sentence 1.
This is sentence 2.
This is sentence 3.
This is sentence 4.
This is sentence 5.%
}%
};
\end{tikzpicture}
\end{document}


## Code:

\begin{document}
\begin{tikzpicture}
\path node[draw,text width=50mm, font={\parshape=3 5mm 40mm 10mm 35mm 15mm 30mm}]
{%
This is sentence 1.
This is sentence 2.
This is sentence 3.
This is sentence 4.
This is sentence 5.%
};
\end{tikzpicture}
\end{document}