Sujet : Re: color background text
De : news3 (at) *nospam* nililand.de (Ulrike Fischer)
Groupes : fr.comp.text.texDate : 30. Sep 2021, 14:31:12
Autres entêtes
Message-ID : <ceahfj8ty33b$.dlg@nililand.de>
References : 1
User-Agent : 40tude_Dialog/2.0.15.41de
Am Thu, 30 Sep 2021 14:15:10 +0200 schrieb Jean-Yves Baudais:
Bonjour,
Voici l'ECM
\documentclass{article}
\usepackage{xcolor}
\newcommand\mytext{texte texte texte texte texte texte texte texte texte
texte texte texte texte texte texte texte texte texte texte texte texte
texte}
\begin{document}
1) \mytext{} \textcolor{red}{\mytext} \mytext
2) \mytext{} \fcolorbox{black}{yellow}{\mytext} \mytext
\end{document}
J'aimerais pouvoir colorer le "background" comme dans le 2e cas avec la
mise en forme du 1er cas. Existe-t-il un package qui sache faire ça ?
J'ai regardé du côté de tcolorbox mais je n'ai pas trouvé de commande
toute faite.
Avec lualatex:
\documentclass{article}
\usepackage{xcolor,luacolor,lua-ul}
\newcommand\mytext{texte texte texte texte texte texte texte texte
texte
texte texte texte texte texte texte texte texte texte texte texte
texte
texte}
\begin{document}
1) \mytext{} \textcolor{red}{\mytext} \mytext
2) \mytext{} \highLight[yellow]{\mytext} \mytext
\end{document}
Avec pdflatex tu peux utilise soul, mais c'est moins flexible.
-- Ulrike Fischer http://www.troubleshooting-tex.de/