3

I'm using the MathTime Professional II (mtpro2) fonts with the Monotype Baskerville family. The font used for math letters in mtpro2 is Times New Roman Italic, and this can look quite good when combined with Baskerville, provided that it is scaled appropriately (Baskerville seems to be a slightly shorter font than TNR). Indeed, a guide (which can be found here) says the mtpro2 "fonts also turn out to be quite compatible with various other text fonts, though the text font size may have to be adjusted slightly, so that the x-heights will match."

Here's a small example to demonstrate the issue.

\documentclass[11pt]{article}

\usepackage{mtpro2}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Baskerville}

\begin{document}
\noindent For any integer $n$ and prime number $p$, we want to solve $x^2 - ny^2 = p$.
\end{document}

The output produced is output

It's clear that the math text is significantly taller than the text surrounding it. How can I properly scale the math characters so that they integrate seamlessly with the Monotype Baskerville family?

EDIT: I should mention that one solution I know is to use something to the effect of

\setmainfont[Ligatures=TeX,Scale=1.05]{Baskerville}

which seems to do the trick, but I prefer to keep the Baskerville in 11pt, if possible.

  • Some traditional TeX fonts are set up in a way which permits you to easily specify a scaling factor when loading the package. Does mtpro2 offer this? If not, then I think you would have to create modified font definition files in order to do this. – cfr Feb 16 '15 at 1:15
1

Well, this worked for me.

\documentclass[10pt]{article}

\usepackage{mtpro2}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Scale=1.1]{Baskerville}

\begin{document}
\noindent For any integer $n$ and prime number $p$, we want to solve $x^2 - ny^2 = p$.
\end{document}

Bringing down the font size to 10pt, but then scaling it up by 110%, leaves you with an 11pt font. You then need to adjust the margins and the linespread by a similar factor to keep everything looking nice, but otherwise this solution is quite effective.

Still, I'm open to it if anyone knows a way of solving this problem by simply shrinking the mtpro2 font, which would probably be less roundabout.

1

The following solution is taken from my own answer, where I want to scale up MathTime Pro 2.

The task here is to match the x-heights of Baskerville and MathTime Pro 2. On the one hand, the x-height of Baskerville is 415/1000. On the other hand, MathTime Pro 2 has three different x-heights: 457/1000, 491/1000 and 524/1000 for \displaystyle/\textstyle, \scriptstyle and \scriptscriptstyle, respectively (because it uses optical sizes).

Since you wish not to change Baskerville, we must scale down MathTime Pro 2. Using my implementation, we just provide three different factors: 415/457, 415/491 and 415/524, and we’re done!

\documentclass[11pt]{article}

\usepackage[no-math]{fontspec}% Option no-math is important!
\setmainfont[Ligatures=TeX]{Baskerville}
\usepackage[lite]{mtpro2}
\usepackage{amsmath}

% My implementation: https://tex.stackexchange.com/a/439463/164314
\makeatletter
% Customize different scaling factors here
\newcommand*{\mtpscale@scaled}{0.9080963}% 415/457
\newcommand*{\mtpscale@scriptscaled}{0.8452138}% 415/491
\newcommand*{\mtpscale@scriptscriptscaled}{0.7919847}% 415/524
% Fonts available in the `lite' version
% Source code found in `mtpro2.sty'
\DeclareFontShape{LMP1}{mtt}{m}{it}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2mif
  <7-9> s*[\mtpscale@scriptscaled] mt2mis
  <9-> s*[\mtpscale@scaled] mt2mit}{}
\DeclareFontShape{LMP2}{mtt}{m}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2syf
  <7-9> s*[\mtpscale@scriptscaled] mt2sys
  <9-> s*[\mtpscale@scaled] mt2syt}{\skewchar\font32}
\DeclareFontShape{LMP3}{mtt}{m}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2exa
  <7-9> s*[\mtpscale@scriptscaled] mt2exa
  <9-> s*[\mtpscale@scaled] mt2exa}{}
\DeclareFontShape{U}{mtt}{b}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2mbf
  <7-9> s*[\mtpscale@scriptscaled] mt2mbs
  <9-> s*[\mtpscale@scaled] mt2mbt}{}% (MJ)
% Fonts available in the `complete' version
\ifmtp@full
% Source code found in `mtpro2.sty'
\DeclareFontShape{LMP1}{mtt}{b}{it}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bmif
  <7-9> s*[\mtpscale@scriptscaled] mt2bmis
  <9-> s*[\mtpscale@scaled] mt2bmit}{}
\DeclareFontShape{LMP2}{mtt}{b}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bsyf
  <7-9> s*[\mtpscale@scriptscaled] mt2bsys
  <9-> s*[\mtpscale@scaled] mt2bsyt}{\skewchar\font32}
\DeclareFontShape{LMP2}{mtt}{eb}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2hsyf
  <7-9> s*[\mtpscale@scriptscaled] mt2hsys
  <9-> s*[\mtpscale@scaled] mt2hsyt}{\skewchar\font32}
