LaTeX forum ⇒ Fonts & Character SetsLuaLaTeX + Minion Pro + MnSymbol --> math formatting

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Sylvan
Posts: 4
Joined: Fri Nov 18, 2011 1:55 pm

LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby Sylvan » Fri Nov 18, 2011 2:18 pm

Hello,

not sure if this is the best sub-forum to place this (maybe a mod can move it if it's more appropriate elsewhere).

I want to achieve the following:

  • Font of the main text set in Minion Pro
  • Font of text in math-mode also in Minion Pro (greek and latin letters, numbers etc.)
  • Because Minion Pro has not all of the required symbols (operators, integrals etc.) so let them set with the MnSymbol-font

I can set the font of the normal symbols in the following way:
\documentclass{article} 

\usepackage[no-math]   {fontspec} 
\setmainfont{Minion Pro} 

\usepackage{MnSymbol} 
\usepackage{unicode-math} 

\setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro} 
\setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{MinionPro-Bold} 
\setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]{MinionPro-It} 
\setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}]{MinionPro-BoldIt} 

\begin{document} 
   A formula: 
   \[\underbrace{\frac{\sin^{2}\vartheta}{\Theta_{lm}(\vartheta)}\left(\frac{\partial^{2}}{\partial\vartheta^{2}}+\frac{\cos\vartheta}{\sin\vartheta}\frac{\partial}{\partial\vartheta}\right)\Theta_{lm}(\vartheta)+\sin^{2}(\vartheta)(l(l+1))}_{m^{2}}=\underbrace{-\frac{1}{\Phi_{m}(\varphi)}\frac{\partial^{2}}{\partial\varphi^{2}}\Phi_{m}(\varphi)}_{m^{2}}\] 
    
   and another one: 
   \[P_l (x)\equiv\frac {1}{2^l}\sum_{k=0}^{\lfloor l/2\rfloor} (-1)^k \frac{(2l-2k)!}{k!(l-k)!(l-2k)!} x^{l-2k}\] 
\end{document}


