I'm working with tcolorbox
, I saw the pdf here and I want to reproduce the little green box in this image:
Can anyone help me please?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI'm working with tcolorbox
, I saw the pdf here and I want to reproduce the little green box in this image:
Can anyone help me please?
This is a \newtcbox
called mylib
and defined in tcolorbox.tex
:
\documentclass{article}
\usepackage[many]{tcolorbox}
\newtcbox{\mylib}{enhanced,nobeforeafter,tcbox raise base,boxrule=0.4pt,top=0mm,bottom=0mm,
right=0mm,left=4mm,arc=1pt,boxsep=2pt,before upper={\vphantom{dlg}},
colframe=green!50!black,coltext=green!25!black,colback=green!10!white,
overlay={\begin{tcbclipinterior}\fill[green!75!blue!50!white] (frame.south west)
rectangle node[text=white,font=\sffamily\bfseries\tiny,rotate=90] {LIB} ([xshift=4mm]frame.north west);\end{tcbclipinterior}}}
\begin{document}
\mylib{test}
\end{document}
tcolorbox.doc.s_main.sty
of the package files (downloaded from CTAN), at line 243. I've been searching it too, thanks for the answer !
Mar 25, 2020 at 7:29
This pice of code also works with the \tikzexternalize
flag.
\documentclass{standalone}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{lipsum}
\newcommand{\mylib}[1]{
\tikz[baseline=-0.5ex]{
\tikzset{lib/.style={
rectangle split,
rectangle split parts=2,
rectangle split horizontal,
rectangle split part fill={green!75!blue!50!white,green!10!white},
rectangle split draw splits=false,
rounded corners=2pt,
rectangle split part align={right,right},
draw=green!50!black,
minimum height=16pt}
}
\node[lib] (var){
\nodepart[text=green!25!black]{two}#1};
\node[text=white,font=\sffamily\bfseries\tiny,rotate=90] at ([xshift=6pt]var.west) {LIB};
}
}
\begin{document}
\mylib{test}
\mylib{v}
\mylib{longvar}
\end{document}