Nowadays websites show inline computer-code/files in a nice fancy way, with a background color, and rounded box around it, see e.g. the example below.

How can I reproduce this in Latex?


Link of the screenshot below.

enter image description here

  • I think you might find this post helpful tex.stackexchange.com/questions/236608/…, except for the text-colour and line around the box it seems to do what you are asking.
    – Tina
    Apr 11, 2017 at 13:00
  • Would the box have to be able to break at the end of lines?
    – Bernard
    Apr 11, 2017 at 17:43

1 Answer 1


You can try with a tcbox



    tcbox raise base, nobeforeafter, 
    enhanced, colframe=gray,
    colback=gray!30, boxrule=1pt,


the \code{parent} section of the POM. The \code[colupper=red!70!black]{spring-boot-starter-parent} is a special \dots \code[colupper=blue!70]{dependency-management} section


enter image description here

You must log in to answer this question.

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