I'm searching for a way to avoid the following layout (image below) where the underscore and the lower case letters get tightened inside the tcbox
: ideally, I'd like the tcbox
to keep a height that would be equal to something like 1em
or 1.2em
in order to keep consistancy across those boxes inside my document.
The box I've got with uppercase letters or digits (see image below) are just nice but my code seems to fit the box to its content rather than to the font's max height inside the current size.
Right now, the code looks like this :
% inline code blocks
\newtcbox{\code}{on line, boxrule=0pt, boxsep=0pt, top=2pt, left=2pt,
bottom=2pt, right=2pt, colback=gray!30, colframe=white,
fontupper={\ttfamily\small}}
I looked up into the tcbox manual but couldn't find the correct parameter to enter (I know it's there somewhere).
Edit (getting close)
Thanks to the commenters :
Adding the \strut
command made the boxes bigger, but now they're too big (probably because of the line spacing, which is mandatory according to my university so I can't change that) : even upper cases and digits get some extra space (see image below)
\strut
suffice? As infontupper={\ttfamily\small\strut}
?\setlength{\fboxsep}{0pt}\colorbox{black!10}{...text...}
is enough, I think so...\mystrut
, where you define\mystrut
the height you want, for example,\newcommand\mystrut{\rule[-3pt]{0pt}{12pt}}
.\newcommand\mystrut{\rule[-1pt]{0pt}{.8em}}