\DeclareFontShape{LMP3}{mtt}{b}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bexa
  <7-9> s*[\mtpscale@scriptscaled] mt2bexa
  <9-> s*[\mtpscale@scaled] mt2bexa}{}
\DeclareFontShape{LMP3}{mtt}{eb}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2hexa
  <7-9> s*[\mtpscale@scriptscaled] mt2hexa
  <9-> s*[\mtpscale@scaled] mt2hexa}{}
\DeclareFontShape{U}{mt2sya}{m}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2syaf
  <7-9> s*[\mtpscale@scriptscaled] mt2syas
  <9-> s*[\mtpscale@scaled] mt2syat}{}%
\DeclareFontShape{U}{mt2sya}{b}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bsyaf
  <7-9> s*[\mtpscale@scriptscaled] mt2bsyas
  <9-> s*[\mtpscale@scaled] mt2bsyat}{}%
\DeclareFontShape{U}{mt2sya}{eb}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2hsyaf
  <7-9> s*[\mtpscale@scriptscaled] mt2hsyas
  <9-> s*[\mtpscale@scaled] mt2hsyat}{}%
% Source code found in `umt2ms.fd'
\DeclareFontFamily{U}{mt2ms}{\skewchar\font42}%
\DeclareFontShape{U}{mt2ms}{m}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2mcf
  <7-9> s*[\mtpscale@scriptscaled] mt2mcs
  <9-> s*[\mtpscale@scaled] mt2mct}{}%
\DeclareFontShape{U}{mt2ms}{m}{it}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2msf
  <7-9> s*[\mtpscale@scriptscaled] mt2mss
  <9-> s*[\mtpscale@scaled] mt2mst}{}%
\DeclareFontShape{U}{mt2ms}{b}{it}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bmsf
  <7-9> s*[\mtpscale@scriptscaled] mt2bmss
  <9-> s*[\mtpscale@scaled] mt2bmst}{}%
% Source code found in `umt2mf.fd'
\DeclareFontFamily{U}{mt2mf}{}%
\DeclareFontShape{U}{mt2mf}{m}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2mff
  <7-9> s*[\mtpscale@scriptscaled] mt2mfs
  <9-> s*[\mtpscale@scaled] mt2mft}{}%
\DeclareFontShape{U}{mt2mf}{b}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bmff
  <7-9> s*[\mtpscale@scriptscaled] mt2bmfs
  <9-> s*[\mtpscale@scaled] mt2bmft}{}%
% Source code found in `umt2bb.fd'
\DeclareFontFamily{U}{mt2bb}{\skewchar\font45}%
\DeclareFontShape{U}{mt2bb}{m}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bbf
  <7-9> s*[\mtpscale@scriptscaled] mt2bbs
  <9-> s*[\mtpscale@scaled] mt2bbt}{}%
\DeclareFontShape{U}{mt2bb}{m}{it}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bbif
  <7-9> s*[\mtpscale@scriptscaled] mt2bbis
  <9-> s*[\mtpscale@scaled] mt2bbit}{}%
\DeclareFontShape{U}{mt2bb}{b}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2bbdf
  <7-9> s*[\mtpscale@scriptscaled] mt2bbds
  <9-> s*[\mtpscale@scaled] mt2bbdt}{}%
% Source code found in `umt2hrb.fd'
\DeclareFontFamily{U}{mt2hrb}{\skewchar\font45}%
\DeclareFontShape{U}{mt2hrb}{m}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2hrbf
  <7-9> s*[\mtpscale@scriptscaled] mt2hrbs
  <9-> s*[\mtpscale@scaled] mt2hrbt}{}%
\DeclareFontShape{U}{mt2hrb}{m}{it}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2hbif
  <7-9> s*[\mtpscale@scriptscaled] mt2hbis
  <9-> s*[\mtpscale@scaled] mt2hbit}{}%
\DeclareFontShape{U}{mt2hrb}{b}{n}{%
  <-7> s*[\mtpscale@scriptscriptscaled] mt2hrbdf
  <7-9> s*[\mtpscale@scriptscaled] mt2hrbds
  <9-> s*[\mtpscale@scaled] mt2hrbdt}{}%
\fi
\makeatother

\newcommand{\test}{%
  \text{For any integer }n
  \text{ and prime number }p
  \text{, we want to solve }x^2 - ny^2 = p\text{.}}

\begin{document}
\noindent For any integer $n$ and prime number $p$, we want to solve $x^2 - ny^2 = p$.

\noindent ${\textstyle\test}$

\noindent ${\scriptstyle\test}$

\noindent ${\scriptscriptstyle\test}$
\[
\begin{aligned}
x_{\text{apple},n_{\text{apple},n}} & \ge x_{\text{banana},n_{\text{banana},n}} \quad \text{for } n = 1,\dotsc,10, \\
x_{\text{apple},n_{\text{apple},n}} & < x_{\text{banana},n_{\text{banana},n}} \quad \text{for } n = 11,\dotsc,20.
\end{aligned}
\]
\end{document}

New implementation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.