I'm looking to define a command that will facilitate placement of bold text in a yellow background. Here is a start without the bold, that also fails to wrap. I've tried a number of options without much success.
Johannes_B wrote:In order to help you, we need more information. What is going to happen, if the text is longer than one line, or longer than one paragraph.
\documentclass{minimal}
\usepackage{color,comment}
\begin{document}
\def\comment{\colorbox{yellow}}{}
In the compiled output text in curly brackets extends beyond the right margin
\comment{ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZz}
\end{document}
\documentclass{article}
\usepackage[width=5.05cm]{geometry}
\usepackage{color,soul}
\begin{document}
\noindent\hl{Highlighting} text feels good.
You can draw attention of people to a \hl{word} or perhaps
\hl{even a whole sentence that spans across multiple lines
in such a way that hyphenation etc. are not affected.}
\end{document}