\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, FourierGUTenberg, Math Design, Kepler Project, newtx, mathabx, others ... ; and ([2012/10/27]) on the Unicode side (XeTeX/LuaTeX): AsanaMath, 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 wellcrafted 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. 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. 
Current version is 1.3zb (2023/12/29)

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 libertinelegacy 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 LGRencoded font files
from the libertinustype1
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
libertinelegacy is still
installed, libgreek will use it.
Else (or if mandated by the libertinus
option) it
uses the font definition files from
libertinustype1.
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 libertinustype1 and
you presumably don't need mathastext
!
\renewcommand{\familydefault}{\sfdefault} \usepackage{mathastext} \renewcommand{\familydefault}{\rmdefault}It is then even less recommended to use the italic option (matter of taste!).
\usepackage{my_nice_font} \renewcommand{\familydefault}{cmr} % or cmss or cmtt for sans resp. mono \usepackage[LGRgreek, further options]{mathastext} \renewcommand{\familydefault}{\rmdefault} \Mathastext \begin{document}The Greek letters will be from the LGR encoded CM font (and will be in upright shape, except if italic was among the mathastext options).
2011/01/25 1.0 Initial version. (doc) 2011/02/01 1.1 bugs fixed; options italic and frenchmath; minus as endash. 2011/02/06 1.11 bugs fixed; \Mathastext admits optional math version name. 2011/03/11 1.13 bugs fixed; option LGRgreek. 2011/04/03 1.14b bugs fixed; options LGRgreeks and selfGreeks. 2012/09/26 1.15 option subdued allowing the mathastextification to act locally. 2012/10/05 1.15c commands to setup distinct LGR Greek fonts in each math version. 2012/10/22 1.15e improvements to subdued; automatic spaces after \forall and \exists. 2012/10/25 1.15g improvements in \#,\&,\$,\%; code cleaned up and better documented. 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 underthehood 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. 2018/08/22 1.3t compatibility fix with fontspec relative to subdued option. no more redefinitions of \i and \j, only \imath and \jmath. 2019/08/20 1.3u support for math versions with varying font encodings. 2019/09/19 1.3v robust and protected math macros to match LaTeX 20191001 2019/11/16 1.3w workaround to a (provisory) LaTeX+amsmath bug regarding math accents 2022/11/04 1.3y options ncccomma, binarysemicolon and frenchmath*. with LGRgreek: \...up and \...it variants for Greek letters and \mathgreekup/\mathgreekit alphabets. 2023/09/01 1.3z fix 1.3y regression regarding selfGreek option. 2023/12/20 1.3za option LGRgreek+, documentation improvements. 2023/12/29 1.3zb frenchmath* update, decimalcomma, modified build logs, documentation.