TeX - LaTeX Asked by Thaqib Damani 2.0 on October 11, 2020
I am trying but I am just unable to get this kind of box.
newtcolorbox{defn}[1][]{
width=textwidth,
colback=white!20,
colframe=blue!75!blue,
colbacktitle=blue!85!blue,
fonttitle=bfseries,
left=2ex,
right=2ex,
top=2pt,
arc=2pt,
outer arc=0pt,
leftrule=1pt,
rightrule=1pt,
toprule=1pt,
bottomrule=1pt,
breakable,
enhanced jigsaw,
title= #1}
Using newtcbtheorem
in combination with a boxed title, you can achieve the following output in which the boxes are numbered automatically. You can also use the usual label-ref-mechanism on these boxes.
I have also tried to simplify the other options by summarizing leftrule=1pt, rightrule=1pt, toprule=1pt,bottomrule=1pt,
to boxrule=1pt
. I have also replaced the corner related options with sharp corners
since the corners in your example image seemed to nor be rounded. If you prefer the slightly rounded look, you can easily revert the changes.
documentclass{article}
usepackage[most]{tcolorbox}
newtcbtheorem{defn}{Definition}{
width=textwidth,
colback=white!20,
colframe=orange,
colbacktitle=orange,
fonttitle=bfseries,
sharp corners,
boxrule=1pt,
breakable,
enhanced,
boxed title style={sharp corners},
attach boxed title to top left
}{def}
begin{document}
begin{defn}{box title}{label}
contents
end{defn}
ref{def:label}
end{document}
Correct answer by leandriis on October 11, 2020
Here is an example on how you can reproduce the image using tcolorbox
.
documentclass{article}
usepackage{tikz,lipsum,lmodern}
usepackage[most]{tcolorbox}
usepackage{xcolor}
%
definecolor{newcolor}{RGB}{246,164,4} %
begin{document}
begin{tcolorbox}[enhanced,title=Definition 1: Set,
colframe=newcolor,arc=0mm, fonttitle=bfseries,coltitle=white,
attach boxed title to top left={xshift=0.mm,yshift=-0.50mm},
boxed title style={skin=enhancedfirst jigsaw,size=small,arc=0mm,bottom=0mm,
interior style={fill=newcolor}}]
begin{itemize}
item[$bullet$] A emph{set} is a collection of object.
item[$bullet$] These objects are called emph{elements} of the set.
item[$bullet$] If $A$ is a set and $x$ is an element of $A$, write $xin A$.
item[$bullet$] If $x$ is not an element of $A$, write $Anotin A$.
end{itemize}
end{tcolorbox}
end{document}
Answered by Tanvir on October 11, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP