Mise à niveau vers Pro

tcolorbox styles latex

Latex templates for maths | قوالب اللاتك للرياضيات
#latex #templates
Credit : By متعلم لاتاك | FB : facebook.com/profile.php?id=100052678591256

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[most]{tcolorbox}
\usepackage{lipsum,lmodern}

\newcounter{myboxcounter}

\tcbset{
myboxstyle/.style={
enhanced, breakable,
sharp corners,
left skip=8mm,
attach boxed title to top left={yshift*=-\tcboxedtitleheight/2},
boxed title style={colframe=#1!40, height=6mm, bean arc, boxrule=1pt},
colback=#1!10, colframe=#1!30, boxrule=1pt,
coltitle=black, colbacktitle=#1!10,
fonttitle=\bfseries,
underlay boxed title={%
\node[circle, fill=#1!10, draw=#1!40, inner sep=1pt, minimum size=6mm, line width=1pt, font=\bfseries] (boxnumber) at ([xshift=-6mm]title.west) {\thetcbcounter};
},
underlay unbroken={%
\draw[#1!40, line width=1pt] (title.west)--(boxnumber);
\draw[#1!40, -{stealth}, line width=1pt] (boxnumber)--(boxnumber|-frame.south);
},
underlay first={%
\draw[#1!40, line width=1pt] (title.west)--(boxnumber);
\draw[#1!40, line width=1pt] (boxnumber)--(boxnumber|-frame.south);
},
underlay middle={%
\draw[#1!40, line width=1pt] (boxnumber|-frame.north)--(boxnumber|-frame.south);
},
underlay last={%
\draw[#1!40, -{stealth}, line width=1pt] (boxnumber|-frame.north)--(boxnumber|-frame.south);
},
}
}

\newtcolorbox[use counter=myboxcounter]{example}[2][]{%
myboxstyle=#2, title=Example, #1
}

\newtcolorbox[use counter=myboxcounter]{solution}[2][]{%
myboxstyle=#2, title=Solution, #1
}

\begin{document}

\lipsum[1]

\begin{example}{blue}
\lipsum[1][1-2]
\end{example}

\begin{solution}{red}
\lipsum[2]
\end{solution}

\begin{example}{green}
\lipsum[3-7]
\end{example}

\begin{solution}{yellow}
\lipsum[1-5]
\end{solution}

\end{document}
tcolorbox styles latex Latex templates for maths | قوالب اللاتك للرياضيات #latex #templates Credit : By متعلم لاتاك | FB : facebook.com/profile.php?id=100052678591256 \documentclass{article} \usepackage[margin=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage[most]{tcolorbox} \usepackage{lipsum,lmodern} \newcounter{myboxcounter} \tcbset{ myboxstyle/.style={ enhanced, breakable, sharp corners, left skip=8mm, attach boxed title to top left={yshift*=-\tcboxedtitleheight/2}, boxed title style={colframe=#1!40, height=6mm, bean arc, boxrule=1pt}, colback=#1!10, colframe=#1!30, boxrule=1pt, coltitle=black, colbacktitle=#1!10, fonttitle=\bfseries, underlay boxed title={% \node[circle, fill=#1!10, draw=#1!40, inner sep=1pt, minimum size=6mm, line width=1pt, font=\bfseries] (boxnumber) at ([xshift=-6mm]title.west) {\thetcbcounter}; }, underlay unbroken={% \draw[#1!40, line width=1pt] (title.west)--(boxnumber); \draw[#1!40, -{stealth}, line width=1pt] (boxnumber)--(boxnumber|-frame.south); }, underlay first={% \draw[#1!40, line width=1pt] (title.west)--(boxnumber); \draw[#1!40, line width=1pt] (boxnumber)--(boxnumber|-frame.south); }, underlay middle={% \draw[#1!40, line width=1pt] (boxnumber|-frame.north)--(boxnumber|-frame.south); }, underlay last={% \draw[#1!40, -{stealth}, line width=1pt] (boxnumber|-frame.north)--(boxnumber|-frame.south); }, } } \newtcolorbox[use counter=myboxcounter]{example}[2][]{% myboxstyle=#2, title=Example, #1 } \newtcolorbox[use counter=myboxcounter]{solution}[2][]{% myboxstyle=#2, title=Solution, #1 } \begin{document} \lipsum[1] \begin{example}{blue} \lipsum[1][1-2] \end{example} \begin{solution}{red} \lipsum[2] \end{solution} \begin{example}{green} \lipsum[3-7] \end{example} \begin{solution}{yellow} \lipsum[1-5] \end{solution} \end{document}
·416 Vue