Usng unicode-math, I am trying (in LyX) to use a font for my main font, and also for math Latin and Greek characters, while keeping the rest as is.
At the same time, I want to use blindtext.
Blindtext only allows \blindmathtrue if the language has been set to
English.
This I believe I have to do via the language package custom area in the LyX
document preferences, however using \usepackage[english]{babel} breaks unicode-math.
I get
! Font \l_tmpb_font has only 8 fontdimen parameters.
If I use the default language package, all works, except, as stated above, blindtext English/math.
%This is in my preamble:
\usepackage[vargreek-shape=unicode]{unicode-math}
\setmathfont{Latin Modern Math} % this is obligatory or no math font will
be set...
%everything works to here. But this setmathfonts is causing the problem
\setmathfont[range=\mathit/{latin, Latin}]{SNsanafonmaruP}
% upper and lower case latin and numbers
% any font will do
\setmainfont[Mapping= tex-text]{SNsanafonmaruP} % not actually relevant....
\usepackage{blindtext}
I don't believe the font I used is the problem; I get the same behavior whatever text only font I use, even common ones like Biolinium or Hoefler Text.
(N.B. The example is heavily redacted from a larger set of uses of unicode-math for nefarious purposes, so this a best effort to produce a MWE for what
seems to be the crux of the matter.)
The problem is not with LyX. Here is a TeX (TeXShop) document that does not work:
% tell TeXShop to use xelatex, open/save in Unicode
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[vargreek-shape=unicode]{unicode-math}
\setmathfont{Latin Modern Math} % obligatory or no math font will be set...
%UNCOMMNENTING THIS LINE CAUSES ERROR
% using text only font: I also tried Hoefler Text, etc. The font I really want is SNsanafonmaruP
%\setmathfont[range=\mathit/{latin, Latin}]{Linux Biolinum O} % upper and lower case latin and numbers
%Using a font like LLO however, does work
%\setmathfont[range=\mathit/{latin, Latin}]{Linux Libertine O} % upper and lower case latin and numbers
\usepackage{blindtext}
\begin{document}
No math:\blindtext
\blindmathtrue
With Math:\blindtext
\end{document}
documentenvironment all goes well. I changed the font into one that is surely a text only font. – egreg May 07 '14 at 08:57$\sqrt[3]{2}$. – egreg May 08 '14 at 07:33$\sqrt[3]{2}$would probably solve also your (unspecified) problem. That it's a bug is confirmed by the fact that LuaLaTeX doesn't raise an error, but typesets the formula incorrectly. Surely the fact that the selected font is not meant for math has its influence. – egreg May 08 '14 at 09:03