The problem is that some symbols won't displayed like the summation sign, integrals, \equiv-sign and others.
I've tried to set the summation sign explicit in MnSymbol with the following code but it also fails:
\setmathfont[range=\mathup/{"2211}]{MnSymbol5} 
\setmathfont[range=\mathbfup/{"2211}]{MnSymbol5} 
\setmathfont[range=\mathit/{"2211}]{MnSymbol5} 
\setmathfont[range=\mathbfit/{"2211}]{MnSymbol5}


A try with "\setmathfont{MnSymbol5}" even produce a "invalid character"-error and stops the compiling.
I also tried with mathspec but i didn't get it work with luaLaTeX.

So i would appreciate it if somebody can give me good hints for me to get a homogeneous type face with Minion Pro + MnSymbol + LuaLaTex.

Some infos about my environment:
  • Win 7 x64
  • LuaLaTeX from TexLive
  • TexLive 2011 - newest updates
  • MnSymbol*.otf from TexLive and from their homepage respectively. It makes no difference if i install the otfs in windows or lualatex get them from the texLive-dir.
  • Minion Pro from the Adobe Reader

Thank you in advance!

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby localghost » Sat Nov 19, 2011 10:01 am

It would be very kind if you mention when doing a crossposting [1]*. This is only fair because it prevents others from double efforts and waste of time.


* According to the rules you are obliged to do so.

[1] LuaLaTeX + Minion Pro + MnSymbol --> Einheitliches Schriftbild in Text und Formeln — mrunix.de


Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Sylvan
Posts: 4
Joined: Fri Nov 18, 2011 1:55 pm

LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby Sylvan » Sat Nov 19, 2011 10:59 am

Yes sorry this is a crosspost.
There's also another crosspost: http://www.golatex.de/lualatex-und-mnsymbol-und-unicode-math-wie-vereinen-t7772.html
The problem is that this seems to be quite special.
I searched a long time if someone else had a similar problem but nothing to find.
So i have to ask experts but i don't know where to ask because this is a lualatex-topic and all latex-communities i found don't have a special lualatex-forum.
This is why i wrote to 3 expert-forums to raise the chance that at least one person can help me.
I assure you that i would instantly write if i became at least 1 answer in one of these forums because i don't think that i am the only person with that question.

But your are right - i should have write that information - sorry.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby localghost » Sat Nov 19, 2011 11:30 am

Your approach has a small hitch. The MnSymbol package can't be included the way you try. The mathspec package offers an appropriate option to get what you want.
\documentclass{article}
\usepackage[MnSymbol]{mathspec}

\setmainfont{Minion Pro}
\setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro}
\setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{MinionPro-Bold}
\setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]{MinionPro-It}
\setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}]{MinionPro-BoldIt}

\begin{document}
  A formula:
  \[
    \underbrace{\frac{\sin^{2}\vartheta}{\Theta_{lm}(\vartheta)}\left(\frac{\partial^{2}}{\partial\vartheta^{2}}+\frac{\cos\vartheta}{\sin\vartheta}\frac{\partial}{\partial\vartheta}\right)\Theta_{lm}(\vartheta)+\sin^{2}(\vartheta)(l(l+1))}_{m^{2}}=\underbrace{-\frac{1}{\Phi_{m}(\varphi)}\frac{\partial^{2}}{\partial\varphi^{2}}\Phi_{m}(\varphi)}_{m^{2}}
  \]
   
  and another one:
  \[
    P_l (x)\equiv\frac {1}{2^l}\sum_{k=0}^{\lfloor l/2\rfloor} (-1)^k \frac{(2l-2k)!}{k!(l-k)!(l-2k)!} x^{l-2k}
  \]
\end{document}

Looks good to me with a displayed summation sign. It works for me with XeLaTeX and should also do with LuaLaTeX.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Sylvan
Posts: 4
Joined: Fri Nov 18, 2011 1:55 pm

LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby Sylvan » Sat Nov 19, 2011 12:51 pm

Thanks for your reply.
As previously mentioned i already tried the mathspec-Package but without any success.
When i try to compile your example with lualatex i get the following errors:

  • Undefined control sequence {\relax}
  • You can't use `the character .' after \the {\relax}
  • Package mathspec Error: mathspec requires a more recent version of XeTeX {\relax}

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby localghost » Sat Nov 19, 2011 1:13 pm

I can comprehend the problem. Do you really need LuaLaTeX?
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Sylvan
Posts: 4
Joined: Fri Nov 18, 2011 1:55 pm

LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby Sylvan » Sat Nov 19, 2011 3:36 pm

When i compile your example with xelatex i get the following output:
XelatexMathspec.png
XelatexMathspec.png (19.77 KiB) Viewed 21978 times

It's qite the same as i would compile the following code with lualatex:
\documentclass{article}
\usepackage[no-math]{fontspec} 
\usepackage{MnSymbol} 
\setmainfont{Minion Pro}

\begin{document} 
   A formula: 
   \[\underbrace{\frac{\sin^{2}\vartheta}{\Theta_{lm}(\vartheta)}\left(\frac{\partial^{2}}{\partial\vartheta^{2}}+\frac{\cos\vartheta}{\sin\vartheta}\frac{\partial}{\partial\vartheta}\right)\Theta_{lm}(\vartheta)+\sin^{2}(\vartheta)(l(l+1))}_{m^{2}}=\underbrace{-\frac{1}{\Phi_{m}(\varphi)}\frac{\partial^{2}}{\partial\varphi^{2}}\Phi_{m}(\varphi)}_{m^{2}}\] 
    
   and another one: 
   \[P_l (x)\equiv\frac {1}{2^l}\sum_{k=0}^{\lfloor l/2\rfloor} (-1)^k \frac{(2l-2k)!}{k!(l-k)!(l-2k)!} x^{l-2k}\] 
\end{document}

Because with that i get this:
LualatexSimple.png
LualatexSimple.png (19.67 KiB) Viewed 21978 times

But in both cases the symbols of the operators are correct set in MnSymbol. The font of the letters and numbers are still set in Computer Modern. But i want to set them in Minion Pro.
For a better understanding: This is the output of the code in my first post:
LuaLaTeXwithoutSum.png
LuaLaTeXwithoutSum.png (17.63 KiB) Viewed 21978 times

This is nearly what i want - the only remaining problem are the few missing symbols like the summation-symbol.

Edit: Maybe it help when i say with this preamble all is set correctly with XITS and Minion Pro.:
\documentclass{article} 

\usepackage[no-math]   {fontspec}
\usepackage{unicode-math}
\setmainfont{Minion Pro} 

\setmathfont{xits-math.otf}		% replace with MnSymbol5 --> failure
\setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro} 
\setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{MinionPro-Bold} 
\setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]{MinionPro-It} 
\setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}]{MinionPro-BoldIt} 
But when i try to change the xits-math.otf to MnSymbol5.otf i get an "invalid character"-error.


Edit2: With the following preamble:
\documentclass{article}
\usepackage[MnSymbol]{mathspec}

