Imagine text on a thin strip of paper that is being wound around like a ribbon. I thought that this might be possible with tikz. What I want is something that satisfies three properties:
- Highlights the background to the text in one colour (say yellow).
- The background to each line is visible (so the background doesn't merge into one big coloured block).
- A further coloured rectangle (say grey), behind the yellow, which would be at an angle joining the end of the line wrap to the beginning of the next line. In the MWE this rectangle of property 3 start at the A in the text and finish at B.
The following MWE only satisfies property 1.
\documentclass{article}
\usepackage{tikz}
\newcommand\ribbonText[1]{%
\tikz\node[rectangle, fill=yellow, text width=31mm]{#1};%
}%
\begin{document}
\ribbonText{hello world this is some dummy text}
\end{document}
EDIT The answer by Ignasi has some merit, but is it not possible to automatically find the line breaks in a tikz node?

