How Do You Handle Font Discrepancies Between Math and Text in LaTeX?

  • Context: LaTeX 
  • Thread starter Thread starter DrDu
  • Start date Start date
  • Tags Tags
    Latex Text
Click For Summary
SUMMARY

This discussion addresses the issue of font discrepancies between text and math modes in LaTeX, particularly when using plain LaTeX. Users recommend packages such as times with txfonts and charter with mathdesign to achieve font consistency. The conversation highlights the use of commands like \textsubscript{} and \textsuperscript{} for subscripts and superscripts outside math mode, as well as \mathrm{} and \mbox{} for normal text within math mode. The importance of maintaining a harmonious appearance in documents is emphasized, along with the flexibility to override default math fonts using existing packages.

PREREQUISITES
  • Familiarity with LaTeX document preparation system
  • Understanding of LaTeX packages such as txfonts and mathdesign
  • Knowledge of text and math mode distinctions in LaTeX
  • Basic command usage in LaTeX, including \textsubscript{} and \mathrm{}
NEXT STEPS
  • Explore the txfonts package for font customization in LaTeX
  • Research the mathdesign package for alternative math fonts
  • Learn how to create custom commands in LaTeX for frequently used text formatting
  • Investigate the process of converting LaTeX documents to RTF using latex2rtf
USEFUL FOR

LaTeX users, academic writers, and researchers who need to ensure consistent font usage between text and math modes in their documents.

DrDu
Science Advisor
Messages
6,423
Reaction score
1,004
I've been using Latex for many years now. But there is a feature which I feel more and more uneasy about: At least in plain latex you are supposed to do subscripts, minus signs, in math mode, even when writing a simple number with exponent in text mode. Another example would be expressions like "α-particle". However, latex uses different fonts for math and text, which produces quite ugly results.
I know that there are packages like comptex etc. which provide some commands for text mode.
My main reason I want to avoid using math mode is that I am working now on a field where latex is not very common for publications and not all publishers (or colleagues) accept it. So I want to be able to convert a file into rtf with latex2rtf in case of emergency.

What are your favourite solutions to this problem?
 
Physics news on Phys.org
I match the text and math fonts by using

% For Times
\usepackage{times}
\usepackage{txfonts}

or

% For Charter
\usepackage{charter}
\usepackage[charter]{mathdesign}

(More options "ftp://tug.ctan.org/pub/tex-archive/info/Free_Math_Font_Survey/survey.html"[/URL].)
 
Last edited by a moderator:
DrDu said:
At least in plain latex you are supposed to do subscripts, minus signs, in math mode, even when writing a simple number with exponent in text mode.

You can use \textsubscript{} and \textsuperscript{} outside math mode. If you use them a lot, make your own shorter names for them.

Or you can use \mathrm{} or \mbox{} to get "normal" text inside math mode.

Arguably math minus signs $-$, em dashes -- and en dashes --- should be three different glyphs, but nobody is going to arrest you for font violation if you think otherwise.

The whole point of LaTeX is to separate the content of the document from the details of its appearance. In genuinely "plan latex" you would be using Knuth's Computer Modern fonts for the text so everything will look harmonious (but not necessarily pretty, unless you really like the CMR fonts). If you want to override the math fonts, you can do that with many existing packages, or you can do it yourself. To find out how, use an existing package (e.g. file txfonts.sty) as an example, and find out what the commands do if you can't guess.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
42K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 5 ·
Replies
5
Views
8K