I love to use mathfrak letters. However I need an `A' and the mathfrak A looks a lot like a U to me:
Are there alternative `mathfrak' looking fonts?
fontsmath-fonts
I love to use mathfrak letters. However I need an `A' and the mathfrak A looks a lot like a U to me:
Are there alternative `mathfrak' looking fonts?
This is compiled in LuaLaTeX. I can use \setmathfont
with the range
specifier to limit the extent of the font substitution. Here, I set the math font to Old English Text MT
found by default on Windows systems, but limit it to the range of \mathfrak
. In essence, it substitutes only for \mathfrak
, until the \setmathfont
is used to later reset the feature to the Latin Modern Math
defaults.
\documentclass{article}
\usepackage{fontspec,unicode-math}
\setmathfont{Latin Modern Math}
\begin{document}
\setmathfont[range=\mathfrak]{Old English Text MT}
Here we have $\mathfrak{x}^{55}+1 \ne(x^5)^{11}+1$
$\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$\mathfrak{abcdefghijklmnopqrstuvwxyz}$
\hrulefill
\setmathfont{Latin Modern Math}
Here we have $\mathfrak{x}^{55}+1 \ne(x^5)^{11}+1$
$\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$\mathfrak{abcdefghijklmnopqrstuvwxyz}$
\end{document}
Alternately, if the new fraktur font replacement is already available for pdflatex, then an approach like this can be used (based on the answer at Is it possible to use the DeclareFontShape command with kpfonts?):
\documentclass{article}
%\usepackage{fourier}
\DeclareFontFamily{U}{jkpmia}{}
\DeclareFontShape{U}{jkpmia}{m}{it}{<->s*jkpmia}{}
\DeclareFontShape{U}{jkpmia}{bx}{it}{<->s*jkpbmia}{}
\DeclareMathAlphabet{\mathfrak}{U}{jkpmia}{m}{it}
\SetMathAlphabet{\mathfrak}{bold}{U}{jkpmia}{bx}{it}
\begin{document}
Here we have $\mathfrak{x}^{55}+1 \ne(x^5)^{11}+1$
$\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$\mathfrak{abcdefghijklmnopqrstuvwxyz}$
\end{document}
The situation with fonts is much better than you thought! I absolutely agree with your advisor that you should use OpenType fonts (and therefore, the unicode-math
package on either XeLaTeX or LuaLaTeX). Any OpenType math font will have more-complete and consistent symbol coverage than any combination of legacy LaTeX packages, but the package also allows you to mix-and-match symbols and alphabets freely.
One thing I’m not entirely clear on is whether you want a monospaced font for code listings or typewriter-letter math symbols. Any complete OpenType math font contains the latter.
You can find a list of OpenType math fonts, with samples, at this answer. Going over the list there:
amssymb
, but has more glyphs. It is the default when you load unicode-math
. If you use this, you’ll get something that looks exactly like the default settings of TeX.mathpazo
, and its successor, newpxmath
.cambria_01.ttf
or as a ttc
file. You could also get it gratis with the PowerPoint 2007 viewer if you’re willing to unpack a few cab
files. However, it is the default font for equations in Microsoft Office and looks a lot like Times.You can find a sample of Asana Math here, all the TeX Gyre fonts here, and Libertinus here.
It is also possible to mix-and-match fonts, so as to use the symbols from a math font with the letters from your text font. One popular recommendation, for example, is Neo Euler for math with Palatino for text.
Most of these fonts have a matching text font without Math in the name. Asana Math and Neo Euler are good matches for Palatino (and therefore its clone Pagella).
Three of the font families I listed above have matching serif, sans serif and monospace fonts: Latin Modern Mono, DejaVu Sans Mono and Libertinus Mono. Latin Modern Mono is a clone of Computer Modern Monospace, which you might or might not find attractive and again looks just like the default cmtt
. Some of the more obscure variants of Computer Modern, such as Upright Italic, are available through Computer Modern Unicode. There is also a monospace font in the TeX Gyre collection, TeX Gyre Cursor, but it is a clone of Courier and therefore not really a match to any of the TeX Gyre Math fonts.
If you don’t use one of these, there are a large number of free monospace fonts out there, in addition to the ones that ship with your operating system.
You can also use any OpenType monospaced font you want for your typewriter-letter math symbols with a command such as \setmathfont[range=\mathtt]{Inconsolata}
.
You might or might need an accompanying sans-serif font in your document. If you want to use sans-serif throughout, you would have to remap a sans-serif family to the up
, bfup
, it
and bfit
math alphabets, but as an alternative for titles and headers, most of those font families come with small caps.
LaTeX packages historically had separate commands for \mathscr
and \mathcal
, which displayed different symbols. The Unicode Consortium decided that these were really just presentation forms and no mathematician used both \mathcal{I}
and \mathscr{I}
to mean different things in the same text. Therefore, it allocated only one range of codepoints for both alpabets.
The unicode-math
package by default sets up \mathcal
and \mathscr
as synonyms for each other, but it supports loading different alphabets into either (as well as \mathfrac
, \mathbb
, and so on). Furthermore, several math fonts contain separate \mathscr
and \mathcal
alphabets intended to be used this way. You can load them with one of the commands \setmathfont[range={mathcal,mathbfcal},Alternate,Scale=MatchUppercase]{Asana Math}
or \setmathfont[range={mathscr,mathbfscr},StylisticSet=1,Scale=MatchUppercase]{XITS Math}
. Stix Math or Stix Two Math use the same syntax as XITS Math.
If you don’t actually use \mathcal
or \mathbfcal
in your thesis, you can of course completely ignore this.
I personally like Asana Math, with Palatino (or a clone such as TeX Gyre Pagella) as the text font. However, you say in the comments that you don’t like its upright style. (I assume you mean the slant of symbols such as the integral; it contains both upright and italic letters, like all the math fonts.) Inconsolata is a free monotype font that I think, as a humanist sans, goes well with it. It ships with TeX Live, but only as a Type 1 font, so you would need to download the newer version. (Either double-click on the file and hit the install button, or on Linux, you can copy it to ~/.fonts
or /usr/local/share/fonts
.)
The official sans-serif companion font for Palatino is the commercial font Palatino Sans, but Optima, its free clone URW Classico, or Gillius No2 (based on Gill Sans) might be a good free alternative, and it ships with TeX Live.
Since you said this is an Engineering thesis, I’ll assume you want to use ISO style, which is the math-style=ISO
option to unicode-math
. To get upright letters for constants as it recommends, you can use, e.g., \symup{e}
, but unicode-math
defines \muppi
for the constant π.
I recommend the microtype
package to make the right margins and word spacing look neater, with less hyphenation (I contributed a few improvements to it myself).
You also mention the need to support both English and South Asian languages. You should be able to do something like \newfontfamily\devanagarifont[Script=Devanagari]{Shobhika}
for Indic and \newfontfamily\malayalamfont[Script=Malayalam]{Free Serif}
for Malayalam. That should enable Sanskrit in Polyglossia, but for Malayalam, you would need to select \malayalamfont
manually. However, the code will still work if Polyglossia adds support for Malayalam later.
If you absolutely must use pdflatex, first load \usepackage[T1]{fontenc}
. It wouldn’t hurt to add \usepackage[utf8]{inputenc}
, but that’s now the default. The packages tgpagella
, newpxmath
, inconsolata
and classico
would set your main, math, monospace and sans-serif font to a combination I like. (The only real problem with it is that Palatino might be overused, but at least it will be taken seriously.) If you want to tweak the math alphabets some more, look at the package options to newpxmath
and consider a package such as mathalfa
or isomath
.
If you need to support PDFLaTeX, you can use the \iftex
package to wrap the leagacy NFSS preamble and the modern unicode-math
preamble in conditional blocks. Then, you’ll use modern features if your TeX engine supports them.
I have one other quirk in my papers: Math fonts use wildly different symbols for Q.E.D. I personally like to use the black “tombstone”, introduced by Paul Halmos and used in the 1997 edition of The Art of Computer Programming by DEK. The command for this is \setmathfont[range="220E]{XITS Math}
, and to use it with amsthm
, \renewcommand{\qedsymbol}{\ensuremath{\char"220E}}
.
Best Answer
With unicode-math
You can select the Fraktur alphabet of any math font, or map any Unicode blackletter (or other!) font to the Fraktur alphabet. You might try UniFraktur Maguntia with its sets of character variants, including three forms of uppercase A. Here is its “easy-reading” or “21st-century” variant.
And a different variant A, plus other modernized letters:
This example keeps the default bold Fraktur, which Maguntia does not cover. There are many other fonts in Steven B. Segaletes’ list here.
With NFSS
As Mico mentioned in the comments, you can select between the available Type 1 Fraktur fonts using mathalpha (formerly
mathalfa
).Another set of Fraktur fonts that aren’t designed for math mode, but can be used there, are the Y fonts by Yannis Haralambous, which are now available as Type 1. For example, here is Gotisch.
ETA: Looking back at this answer in 2020, I notice a small bug in the MWE: I use
\text
to select a symbol alphabet in math mode. In theory, formatting of the surrounding text, such as\bfseries
or\itshape
, would bleed through. This might be desirable if you’re including math symbols in a title where you want both\bfseries
and\boldmath
, and I don’t believe there’s any\itshape
,\scshape
, or so on for these fonts.However, you might prefer to use
\DeclareMathAlphabet
instead (if you aren’t using legacy tools with a very limited number of math alphabets), or\usefont
or\normalfont
inside\text
.