4

I want to use two different monospaced fonts in one and the same document.

However, when I write \texttt{The quick brown fox jumps over the lazy dog} using \usepackage{courier}, I can get figure 2 but cannot get figure 1.

In contrast, when I write \texttt{The quick brown fox jumps over the lazy dog} using \usepackage{newtxtext}, I can get figure 1 but cannot get figure 2.

So, how to generate the two figures in the same article?

Figure 1:

Figure 1

Figure 2:

Figure 2

2
  • Just to clarify: You want to be able to use two different monospaced fonts in one and the same document?
    – Mico
    May 11, 2014 at 5:27
  • @Mico Yes, thanks for the clear description.
    – Lijie Xu
    May 11, 2014 at 5:44

1 Answer 1

3

Here it is, although it's not really clear why you want this:

\documentclass{article}
\usepackage{newtxtext}

\DeclareRobustCommand\crfamily{\fontfamily{pcr}\selectfont}
\DeclareTextFontCommand{\textcr}{\crfamily}

\begin{document}

\texttt{The quick brown fox jumps over the lazy dog}

\textcr{The quick brown fox jumps over the lazy dog}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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