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

I'm documenting a class with (ltx)doc. The macro names are quite long so I get a lot of overfull hboxes.

AFAIK latin modern has an additional typewriter font which is condensed. How do I switch the doc package to use that? I'd prefer a solution for pdflatex.

share|improve this question
As far as I can see it, the condensed typewriter font only comes in a light weight, which does not mix well with LMRoman in the medium weight. – Michael Ummels Jul 5 '11 at 16:03
up vote 8 down vote accepted

Write this in the preamble of your document

\DeclareFontFamily{T1}{lmttc}{\hyphenchar \font-1 }
     {<-> ec-lmtlc10}{}
     {<-> ec-lmtlco10}{}

If you need OT1-encoding, change all T1 into OT1 and ec- into rm-.

With XeLaTeX or LuaLaTeX one can say

\setmonofont[HyphenChar=None]{Latin Modern Mono Light Cond}

and get the same result (loading fontspec, of course).

share|improve this answer
Thanks. Bonus question: How to do this with xelatex/lualatex? – Martin Schröder Jul 5 '11 at 16:26
What did I win? :) – egreg Jul 5 '11 at 16:37
@egreg: Another upvote. ;-) – lockstep Jul 5 '11 at 17:07

Incidentally, you can see the effect of this in the paper I gave at Practical TeX 2006 on document classes: http://tug.org/TUGboat/tb28-1/tb88flynn.pdf

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.