LaTeX Templates New Box 3

\documentclass[12pt,a4paper]{article}
\usepackage{fontawesome}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\newtcolorbox[auto counter]{theorem}{%
 empty,
 sharp corners,
 enhanced,
 attach boxed title to top center,
 boxed title style={%
 empty,
 left=0pt,
 right=0pt,
 },
 underlay boxed title={%
 \fill[fill=magenta](title.north west)--(title.south west)--([xshift=-4ex]title.south west)--([xshift=-4ex]title.north west);
 \path([xshift=-2ex,yshift=-0.25ex]title.west) node[inner sep=0pt,text=white]{\faThumbTack};
 \fill[fill=magenta](title.north east)--(title.south east)--([xshift=4ex]title.south east)--([xshift=4ex]title.north east);
 \path([xshift=2ex,yshift=-0.25ex]title.east) node[inner sep=0pt,text=white]{\faThumbTack};
 \draw[draw=magenta,line width=1.4pt]([xshift=-4ex]title.north west)--([xshift=4ex]title.north east);
 },
 colframe=magenta,
 colback=magenta!15,
 coltitle=magenta,
 fonttitle=\scshape,
 title={Theorem~\thetcbcounter},
}
\begin{document}
\begin{theorem}
 This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. This is just a sample sentence. 
\end{theorem}
\end{document}

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *