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.

What I can tell, the font you get, it looks like the standard, "bookish" font, only tilted. How can I get a monospace font with a straight spine, e.g., the font you get with texttt?

I'm happy with everything else, including the interface, so, when set up, I don't want to invoke this in any other way than the standard $ ... $ dance.

share|improve this question
add comment

4 Answers

You could put

\DeclareSymbolFont{letters}{OT1}{cmtt}{m}{n}

in the preamble of your document. Though I'm not certain why you would want to use this as the default math font. Also, by making this declaration some symbols get rendered incorrectly:

\documentclass{article}
\usepackage{amsmath,amssymb}
\DeclareSymbolFont{letters}{OT1}{cmtt}{m}{n}

\begin{document}
Hello world:
\[
    x^2 + y^2 = \tan(\theta)
\]
\end{document}

which gets rendered as:

enter image description here

There is another approach. But it requires a bit more work.

First, declare a symbol font name

\DeclareFontSubstitution{OT1}{cmtt}{m}{n}
\DeclareSymbolFont{myletters}{OT1}{cmtt}{m}{n}
\DeclareSymbolFontAlphabet{\mathnormal}{myletters}

But this is not sufficient to enact the changes you want. Now you've got to go through for every symbol you want set in this style and declare it:

\DeclareMathSymbol{a}{\mathalpha}{myletters}{`a}
\DeclareMathSymbol{b}{\mathalpha}{myletters}{`b}
\DeclareMathSymbol{c}{\mathalpha}{myletters}{`c}
\DeclareMathSymbol{d}{\mathalpha}{myletters}{`d}
\DeclareMathSymbol{e}{\mathalpha}{myletters}{`e}

etc., and then

\DeclareMathSymbol{A}{\mathalpha}{myletters}{`A}
\DeclareMathSymbol{B}{\mathalpha}{myletters}{`B}
\DeclareMathSymbol{C}{\mathalpha}{myletters}{`C}
\DeclareMathSymbol{D}{\mathalpha}{myletters}{`D}
\DeclareMathSymbol{E}{\mathalpha}{myletters}{`E}

etc. It's a lot of work. You'll be losing a lot work others have already done.

At this point, I find my answer bordering on the questionable. For example, even in the original solution I posted \tan got type-set in the usual default font, and none of the changes I'm suggesting above seem to change that.

share|improve this answer
    
I don't like the tilted bookish font, nothin' more advanced as that. –  Emanuel Berg Dec 13 '12 at 3:35
add comment

The mathastext package might meet your needs. The package will give you, by default, an upright roman font for math material, but otherwise it may do exactly what you're looking for.

The following MWE illustrates the package's default behavior:

\documentclass{article}
\usepackage{mathastext}
\begin{document}
Hello, Pythagoras. $a^2 + b^2 = c^2$. Goodbye, mathematics.
\end{document}

enter image description here

share|improve this answer
add comment

To get a typewriter font for the letters, digits, and a few symbols in math mode, you can use mathastext as advised in Mico's answer, with some additional set-up:

\documentclass{article}
\usepackage{mathastext}
\MTfamily{\ttdefault}\Mathastext % this tells mathastext to use typewriter
\begin{document}
Hello, Pythagoras. $a^2 + b^2 = c^2$. Goodbye, mathematics.
\end{document}

mathastext tt

share|improve this answer
    
option defaultmathsizes would tell mathastext to use the standard choices of sizes for sub and sub-sub-scriptstyle. –  jfbu Mar 11 at 12:39
add comment

You can also take a look at this font survey for (La)TeX: http://mirror.ctan.org/info/Free_Math_Font_Survey/survey.html

There you will find a lot of math (and text) fonts. Maybe some of them will suit your needs.

share|improve this answer
    
please don't give direct links like that; we're trying to distribute ctan's load. the “correct” address for that file is http://mirror.ctan.org/info/Free_Math_Font_Survey/survey.html –  wasteofspace Mar 11 at 15:32
    
I think this list should be kept up to date. –  marczellm Mar 11 at 15:54
    
thanks wasteofspace, I fixed it. –  Alexis Mar 11 at 20:31
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.