A LaTeX package: mathastext
Copyright © 2011-2019, 2022-2025 Jean-François B..
Current version is 1.4e (2024/10/26)
mathastext.sty,
mathastext.dtx,
repository
(README,
Change log,
issue tracker),
showcase page,
special example,
CTAN page.
This Work may be distributed and/or modified under the conditions of the The LaTeX Project Public License 1.3c.
The package originates in some (even worse) macros I had been using many years ago to produce handouts as if done on a typewriter, or better said, to produce documents with a somewhat rough, but unified look, done by a real human and meaning to convey some message to real humans. The hope was to coerce the reader into making a real effort at assimilating the entirety of the material, text and math, not knowing in advance which piece would prove to be more important than the others.
\usepackage[T1]{fontenc} \usepackage[german]{babel} \usepackage[variablett]{lmodern} \renewcommand\familydefault\ttdefault \usepackage[LGRgreek]{mathastext} \MTgreekfont{lmtt}\Mathastext
In a well-crafted mathematical document, every single part is as important as any other one, or, rather, it is up to the reader to uncover the web of links between atoms.
The example above uses a typewriter font which well illustrates the purpose. But mathastext will work with all kinds of fonts and can produce less militant math: see the examples (be patient, this page with its embedded png images weighs circa 5 Mo!) A notable feature of mathastext is to give a simple interface to using many distinct math fonts in the same document: special example.
Optimal typographical results for documents containing mathematical symbols can only be hoped for with math fonts specifically designed to match a given text typeface. Although the list of freely available math fonts for (PDF)LaTeX is slowly expanding (Computer Modern, AMS fonts, PX fonts, TX fonts, Fourier-GUTenberg, Math Design, Kepler Project, newtx, mathabx, others ... ; and ([2012/10/27]) on the Unicode side (XeTeX/LuaTeX): Asana-Math, XITS, Latin Modern Math, TeX Gyre Pagella Math, TeX Gyre Termes Math) it remains limited. Chances are you will not find a math font which fits well with your favorite text font.
Try out mathastext: it will simply use the text font also for the math! (additionally to Latin letters, digits, punctuation signs, a few math symbols available in the ascii set, such as +,–,<,>,=, will also be picked up from the text font.) Often this gives quite satisfying results especially if, like the author, you aim at a very unified look for the document, and in particular prefer upright to slanted shapes for math (mathastext does have an option to maintain the usual slanted shape).
Examples. These examples were last updated around 2012; dated warning: be patient, the page with its embedded png images weighs circa 5 Mo! (wow...) It contains about 70 examples, as png images and/or as pdf files.
Special example always worth reading.
lgrmath (use
LGR
-encoded fonts in math mode)
libgreek (Greek letters in math mode from Libertinus or Linux Libertine/Biolinum)
The original version of this package (2011/03/14) used the support files of the libertine LaTeX font package (which made Linux Libertine usable via pdfLaTeX). It got broken at the time of a 2018 release of libertine when the libertine-legacy got moved to the obsolete section of CTAN, and thus stopped being distributed by TeXLive (and presumably MikTeX).
The current version, 1.1 of 2022/11/11, uses the LGR-encoded font
files from the libertinus-type1
package by Bob Tennent which gives an interface for pdfLaTeX users to
the Libertinus
OpenType fonts. For perfect backwards compatibility, if executed on a
LaTeX system where libertine-legacy is
still installed, libgreek
will use it. Else (or if mandated by the libertinus
option)
it uses the font definition files from libertinus-type1.
In this context, note that libertinust1math by
Michael Sharpe provides complete math support to pdfLaTeX to use the
OpenType math part of Libertinus. But then
the simplest is for the document text to also use Libertinus via libertinus-type1 and
you presumably don't need mathastext
!