I want to place a word into a \tcbox, but the box has too much space around the word. For example, the word "EQUAL".

2 Answers 2


You have several options here: you can use the top, left, bottom, right keys (and perhaps also boxsep) to control the space between text and frame on each of the sides or you could use the size key to get some predefined sizes (the accepted values minimal, tight, fbox, small, title, and normal and their effect are illustrated in my example code):





\foreach \s in {minimal,tight,fbox,small,title,normal} 
\tcbox[size=\s,on line]{EQUAL} 


enter image description here

  • If looked carefully, the top padding of is quite smaller than the bottom padding. To fix this for title size, use \tcbox[size=title,on line,top=3pt]{EQUAL}
    – Ooker
    Dec 10, 2017 at 19:03

If it is only one word inside the box, you may use tikz straight away. Change inner sep values as you wish.

\newcommand{\mybox}[1]{\tikz[baseline={(a.base)}]\node[draw=blue,rounded corners=0.5ex,fill=red!40!white,inner sep=1pt](a){#1};}
  \mybox{hello} my world \mybox{EQUAL}

enter image description here

You must log in to answer this question.

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