i'm searching a way to do some advanced line coloring. Specific paragraphs should alternately be colored. I've drawn a rough layout sketch to clarify how it should look like: For the orange flags in the header i used tikz and fancyhdr, which worked very well. But i've some problems with the line coloring. My first idea was something like:
Code: Select all
\documentclass[svgnames]{book}
\usepackage{xcolor}
\usepackage{calc}
\usepackage[dvips]{geometry}
\usepackage{vmargin}
\setpapersize{A5}
\pagecolor{Ivory}
\setmarginsrb{0cm}{1.5cm}{0cm}{1.5cm}{0.5cm}{0.2cm}{1cm}{1cm}
\setlength{\parindent}{0pt}
\pagestyle{plain}
\newcommand{\asays}[1]{\colorbox{Beige}{
\parbox{\paperwidth}{
\hangindent=1.5cm \hangafter=0 \parbox{\paperwidth-3cm}{A: #1}}
}\\}
\newcommand{\bsays}[1]{\colorbox{Bisque}{
\parbox{\paperwidth}{
\hangindent=1.5cm \hangafter=0 \parbox{\paperwidth-3cm}{B: #1}}
}\\}
\begin{document}
\asays {Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt}
\bsays {Lorem ipsum dolor sit amet}
\asays {Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt}
\bsays {Lorem ipsum dolor sit amet}
\end{document}
1. Of course the text cannot flow on the text page but only the whole \parbox. This leads to a huge waste of space at the bottom of a page. Paragraphs longer than a page are even cut.
2. The text won't low around graphics (like with wrapfig etc.)
Hopefully someone has an idea how to get the lines colored without those problematic parboxes. If necessary I'd even try to dive a little into TeX but i've no idea where to start.
Thanks a lot in advance,
buergi
Edit by localghost: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.