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.

In TeXBook, exercise 9.6 Knuth asks to type Pal Erdos with needed accents in \tt font.

So I've tried the naive {\tt P\'al Erd\H os} and succeed. But Knuth proposes to use the next mixup of fonts:

{\tt P\'al Erd{\bf\H{\tt o}}s}

It seems like an interesting technique, as it allows to catch accents from other fonts. But it strange that the code was not succeed, as I received accent \H and o separate from eacha other. It seems like they were not bound.

How to apply Knuth's technique?

share|improve this question
    
You shouldn't tag your questions with "plain-tex" when they involve LaTeX. –  egreg Jul 10 '11 at 12:46
    
@egreg -- where does the question say anything about latex? since a texbook exercise is cited explicitly, i believe the poster's tagging of "plain-tex" was justified. for a plain tex answer, i believe this can be done with some \expandafters, but i have to experiment first to figure out how many and where. –  barbara beeton Jul 10 '11 at 13:23
    
@barbara There is at least one other message by the OP that has the same problem. Since the present code works perfectly in Plain TeX, the only cause for failure is its use in LaTeX. –  egreg Jul 10 '11 at 13:45
    
@egreg -- i stand corrected. thanks. –  barbara beeton Jul 10 '11 at 15:07
add comment

1 Answer

up vote 3 down vote accepted

The commands \tt and \bf shouldn't be used in LaTeX any more, they are present only for back compatibility.

The following input works without any special trick

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\begin{document}
\texttt{P\'al Erd\H{o}s}
\end{document}

since T1 encoded fonts are used, which have a richer supply of accents and accented characters than OT1 encoded fonts.

share|improve this answer
    
egreg: Thanks egreg. How to mix accents from different fonts in LaTeX? –  outmind Jul 11 '11 at 9:15
add comment

Your Answer

 
discard

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.