\setmainfont{Minion Pro}
\setallmainfonts(Digits,Latin,Greek)[Numbers={Lining,Proportional,Monospaced}]{Minion Pro}
\exchangeforms{phi}

The result is perfect when i compile it with xelatex.
If nobody has an idea how to get the same result with lualatex i have to switch to xelatex.
Thx localghost

Rogge
Posts: 1
Joined: Wed Jul 04, 2012 12:07 pm

LuaLaTeX + Minion Pro + MnSymbol --> math formatting

Postby Rogge » Wed Jul 04, 2012 12:54 pm

I don't know if you still need a solution but just for the records here's mine. Unfortunately it does not totally fit your question.

My requirements were the following:
  • LuaTeX engine, LaTeX2e format
  • MinionPro text and math letter/number font
  • OpenType fonts

As I find fontspec to be way too slow at its current point of development I went for a luaotfload only solution. This also meant not be able to use unicode-math because it depends on fontspec.

I had quite some problems loading MnSymbol, either the via the MnSymbol package or using the OpenType fonts. So I gave up on MnSymbol and did the following:
  • I used the utopia option of the mathdesign package
  • and redefined the alphabet for math letters and numbers to use MinionPro.

Here's how your formula looks like with this approach:
sylvanformula.png
sylvanformula.png (32.32 KiB) Viewed 20940 times


And here's how to set it up:
\usepackage{amsmath}
\usepackage[adobe-utopia]{mathdesign}

\pdfprotrudechars2
\pdfadjustspacing2
\usepackage{luaotfload}
\usepackage[EU2]{fontenc}

\DeclareFontFamily{EU2}{minionpro}{}
\DeclareFontShape{EU2}{minionpro}{m}{n}{<->"MinionPro-Regular:mode=node:protrusion=default:expansion=default;script=latn;+ccmp;+locl;+mark;+mkmk;+kern;+liga;+clig;+trep;+tlig;+pnum;"}{}
\DeclareFontShape{EU2}{minionpro}{m}{sc}{<->"MinionPro-Regular:mode=node:protrusion=default:expansion=default;script=latn;+ccmp;+locl;+mark;+mkmk;+kern;+liga;+clig;+trep;+tlig;+pnum;+smcp;"}{}
\DeclareFontShape{EU2}{minionpro}{m}{it}{<->"MinionPro-It:mode=node:protrusion=default:expansion=default;script=latn;+ccmp;+locl;+mark;+mkmk;+kern;+liga;+clig;+trep;+tlig;+pnum;"}{}
\DeclareFontShape{EU2}{minionpro}{bx}{n}{<->"MinionPro-Bold:mode=node:protrusion=default:expansion=default;script=latn;+ccmp;+locl;+mark;+mkmk;+kern;+liga;+clig;+trep;+tlig;+pnum;"}{}
\DeclareFontShape{EU2}{minionpro}{bx}{it}{<->"MinionPro-BoldIt:mode=node:protrusion=default:expansion=default;script=latn;+ccmp;+locl;+mark;+mkmk;+kern;+liga;+clig;+trep;+tlig;+pnum;"}{}

\renewcommand{\rmdefault}{minionpro}

