\code{test code}\\


This is working good on sharelatex.com and looks like I expect and want it: enter image description here

but on my local project using this command gives me this: enter image description here

any idea what could be causing this colorbox height going to the next line?

  • 1
    Well, why are you not posting the local project content then?
    – user31729
    Jan 22, 2018 at 14:07
  • Do you mean that the depth is too big? So that you want letters like g, p and q to be treated different than l, h, t which expand to top rather than bottom?
    – TeXnician
    Jan 22, 2018 at 14:09
  • 3
    Try code example also on ShareLaTeX and you'll see the same effect (due to the descender of p).
    – egreg
    Jan 22, 2018 at 14:11

1 Answer 1


The difference is due to the fact that test code has no descender, whereas example has.




\code{test code} \code{example code}\\
C\# test \& this

\code{example code} \code{test code}\\
C\# test \& this


enter image description here


You must log in to answer this question.

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