I am trying to make a generic environment to use for all my boxes in my document. I want all my boxes to have line numbers. I can only get this to work some of the time. I don't get line numbers when I use minted content in the box.


\tcbuselibrary{minted, breakable, skins}


        listing only,
                \fill[gray] (frame.south west) rectangle ([xshift=0.25in]frame.north west);

    \begin{mylisting}{Test Line Numbers}



    \begin{mylisting}{Test Minted Line Numbers}

The first usage works, but the second usage with the \mint command does not. What am I missing?

PS - I'm aware that minted can do its own line numbering, but I wanted to handle line numbering in a centralized way, and not everything in a listing will be minted, so I figured the line numbering could be decoupled from minted.

  • 1
    I think that this is purely about interaction between lineno and minted (independent of tcolorbox). I just made some tests and it seems that internallinenumbers has no effect on any minted content. Maybe, someone know how to change that (?) – Thomas F. Sturm Dec 4 '14 at 16:04
  • Interesting. I didn't notice that. Good catch. I wonder if it is just minted, or other similar things too. – Aaron Wright Dec 5 '14 at 3:29
  • @ThomasF.Sturm Any news about this? – egreg Sep 5 '15 at 21:10
  • @egreg No, I don't think so. lineno and minted are not compatible as far as I know. – Thomas F. Sturm Sep 15 '15 at 11:07
  • @ThomasF.Sturm Has anything changed now? – TeXnician Apr 15 '17 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.