\DeclareSymbolFont{mathnumbers}{EU2}{minionpro}{m}{n}
\SetSymbolFont{mathnumbers}{bold}{EU2}{minionpro}{bx}{n}
\DeclareMathSymbol{0}\mathalpha{mathnumbers}{"30}
\DeclareMathSymbol{1}\mathalpha{mathnumbers}{"31}
\DeclareMathSymbol{2}\mathalpha{mathnumbers}{"32}
\DeclareMathSymbol{3}\mathalpha{mathnumbers}{"33}
\DeclareMathSymbol{4}\mathalpha{mathnumbers}{"34}
\DeclareMathSymbol{5}\mathalpha{mathnumbers}{"35}
\DeclareMathSymbol{6}\mathalpha{mathnumbers}{"36}
\DeclareMathSymbol{7}\mathalpha{mathnumbers}{"37}
\DeclareMathSymbol{8}\mathalpha{mathnumbers}{"38}
\DeclareMathSymbol{9}\mathalpha{mathnumbers}{"39}

\DeclareSymbolFont{mathletters}{EU2}{minionpro}{m}{n}
\SetSymbolFont{mathletters}{normal}{EU2}{minionpro}{m}{it}
\SetSymbolFont{mathletters}{bold}{EU2}{minionpro}{bx}{it}
\DeclareMathSymbol{A}\mathalpha{mathletters}{"41}
\DeclareMathSymbol{B}\mathalpha{mathletters}{"42}
\DeclareMathSymbol{C}\mathalpha{mathletters}{"43}
\DeclareMathSymbol{D}\mathalpha{mathletters}{"44}
\DeclareMathSymbol{E}\mathalpha{mathletters}{"45}
\DeclareMathSymbol{F}\mathalpha{mathletters}{"46}
\DeclareMathSymbol{G}\mathalpha{mathletters}{"47}
\DeclareMathSymbol{H}\mathalpha{mathletters}{"48}
\DeclareMathSymbol{I}\mathalpha{mathletters}{"49}
\DeclareMathSymbol{J}\mathalpha{mathletters}{"4A}
\DeclareMathSymbol{K}\mathalpha{mathletters}{"4B}
\DeclareMathSymbol{L}\mathalpha{mathletters}{"4C}
\DeclareMathSymbol{M}\mathalpha{mathletters}{"4D}
\DeclareMathSymbol{N}\mathalpha{mathletters}{"4E}
\DeclareMathSymbol{O}\mathalpha{mathletters}{"4F}
\DeclareMathSymbol{P}\mathalpha{mathletters}{"50}
\DeclareMathSymbol{Q}\mathalpha{mathletters}{"51}
\DeclareMathSymbol{R}\mathalpha{mathletters}{"52}
\DeclareMathSymbol{S}\mathalpha{mathletters}{"53}
\DeclareMathSymbol{T}\mathalpha{mathletters}{"54}
\DeclareMathSymbol{U}\mathalpha{mathletters}{"55}
\DeclareMathSymbol{V}\mathalpha{mathletters}{"56}
\DeclareMathSymbol{W}\mathalpha{mathletters}{"57}
\DeclareMathSymbol{X}\mathalpha{mathletters}{"58}
\DeclareMathSymbol{Y}\mathalpha{mathletters}{"59}
\DeclareMathSymbol{Z}\mathalpha{mathletters}{"5A}
\DeclareMathSymbol{a}\mathalpha{mathletters}{"61}
\DeclareMathSymbol{b}\mathalpha{mathletters}{"62}
\DeclareMathSymbol{c}\mathalpha{mathletters}{"63}
\DeclareMathSymbol{d}\mathalpha{mathletters}{"64}
\DeclareMathSymbol{e}\mathalpha{mathletters}{"65}
\DeclareMathSymbol{f}\mathalpha{mathletters}{"66}
\DeclareMathSymbol{g}\mathalpha{mathletters}{"67}
\DeclareMathSymbol{h}\mathalpha{mathletters}{"68}
\DeclareMathSymbol{i}\mathalpha{mathletters}{"69}
\DeclareMathSymbol{j}\mathalpha{mathletters}{"6A}
\DeclareMathSymbol{k}\mathalpha{mathletters}{"6B}
\DeclareMathSymbol{l}\mathalpha{mathletters}{"6C}
\DeclareMathSymbol{m}\mathalpha{mathletters}{"6D}
\DeclareMathSymbol{n}\mathalpha{mathletters}{"6E}
\DeclareMathSymbol{o}\mathalpha{mathletters}{"6F}
\DeclareMathSymbol{p}\mathalpha{mathletters}{"70}
\DeclareMathSymbol{q}\mathalpha{mathletters}{"71}
\DeclareMathSymbol{r}\mathalpha{mathletters}{"72}
\DeclareMathSymbol{s}\mathalpha{mathletters}{"73}
\DeclareMathSymbol{t}\mathalpha{mathletters}{"74}
\DeclareMathSymbol{u}\mathalpha{mathletters}{"75}
\DeclareMathSymbol{v}\mathalpha{mathletters}{"76}
\DeclareMathSymbol{w}\mathalpha{mathletters}{"77}
\DeclareMathSymbol{x}\mathalpha{mathletters}{"78}
\DeclareMathSymbol{y}\mathalpha{mathletters}{"79}
\DeclareMathSymbol{z}\mathalpha{mathletters}{"7A}

\SetMathAlphabet{\mathrm}{normal}{EU2}{minionpro}{m}{n}
\SetMathAlphabet{\mathrm}{bold}{EU2}{minionpro}{bx}{n}
\SetMathAlphabet{\mathit}{normal}{EU2}{minionpro}{m}{it}
\SetMathAlphabet{\mathit}{bold}{EU2}{minionpro}{bx}{it}
\SetMathAlphabet{\mathbf}{normal}{EU2}{minionpro}{bx}{n}
\SetMathAlphabet{\mathbf}{bold}{EU2}{minionpro}{bx}{n}


Please give me hints if the above is incomplete or even wrong. Thank you.


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 3 guests