Farbkasten mit abgerundeten Ecken

Oct 30 2020

Hier ist mein MWE:

\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\colorlet{LightLavender}{Lavender!40!}

\begin{document}

\colorbox{LightLavender}{hello} world

\end{document}

Es produziert so etwas:

Ich frage mich, ob es möglich ist, dass die Box abgerundete Ecken hat. Im Idealfall funktioniert eine Lösung sowohl im Text- als auch im Mathematikmodus, da ich sie manchmal in Gleichungen verwende, um zu bestimmen, welche Begriffe gleich sind / aufgehoben werden.

Antworten

11 Zarko Oct 30 2020 at 14:37

tcolorbox, mit Verwendung in mathematischen Umgebungen:

\documentclass[dvipsnames]{article}
\usepackage[most]{tcolorbox}
\colorlet{LightLavender}{Lavender!40!}
\tcbset{on line, 
        boxsep=4pt, left=0pt,right=0pt,top=0pt,bottom=0pt,
        colframe=white,colback=LightLavender,  
        highlight math style={enhanced}
        }

\begin{document}
\tcbox{Hello} world! $\tcbhighmath{c^2} = a^2 + b^2$
\end{document}

2 Noname Oct 30 2020 at 09:52

Verwenden Sie tcolorbox.

\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\colorlet{LightLavender}{Lavender!40!}
\usepackage{tcolorbox}
\begin{document}

\tcbox[on line,boxsep=0pt,left=2pt,right=2pt,top=2pt,bottom=2pt,colback=LightLavender]{hello} world

\end{document}