Guest User

Untitled

a guest
Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. % You should include tcolorbox libraries adn raster, with:
  2. % \usepackage[raster]{tcolorbox}
  3. % Also define your own colors or use from xcolor
  4.  
  5. % Usage is dead simple: \badge{color_and_verb}{relative_path}
  6. % The name of the color is used as left part text! You should define aliases, like:
  7. % \definecolor{POST}{HTML}{97CA00}
  8. % \definecolor{GET}{HTML}{007EC6}
  9. % \definecolor{PUT}{HTML}{DFB317}
  10. % \definecolor{PATCH}{HTML}{9F9F9F}
  11. % \definecolor{DELETE}{HTML}{E05D44}
  12. % Example (Using those aliases): \badge{POST}{/api/developers}
  13.  
  14. \newcommand{\badge}[2] {
  15. \begin{tcbraster}[raster columns=12,fonttitle=\bfseries]
  16. \begin{tcolorbox}[
  17. raster multicolumn=2,
  18. colupper=white,
  19. halign=flush center,
  20. sharp corners=east,
  21. colback=#1,
  22. size=small,
  23. colframe=black!0
  24. ]\strut #1\end{tcolorbox}\begin{tcolorbox}[
  25. raster multicolumn=10,
  26. enlarge left by=-3mm,
  27. colupper=white,
  28. sharp corners=west,
  29. colback=darkgray,
  30. size=small,
  31. colframe=black!0
  32. ]\strut #2\end{tcolorbox}
  33. \end{tcbraster}
  34. }
Add Comment
Please, Sign In to add comment