0

Code blocks are frequently used in Markdown as shown in the picture below. I am wondering whether there is a way to display the same thing in LaTeX, namely an auto-sized, shaded, rounded-corner box around a word.

Thank you in advance!

enter image description here

  • 1
    Welcome to TeX.SE. This site works best when you start out with some work that we build on. You tagged this with tcolorbox and mdframed. What have you found looking into those packages? Do you have a minimal (almost) working example that we can start with? – Teepeemm May 02 '20 at 12:25
  • 1
    If you don't insist on the rounded corners, you have the very simple \colorbox{somecolour}{contents}. You also can do that with \psframebox from pstricks (rounded cprners withe the option linearc=radius. – Bernard May 02 '20 at 12:32
  • The code from the proposed duplicate might seem a bit complicated, but of course you can define a new command using this code to simplify your input. – Marijn May 02 '20 at 13:50
  • @Marijn Thx Marijin! That's exactly what I am looking for! – Yize Wang May 02 '20 at 16:22

0 Answers0