Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
How do I create an invisible character?

How can I insert an invisible character (similar to \strut) which has a width of zero (won't impact word or letter spacing) and has a height equal to the height of an uppercase letter in currently selected font?

share|improve this question

marked as duplicate by Jake, Torbjørn T., Leo Liu, Seamus, Werner Dec 22 '11 at 5:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    

1 Answer 1

up vote 8 down vote accepted

You can use \vphantom{<some uppercase letter>} for this:

\documentclass{article}
\begin{document}
\begin{minipage}{1cm}
\fbox{aaaa}\fbox{aaAa}\fbox{aaaa}
\fbox{aaaa}\fbox{aaAa}\fbox{aaaa\vphantom{A}}
\end{minipage}
\end{document}
share|improve this answer
    
Does TeX have no way of knowing the general height of all of the uppercase letters? E.g. a built-in measurement? –  Village Dec 21 '11 at 1:47
    
@Village: No, that size is not directly available. See Determine height and depth of letters relative to the font size for more information on this. –  Jake Dec 21 '11 at 2:09
    
You could construct this as a simple macro for easy reuse. You'd have to put all the capital letters into the \vphantom, but only once. Perhaps there's even a way of simplifying that down. –  qubyte Dec 21 '11 at 2:57
1  
@Village: You could use \vphantom{ABCDEFGHIJKLMNOPQRSTUVXYZ} to ensure that take the maximum height of any uppercase character. The height is about 1.6ex, so \vrule height 1.6ex depth 0pt width 0pt would also work. See also Definition of \strut explained –  Martin Scharrer Dec 21 '11 at 9:52

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