14

(update) Just in case anyone else is interested in this, here's a combination I just found that comes close to being ideal, for my taste.

Similar math font as that of the mathdesign package, but slightly 'lighter', and spaced more liberally.

The settings are an adjusted version of Example 2 of XCharter documentation. All credit goes to @samcarter for pointing this out.

%% main settings

% scaled to match Charter font size of mathdesign, which I like best
% [osf] reduces number size in text mode... not sure yet about this one
\usepackage[scale=0.97]{XCharter} 

% scale math size to taste
\usepackage[libertine,bigdelims,vvarbb,scaled=1.05]{newtxmath} 

% error fix
\let\openbox\undefined 


%% optional settings

% I have no idea what I'm doing here.jpeg, but it sure looks prettier
\usepackage[spacing=true,kerning=true,babel=true,tracking=true]{microtype}

% different \mathcal style, but just a matter of taste
\DeclareMathAlphabet{\pazocal}{OMS}{zplm}{m}{n} 
\renewcommand{\mathcal}[1]{\pazocal{#1}}

I am currently using

\usepackage[charter]{mathdesign}

While I like the text font, the math is spaced too densely for my taste.

I tried as an alternative

\usepackage[scale=0.97]{XCharter}

which seems to give me nearly identical text, but allows to set a different font for math mode.

The default math (which I get when using XCharter) is spaced the way I want it, but the font looks too thin/not heavy enough next to the Charter text font.

Alternatively, I tried

\usepackage[T1]{eulervm}

which is spaced nicely and looks 'heavy' enough, but I really don't like the characters (glyphs?).

(edit) Ideally, I would like something very similar to the default math font+spacing, but with a heavier font.

As you can probably tell, I'm not really knowledgeable about the tex internals here. For example, I don't know what controls the spacing in math mode.

So my question consists of two parts:

  • What would be a good "math font" to go with Charter text font (in the wide sense above, and probably not the right name for what I want, which is "math fonts + spacing")

  • How can I set it independently of the text fonts?

(Apologies if the following question is too "open ended", i.e. if "What would look good with X" isn't the type of question one should ask on this SE)

  • 1
    http://www.tug.dk/FontCatalogue/mathfonts.html will give you a list with fonts with math support - maybe have a look if you like one of them. – samcarter_is_at_topanswers.xyz Jun 26 '17 at 15:09
  • @samcarter Thanks, will have a look. One question: I already struggled for a while how to set the math font independently. After loading for example \usepackage[scale=0.97]{XCharter}, will I load the math font by another \usepackage? or do I need to use something like \setmathfont, which I still struggle with? – Bert Zangle Jun 26 '17 at 15:13
  • (update) So let's say I'd like to use \usepackage{arev} for math and \usepackage{XCharter} for text. That doesn't seem to work though, and all fonts are from whatever is loaded last. Any pointer to an older question on SE showing how to fix that? – Bert Zangle Jun 26 '17 at 15:30
  • This depends on which fonts you want to use. Some packages have options to only load the math font or not load the math font ... but worst case you can do it manually, for example if you have loaded a package including a math font you can overwrite the normal text font with something like \renewcommand{\rmdefault}{mdbch} [this will change the normal text to charter and leave the previously chosen math alone] – samcarter_is_at_topanswers.xyz Jun 26 '17 at 15:31
  • Mayeb read http://texdoc.net/texmf-dist/doc/fonts/xcharter/xcharter-doc.pdf it discussed possible math companions for charter – samcarter_is_at_topanswers.xyz Jun 26 '17 at 15:36

1 Answers1

7

Answer to the question in the question

http://texdoc.net/texmf-dist/doc/fonts/xcharter/xcharter-doc.pdf discusses suitable math companions for charter. Have a look there.


Answer to the question asked in your comment:

Probably not the most elegant solution, but if you have your desired math font, you can manually overwrite the font of the normal text, for example to use the charter font (as it is used with mathdesign)

\documentclass{article}

\usepackage{arev}
%\usepackage[charter]{mathdesign}

\renewcommand{\rmdefault}{mdbch}

\begin{document}

text

\begin{equation}
text
\end{equation}

text

\end{document}

or in the special case of the arev package you asked about in your comment, there is a dedicated package which only loads the math font:

\documentclass{article}

\usepackage[charter]{mathdesign}

\let\circledS\undefined
\let\mathcal\undefined
\let\mathbb\undefined

\usepackage{arevmath}

\begin{document}

text

\begin{equation}
text
\end{equation}

text

\end{document}
  • Three clarification questions, if you have the time: I previously used \renewcommand{\rmdefault}{mdbch} and I don't mind doing so, but: how can I derived the 'shorthand' (?), "mdbch" here, from the font or package name? I couldn't find these shorthands for some of the fonts I wanted to use. (1/3) – Bert Zangle Jun 26 '17 at 16:01
  • Do I need to \usepackage load the package that contains the font that I'm using with renewcommand\rmdefault? (2/3) – Bert Zangle Jun 26 '17 at 16:01
  • @BertZangle (1) To get mdbch I had a look into the source code of mathdesign - not sure how else to get them – samcarter_is_at_topanswers.xyz Jun 26 '17 at 16:03
  • I noticed your 2nd part has a number of \let\circledS\undefined statements, which I also struggled with already. It's a way to avoid errors due to both packages setting math symbols, right? Just to see if I understand correctly, it doesn't mean the command is left undefined ultimately, but only for the /first/ package, but is set then by the second package. Correct? (3/3) – Bert Zangle Jun 26 '17 at 16:03
  • @BertZangle (2) no, the idea is to bypass the \usepackage{...} as this will probably also load the math font (as done in my first example) – samcarter_is_at_topanswers.xyz Jun 26 '17 at 16:04
  • @BertZangle (3) correct. without them, the second package would complain that these commands are already defined - like this the second package can happily define them – samcarter_is_at_topanswers.xyz Jun 26 '17 at 16:06
  • @BertZangle (again 2) in case some other functionality of mathdesign might missing you could first load mathdesign, do the \undefined dance, load arev and do \renewcommand{\rmdefault}{mdbch}, but I don't think this is necessary. – samcarter_is_at_topanswers.xyz Jun 26 '17 at 16:10
  • Final question, promised! Your first suggestion (with renewcommand) works as a general solution (although I noticed that arev isn't the font I want >_<). However, the second suggestion immediately throws "too many math alphabets" errors. I saw somewhere on here that adding \newcommand\hmmax{0} and \newcommand\bmmax{0} can help, which it does in some case, but not here. Any suggestion how to "free up" (?) alphabet space, or how to increase the max I can load? – Bert Zangle Jun 26 '17 at 16:20
  • @BertZangle Sorry, I don't get the error about too many math alphabets. Which tex distribution are you using? I tested the code with pdflatex from texlive 2017 without problems. – samcarter_is_at_topanswers.xyz Jun 26 '17 at 16:22
  • Tex Live Utility 1.26, used under Texstudio. Maybe I'm loading other packages that add to the alphabet without me knowing it? For example, does "gensymb" take away from that space? – Bert Zangle Jun 26 '17 at 16:28
  • @BertZangle Of course with additional packages you will eventually run out of math alphabets. – samcarter_is_at_topanswers.xyz Jun 26 '17 at 16:34