I want to DIY a environment like the tcolorbox stye:

enter image description here

and I read the docs of tcolorbox and find this:

    \begin{docTcbKey}[][doc new=2014-11-28]{no recording}{}{}
  Disables \refCom{tcbrecord} and \refKey{/tcb/record} inside the current

and the docTcbkey is define as \tcbmakedocSubKey{docTcbKey}{tcb}

but the doctcbkey is write latex3:

    \NewDocumentCommand \tcbmakedocSubKey { m m }
    \NewDocumentEnvironment{#1}{ O{} +O{} m m +m }
        \__tcobox_doc_entry_end:n { key }

it is complex, it is more easy to design a new tcolorbox environment and I want to make a key like this: enter image description here

  1. first replace /tcb withtcb 2.then the delimiter / with _
  2. then last number `123`` can be changed to any number that can be filled
  3. the right side is with other text
  4. here is the template : change the /tcb/vig/south to SYS_VIG_123

2 Answers 2


The simple one!


\colorbox{blue!10}{Put your text}
  • 2
    Well sure, you can use a butter knife to cut down a tree, buck up into rounds and then split them into firewood, sure...
    – Werner
    Mar 4, 2021 at 16:03
  • Would you share us the best way? So, that we can learn. Actually, I've difficulties to use \linenumbers, along with \colorlet{shadecolor}.
    – Jae H
    Mar 5, 2021 at 9:48

    boxrule=0pt, attach title to upper={\hfill},
    fonttitle=\ttfamily, coltitle=purple,title=#2,#1]#3\end{tcolorbox}}
\mykey{Some text}{More text}

\mykey[colback=cyan!30, coltitle=blue!70!black]{Some text}{More text}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .