# Get a box with zero depth including some text

How to get a box including some text in text mode, which depth 0pt?

-
Can you give a more precise question to adapt my answer? What you want to do exactly with your text ? – Alain Matthes Apr 25 '11 at 6:53
@Altermundus I want the M.S.'s answer! Thanks you too! – Stufazi Hoqckt Apr 25 '11 at 8:30
@M.S. No problem! – Stufazi Hoqckt Apr 25 '11 at 8:31
"at" replies are only seen by the addressee if you use the first few characters of the username. So "@Martin" or "@MartinScharrer" will get noticed but not "@M.S." – Matthew Leingang Apr 25 '11 at 11:34
@ Matthew, I got it. – Stufazi Hoqckt Apr 25 '11 at 11:37

You can use \raisebox to modify the official height and depth of some text:

\raisebox{0pt}[\height][0pt]{<text>}


This raises the text by 0pt (so not at all), keeps the official height identical to the original height and sets the depth to 0pt.

-
 @M.S.That is exactly what I want! Thank you. – Stufazi Hoqckt Apr 25 '11 at 8:54

\smash{great} is a box with zero height and no depth

-
@Herbert But if I use \smash{a} in text mode, the letter a turned a math italic shape. – Stufazi Hoqckt Apr 25 '11 at 8:53
no, that is not possible, only inside math you'll get an italic a. – Herbert Apr 25 '11 at 9:18
@Herbert: With amsmath you can also say \smash[b]{g} to get zero depth and unmodified height (there's also \smash[t]{...}. – egreg Apr 25 '11 at 10:03
@Herbert Ehh, I just put the \smash in \DeclareMathOperator, that is, \DeclareMathOperator*{\Sup}{su\smash{p}} and use $\Sup$. While \DeclareMathOperator*{\Sup}{su\raisebox[0pt]{\height][0pt]{p}} is good. – Stufazi Hoqckt Apr 25 '11 at 11:33
@egred: I know ... there is also a [bt]. But this is not the problem here ... – Herbert Apr 25 '11 at 13:20
\newbox\mybox

But If you put some text in your initial \hbox, you can have some strange results ! When you make a box with some contents, height, depth and width depend of the context.