0

I want to color some block of text (multi line), so I took package xcolor and soul. It works, but I want to have some adjustments: first, the colored text shall have some padding around it, so the text is not touching the border of the color-box; and secondly, the color-box in the second line shall touch the box of the first line.

The text to be colored is not static, so I would like to have a more general approach than to "just make it this way for this particullary example", and it can have german umlauts, if that makes a problem.

This is what I have wich looks not as intended

\documentclass[notitlepage]{scrartcl}
\usepackage{xcolor}
\usepackage{soul}
\setlength{\parskip}{0pt}
\setlength\parindent{0pt}
\definecolor{rgorange}{RGB}{238, 127, 0}
\begin{document}
\sethlcolor{rgorange}\color{white}\hl{Running text\\with line break}
\end{document}
  • 1
    Does https://tex.stackexchange.com/q/291888/15925 help? – Andrew Swann Oct 08 '19 at 15:30
  • not exactly, because that question is about a box around text (=> tcolorbox for sure) and it assumes exatly two lines of colored text, but I want to build a function, that can use any paragraph of text, and color the sentence with a bit of padding around the letters and touching colored boxes when multiline. – Peter Miehle Oct 09 '19 at 09:30
  • Then may be https://tex.stackexchange.com/q/94965/15925 – Andrew Swann Oct 09 '19 at 10:17
  • @AndrewSwann I will have to look into that, which is very specific at breaking at a dot/point while I need a break at a (from latex induced) line break – Peter Miehle Oct 11 '19 at 07:22

0 Answers0