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

Is it possible to tweak the teletype fonts of txfonts so that the "zero symbol" 0 does not have the rather 1980-style stroke?


Perhaps a replacement glyph has been specified by the font? Using newtxtext is not an option at the moment.


share|improve this question
up vote 3 down vote accepted

Short of changing the typewriter type font I don't see any way out, as there's no option for changing the 0 to a nonslashed form.

You can revert to the standard CMTT fonts, scaled to be the same height as the txtt fonts:


\DeclareFontFamily{T1}{scmtt}{\hyphenchar\font-1 }
        <-9>    [1.01782] ectt0800
        <9-10>  [1.01782] ectt0900
        <10-12> [1.01782] ectt1000
        <12-17> [1.01782] ectt1200
        <17->   [1.01782] ectt1728
\DeclareFontFamily{OT1}{scmtt}{\hyphenchar\font-1 }
        <-9>    [1.01782] cmtt8
        <9-10>  [1.01782] cmtt9
        <10-12> [1.01782] cmtt10
        <12->   [1.01782] cmtt12

0\ttfamily 0

The scaling factor has been determined by comparing the two fonts.

enter image description here

Here's a comparison: above the (scaled) CMTT, below the original TXTT font (the first ABCdef012 is in the TX font)

enter image description here

share|improve this answer
What does this mean for the output encoding? – krlmlr Sep 4 '12 at 9:22
@user946850 Sorry, I don't get it. I've added definitions both for OT1 and T1 encoding, modelled on the standard ones. – egreg Sep 4 '12 at 9:38
Well, this might be to my weak understanding of output encoding issues. I see that your code handles an OT1 and a T1 case, so I guess everything's fine on that front. – krlmlr Sep 4 '12 at 11:54

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.