I'm trying to make a space of a given width, e.g. 10cm, in a tikzpicture environment where i can input text either with style-1 or style-2. Style-1 is for example [text width=6cm, align=left] and style-2 is [text width=6cm, align=right]. As usually \node needs coordinates, i used 'chains', but I've not yet found how to set the width of the whole text block. I tried to nest a node with style-1 or style-2 within a \node at (0,0) [text width=10] but that doesn't work.
Here is an illustration done with a wysiwyg program.
here is my mwe:
\documentclass[a4paper]{article}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{positioning,chains}
\setlength{\parindent}{0pt}
\begin{document}
\begin{tikzpicture}
[start chain=going below]{
\node [on chain, text width=6cm] {\lipsum[1][1]}; \
\node [on chain, text width=6cm] {\lipsum[1][2]}; \
\node [on chain, text width=6cm] {\lipsum[1][3]}; \
\node [on chain, text width=6cm] {\lipsum[1][4]}; \
};
\end{tikzpicture}
\end{document}
EDIT: here's my own solution, but i'm still expecting a better one
\begin{document}
\begin{tikzpicture}
[start chain=going below, node distance=.2cm]
\node [on chain, align=left, text width=6cm] {\lipsum[1][1]};
\node [on chain, align=right, text width=6cm, xshift=4cm] {\lipsum[1][2]};
\node [on chain, align=left, text width=6cm, xshift=-4cm] {\lipsum[1][3-8]};
\node [on chain, align=right, text width=6cm, xshift=4cm] {\lipsum[1][9]};
\end{tikzpicture}
\end{document}

tcolorboxfor that. But you need to define two node styles, one for each chatter. And maybe usingchainwould be better thant amatrix of nodes. – SebGlav Feb 01 '22 at 15:18