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.

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

Zero

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

\documentclass{scrartcl}
\usepackage{txfonts}
\pagestyle{empty}

\begin{document}
  \texttt{0}
\end{document}
share|improve this question
add comment

1 Answer

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:

\documentclass{article}
\usepackage{txfonts}

\DeclareFontFamily{T1}{scmtt}{\hyphenchar\font-1 }
\DeclareFontShape{T1}{scmtt}{m}{n}{
        <-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 }
\DeclareFontShape{OT1}{scmtt}{m}{n}{
        <-9>    [1.01782] cmtt8
        <9-10>  [1.01782] cmtt9
        <10-12> [1.01782] cmtt10
        <12->   [1.01782] cmtt12
      }{}
\renewcommand{\ttdefault}{scmtt}

\begin{document}
0\ttfamily 0
\end{document}

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
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.