TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The \framebox command aligns its contents vertically centered, but this has a tendency to produce results that are extremely visually displeasing. Case in point:

% Double box just to make things clearer  
\begin{document} \noindent  
\DoubleBox{I think this is visually displeasing} \par\noindent  
\DoubleBox{\raisebox{0pt}[9pt]{I think this is an ugly hack}} \par\noindent  
\DoubleBox{\larger\raisebox{0pt}[9pt]{And said hack doesn't work for larger text}}  

Is there a way to fix this that "just works" so things look right at all sizes?

share|improve this question
What do you mean by "visually displeasing"? Of course a boldface doubly framed text is visually displeasing :), but maybe you mean something else. Did you try \strut in the argument of \DoubleBox? – egreg Sep 12 '11 at 15:12
I meant the vertical alignment of the text. It looks to me like the text is placed "too high" in the box. – kahen Sep 12 '11 at 15:13
up vote 2 down vote accepted

There are two ways of solving the problem (assuming it is a problem to begin with).

The first one is to "normalize" the height and depth via \strut:


Alternatively, you might ignore the depth:

\usepackage{amsmath} % for optional argument to `\smash`
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.