How to make \parshape work inside a tikz node?
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}
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}