
Wie könnte ich Folgendes mithilfe eines erstellen tcolorbox
?
Das Beste, was ich jedes Mal hinbekomme, ist Folgendes:
MWE:
\documentclass[12pt]{article}
\usepackage[many]{tcolorbox}
\usepackage{tikz}
\usepackage[margin=2cm,includefoot,bottom=2.55cm,top=2.025cm,headsep=0.5cm,footskip=0.65cm]{geometry}
\definecolor{myblue}{RGB}{0,46,142}
\newtcolorbox[auto counter]{mytheorem}[1][]{
enhanced jigsaw,colback=white,colframe=myblue,coltitle=myblue,
fonttitle=\bfseries,
sharp corners,
detach title,
leftrule=18mm,
underlay unbroken and first={\node[above,text=white,font=\bfseries,align=center]
at ([xshift=-9mm,yshift=0mm]interior.west) {\thetcbcounter};},
breakable,pad at break=1mm,
#1,
code={\ifdefempty{\tcbtitletext}{}{\tcbset{before upper={\tcbtitle\par\medskip}}}},
}
\begin{document}\raggedright
\begin{mytheorem}[title=Important Note]
Important content. A body remains in a state of rest or continuous uniform motion unless acted on by an unbalanced external force.
\begin{align*}
45x^2-4x & =75x
\end{align*}
\end{mytheorem}
\end{document}
Ich frage mich auch, was erforderlich wäre, um die Postfachnummer in der Mitte der Spalte oder alternativ oben in der Spalte in einer Linie mit der Überschrift anzuzeigen.
Vielen Dank
Antwort1
Anstatt der vergrößerten Linealbreite würde ich den linken Rand vergrößern und die Zahl dort platzieren.
\documentclass[12pt]{article}
\usepackage[many]{tcolorbox}
\usepackage[%
margin=2cm,
includefoot,
bottom=2.55cm,
top=2.025cm,
headsep=0.5cm,
footskip=0.65cm
]{geometry}
\definecolor{myblue}{RGB}{0,46,142}
\newtcolorbox[auto counter]{mytheorem}[1][]{%
enhanced jigsaw,
colback=white,
colframe=myblue,
coltitle=myblue,
fonttitle=\bfseries,
sharp corners,
detach title,
enlarge left by=18mm,
width=\linewidth-18mm,
underlay unbroken and first={%
\node[above,text=myblue,font=\bfseries,align=center] at ([xshift=-.5\textwidth,yshift=-7mm]interior.north) {\thetcbcounter};
},
breakable,
pad at break=1mm,
#1,
code={\ifdefempty{\tcbtitletext}{}{\tcbset{before upper={\tcbtitle\par\medskip}}}},
}
\begin{document}\raggedright
\begin{mytheorem}[title=Important Note]
Important content. A body remains in a state of rest or continuous uniform motion unless acted on by an unbalanced external force.
\begin{align*}
45x^2-4x & =75x
\end{align*}
\end{mytheorem}
\end{document}