Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

! Dimension too large. error when using multiple fonts and setting the main math font to Scale=MatchLowercase and other values #518

Closed
lionawurscht opened this issue Mar 13, 2019 · 2 comments

Comments

@lionawurscht
Copy link

lionawurscht commented Mar 13, 2019

Description

After a recent update I can't use multiple fonts when setting the main math font scale to MatchLowecase or any value smaller than one without getting a ! Dimension too large. error.

Info

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{unicode-math}
\setmainfont{TeXGyrePagellaX-Regular.otf}[
    ItalicFont=TeXGyrePagellaX-Italic.otf
]

\setmathfont[
    Scale=MatchLowercase % The option that makes troulbes
]{texgyredejavu-math.otf}


\setmathfont[range=it/{latin}]{texgyrepagella-math.otf}

\begin{document}
\begin{tabular}{rlrl}
    main font & n &  $\symliteral{n}$  & math font \\
    main font & \textit{n} &  $n$ & math font italic \\
    combination & \textit{n}n &  $\symliteral{n}n$ & combination \\
\end{tabular}
\end{document}

results in this error message:

! Dimension too large.
<recently read> \g__um_trial_font 

Further details

I can set multiple fonts without problems when I omit the Scale option for the main math font. However, as I am using some inline math I do need the scales to match. I tried setting Scale manually to fit my main text font but I get the same error mentioned above. I listed the scales where I get errors below:

Scale result
MatchLowercase fail
1.5 success
1.1 fail
1 success
0.999999 success
0.99999 fail
0.95 fail
0.63 fail
0.55 fail
0.1 success

When I don't try adding any additional math fonts the document renders without problems regardless of what Scale option I used for the main math font.
Inspired by the discussion in #515 I tried setting ScaleAgains rather randomly for the main math font or the additional one to no avail. Unfortunately I don't understand anything about the inner workings of latex so I can't say that I explored that option exhaustively.

@RuixiZhang42
Copy link

I cannot reproduce the error. Your example went through with either XeLaTeX or LuaLaTeX on my machine.

output

I also tried all the Scale’s which you claimed to fail, and again no errors with either XeLaTeX or LuaLaTeX. Judging by your list of failed Scale’s, it is safe to assume that you are still using the v0.8n unicode-math. Check unicode-math-luatex.sty and/or unicode-math-xetex.sty and look for the two lines containing ScaleAgain, the newer v0.8o should have 1.0001 and 0.9999 (4 decimals).

@lionawurscht
Copy link
Author

You are correct and I am very stupid. Being used to getting my latex nice and packaged I simply failed at installing the package properly. Sorry for wasting your time but thank you very much for the notch into the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants