A LaTeX package: mathastext
Current version is 1.3r (2016/11/06)
 \usepackage[T1]{fontenc} \usepackage[german]{babel} \usepackage[variablett]{lmodern} \renewcommand\familydefault\ttdefault \usepackage[LGRgreek]{mathastext} \MTgreekfont{lmtt}\Mathastext  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). 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. 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 on the side uses a typewriter font which well illustrates the purpose. mathastext will work with all kinds of fonts: showcase page Note that all examples on that page were done with releases of mathastext earlier than 1.3 (2013/09/02). The latter introduced \MTsetmathskips macro which allows fine tuning of the spacing around letters in math mode. This is particularly useful with letters such as f if employed in italic shape. This 1.3 added functionality turned italic option into a really viable alternative with all kinds of fonts. The author prefers upright as seen in the sample on the left. But prevalent normative discourses may incite users to use italic shape for variables in math mode. A notable feature of mathastext is to give a simple interface to using many distinct math fonts in the same document: special example.
 Current version is 1.3r (2016/11/06) README README (html) Showcase page (this page with its embedded png images weighs circa 5 Mo! It contains about 70 examples, as png images and/or as pdf files.) Download from the CTAN portal or the TeX catalogue. PDF Documentation Package file: mathastext.sty Documented source: dtx. Installation: easiest is with mathastext.tds.zip: unzip -d mathastext.tds.zip where foo is the TDS compliant destination folder. or download mathastext.sty and move it to the suitable TDS/source/latex/mathastext/ location (or alternatively to the working repertory of your current project). for customized compilation: all files may get extracted from mathastext.dtx via tex mathastext.dtx. This includes mathastext.sty, some test files (illustrating some package features), and also README.md and mathastext.tex. The latter can customize the global font size or paper dimensions of the pdf documentation: then latex mathastext.tex (thrice) and dvipdfmx mathastext.dvi. It is also possible to run directly pdflatex mathastext.dtx. Move the various files to the correct TDS locations.
• (1.3r) documentation tweaks.
• (1.3q) option unicodeminus.
• (1.3o, 1.3p) patches around LuaLaTeX+luaotfload font issues in math mode.
• (1.3n) improved compatibility with amsmath (use of certain characters with correct font and spacing in declared operator names).
• (1.3m) minor code/doc maintenance.
• (1.3l) compatibility with TL2016 fontspec.
• (1.3k) fixes typos in the documentation.
• (1.3j) stronger subdued mode, newcommand \MTeverymathoff, various minor code changes and documentation improvements.
• (1.3i) patches \url command from packages hyperref.sty and url.sty in order for its preparation of math mode not to be altered by mathastext; stronger subdued mode, no extra skips in operator names or inside a math alphabet scope.
• (1.3h) fixes bugs dating back to 1.3d with options symbolgreek and selfGreek/selfGreeks.
• (1.3g) Latest LaTeX (2015/10/01) removed the "luatex" prefix for the LuaLaTeX Unicode math primitives. Package updated to reflect this, back compatibility with older LaTeX maintained. Nota bene: when used with LuaLaTeX, mathastext needs LuaLaTeX as per TeXLive 2013 (or equivalent) or later.
• (1.3f) Info messages replace Warnings in some cases. Also, self extracting README.md from the dtx file.
• (1.3e) bugfix regarding option nosmalldelims.
• (1.3d) new commands \MTstandardgreek and \MTcustomgreek; subdued mode acts on Greek letters, too, even if package is loaded with one of the Greek related options.
• (1.3c) mechanism of "inheritance" in the declaration of mathastext math versions; starred variant of \MTversion leaves untouched the text font.
• (1.3b)
1. added a starred variant to \MTversion which tells mathastext to only do the math set-up and not modify the text fonts.
2. added second optional version name argument to \Mathastext and to \MTDeclareVersion, to transfer settings for things not otherwise changed by mathastext from a math version to the one declared. This is mainly for helping set in bold face also symbols and large symbols when the used font for letters has been chosen bold in the declared version.
• (1.3a)
1. new command \MTsetmathskips allows to specify on a letter by letter basis some extra skips to be automatically inserted in math mode before and after each occurrence of the given letter,
2. the package when running under lualatex requires it in a version at least as recent as the one distributed with TL2013,
3. the documentation is better hyperlinked.
• (1.2f) "change log" added to the user manual. Minor code improvements.
• (1.2e) remaining technical issues introduced with the version 1.2 have been solved; the documentation and the test files have been extended.
• (1.2d) an incompatibility with amsmath introduced in 1.2 is fixed.
• (1.2b) The package achieves a slight improvement in the positioning of subscripts when using an upright text font for letters in text mode and it corrects bugs with active characters which were introduced in 1.2.
• (1.2)
1. A new command sets up the amount of space to be automatically inserted before the derivative glyph (useful when using an upright font).
2. The scope of the math alphabets has been extended to apply to the non-alphabetical characters, and also to operator names. In usual math mode $\mathbf{(\sin(n!)<\cos(x)?)}$ changes only the font for n and x. With mathastext and if not told otherwise, /everything/ in the formula above will respond to \mathbf (and the automatic spaces are left untouched).
3. The documentation has been improved. The package file is self-extracting from the dtx, and four additional test files are also produced during latex mathastext.dtx'.
2012/12/20 1.2   extended scope of the math alphabets; automatic space before
the derivative glyph; documentation improved.
2013/12/31 1.2b  automatic italic corrections in math mode.
2013/01/10 1.2e  remaining technical issues with active characters in v1.2 and v1.2b
solved; extended test files, documentation, and source code comments
2013/09/02 1.3   new command \MTsetmathskips.
2013/12/14 1.3c  mechanism of "inheritance" in the declaration of mathastext math versions.
starred variant of \MTversion leaves untouched the text font.
2014/05/23 1.3d  new commands \MTstandardgreek and \MTcustomgreek.
2015/09/10 1.3e  bugfix (option nosmalldelims badly redefined \lbrace and \rbrace).
2015/09/12 1.3f  Info rather than Warning viz. amsmath's \resetMathstrut@.
self extracting README.md with Markdown syntax.
2015/10/15 1.3g  Compatibility patch with LaTeX 2015/10/01 regarding LuaLaTeX.
2015/10/31 1.3h  bugfix regarding options symbolgreek/selfGreek/selfGreeks.
2016/01/06 1.3i  compatibility layer with \url's use of math mode.
2016/01/15 1.3j  stronger subdued mode and related under-the-hood changes.
2016/01/24 1.3k  documentation fixes.
2016/01/29 1.3l  compatibility with TL2016 fontspec.
2016/04/22 1.3n  improved compatibility with amsmath.
2016/05/03 1.3o  patches around LuaLaTeX+luaotfload font issues in math mode.
2016/10/31 1.3q  option unicodeminus.
2016/11/06 1.3r  documentation tweaks.
`