Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % You should include tcolorbox libraries adn raster, with:
- % \usepackage[raster]{tcolorbox}
- % Also define your own colors or use from xcolor
- % Usage is dead simple: \badge{color_and_verb}{relative_path}
- % The name of the color is used as left part text! You should define aliases, like:
- % \definecolor{POST}{HTML}{97CA00}
- % \definecolor{GET}{HTML}{007EC6}
- % \definecolor{PUT}{HTML}{DFB317}
- % \definecolor{PATCH}{HTML}{9F9F9F}
- % \definecolor{DELETE}{HTML}{E05D44}
- % Example (Using those aliases): \badge{POST}{/api/developers}
- \newcommand{\badge}[2] {
- \begin{tcbraster}[raster columns=12,fonttitle=\bfseries]
- \begin{tcolorbox}[
- raster multicolumn=2,
- colupper=white,
- halign=flush center,
- sharp corners=east,
- colback=#1,
- size=small,
- colframe=black!0
- ]\strut #1\end{tcolorbox}\begin{tcolorbox}[
- raster multicolumn=10,
- enlarge left by=-3mm,
- colupper=white,
- sharp corners=west,
- colback=darkgray,
- size=small,
- colframe=black!0
- ]\strut #2\end{tcolorbox}
- \end{tcbraster}
- }
Add Comment
Please, Sign In to add comment