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:
  1. \documentclass{article}
  2.  
  3. \usepackage[no-math] {fontspec}
  4. \setmainfont{Minion Pro}
  5.  
  6. \usepackage{MnSymbol}
  7. \usepackage{unicode-math}
  8.  
  9. \setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro}
  10. \setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{MinionPro-Bold}
  11. \setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]{MinionPro-It}
  12. \setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}]{MinionPro-BoldIt}
  13.  
  14. \begin{document}
  15. A formula:
  16. \[\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}}\]
  17.  
  18. and another one:
  19. \[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}\]
  20. \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:
  1. \setmathfont[range=\mathup/{"2211}]{MnSymbol5}
  2. \setmathfont[range=\mathbfup/{"2211}]{MnSymbol5}
  3. \setmathfont[range=\mathit/{"2211}]{MnSymbol5}
  4. \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!

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

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

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

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.
  1. \documentclass{article}
  2. \usepackage[MnSymbol]{mathspec}
  3.  
  4. \setmainfont{Minion Pro}
  5. \setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro}
  6. \setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{MinionPro-Bold}
  7. \setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]{MinionPro-It}
  8. \setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}]{MinionPro-BoldIt}
  9.  
  10. \begin{document}
  11. A formula:
  12. \[
  13. \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}}
  14. \]
  15.  
  16. and another one:
  17. \[
  18. 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}
  19. \]
  20. \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

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

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

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 14691 times

It's qite the same as i would compile the following code with lualatex:
  1. \documentclass{article}
  2. \usepackage[no-math]{fontspec}
  3. \usepackage{MnSymbol}
  4. \setmainfont{Minion Pro}
  5.  
  6. \begin{document}
  7. A formula:
  8. \[\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}}\]
  9.  
  10. and another one:
  11. \[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}\]
  12. \end{document}

Because with that i get this:
LualatexSimple.png
LualatexSimple.png (19.67 KiB) Viewed 14691 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 14691 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.:
  1. \documentclass{article}
  2.  
  3. \usepackage[no-math] {fontspec}
  4. \usepackage{unicode-math}
  5. \setmainfont{Minion Pro}
  6.  
  7. \setmathfont{xits-math.otf} % replace with MnSymbol5 --> failure
  8. \setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro}
  9. \setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{MinionPro-Bold}
  10. \setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]{MinionPro-It}
  11. \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:
  1. \documentclass{article}
  2. \usepackage[MnSymbol]{mathspec}
  3.  
  4. \setmainfont{Minion Pro}
  5. \setallmainfonts(Digits,Latin,Greek)[Numbers={Lining,Proportional,Monospaced}]{Minion Pro}
  6. \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

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 13653 times


And here's how to set it up:
  1. \usepackage{amsmath}
  2. \usepackage[adobe-utopia]{mathdesign}
  3.  
  4. \pdfprotrudechars2
  5. \pdfadjustspacing2
  6. \usepackage{luaotfload}
  7. \usepackage[EU2]{fontenc}
  8.  
  9. \DeclareFontFamily{EU2}{minionpro}{}
  10. \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;"}{}
  11. \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;"}{}
  12. \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;"}{}
  13. \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;"}{}
  14. \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;"}{}
  15.  
  16. \renewcommand{\rmdefault}{minionpro}
  17.  
  18. \DeclareSymbolFont{mathnumbers}{EU2}{minionpro}{m}{n}
  19. \SetSymbolFont{mathnumbers}{bold}{EU2}{minionpro}{bx}{n}
  20. \DeclareMathSymbol{0}\mathalpha{mathnumbers}{"30}
  21. \DeclareMathSymbol{1}\mathalpha{mathnumbers}{"31}
  22. \DeclareMathSymbol{2}\mathalpha{mathnumbers}{"32}
  23. \DeclareMathSymbol{3}\mathalpha{mathnumbers}{"33}
  24. \DeclareMathSymbol{4}\mathalpha{mathnumbers}{"34}
  25. \DeclareMathSymbol{5}\mathalpha{mathnumbers}{"35}
  26. \DeclareMathSymbol{6}\mathalpha{mathnumbers}{"36}
  27. \DeclareMathSymbol{7}\mathalpha{mathnumbers}{"37}
  28. \DeclareMathSymbol{8}\mathalpha{mathnumbers}{"38}
  29. \DeclareMathSymbol{9}\mathalpha{mathnumbers}{"39}
  30.  
  31. \DeclareSymbolFont{mathletters}{EU2}{minionpro}{m}{n}
  32. \SetSymbolFont{mathletters}{normal}{EU2}{minionpro}{m}{it}
  33. \SetSymbolFont{mathletters}{bold}{EU2}{minionpro}{bx}{it}
  34. \DeclareMathSymbol{A}\mathalpha{mathletters}{"41}
  35. \DeclareMathSymbol{B}\mathalpha{mathletters}{"42}
  36. \DeclareMathSymbol{C}\mathalpha{mathletters}{"43}
  37. \DeclareMathSymbol{D}\mathalpha{mathletters}{"44}
  38. \DeclareMathSymbol{E}\mathalpha{mathletters}{"45}
  39. \DeclareMathSymbol{F}\mathalpha{mathletters}{"46}
  40. \DeclareMathSymbol{G}\mathalpha{mathletters}{"47}
  41. \DeclareMathSymbol{H}\mathalpha{mathletters}{"48}
  42. \DeclareMathSymbol{I}\mathalpha{mathletters}{"49}
  43. \DeclareMathSymbol{J}\mathalpha{mathletters}{"4A}
  44. \DeclareMathSymbol{K}\mathalpha{mathletters}{"4B}
  45. \DeclareMathSymbol{L}\mathalpha{mathletters}{"4C}
  46. \DeclareMathSymbol{M}\mathalpha{mathletters}{"4D}
  47. \DeclareMathSymbol{N}\mathalpha{mathletters}{"4E}
  48. \DeclareMathSymbol{O}\mathalpha{mathletters}{"4F}
  49. \DeclareMathSymbol{P}\mathalpha{mathletters}{"50}
  50. \DeclareMathSymbol{Q}\mathalpha{mathletters}{"51}
  51. \DeclareMathSymbol{R}\mathalpha{mathletters}{"52}
  52. \DeclareMathSymbol{S}\mathalpha{mathletters}{"53}
  53. \DeclareMathSymbol{T}\mathalpha{mathletters}{"54}
  54. \DeclareMathSymbol{U}\mathalpha{mathletters}{"55}
  55. \DeclareMathSymbol{V}\mathalpha{mathletters}{"56}
  56. \DeclareMathSymbol{W}\mathalpha{mathletters}{"57}
  57. \DeclareMathSymbol{X}\mathalpha{mathletters}{"58}
  58. \DeclareMathSymbol{Y}\mathalpha{mathletters}{"59}
  59. \DeclareMathSymbol{Z}\mathalpha{mathletters}{"5A}
  60. \DeclareMathSymbol{a}\mathalpha{mathletters}{"61}
  61. \DeclareMathSymbol{b}\mathalpha{mathletters}{"62}
  62. \DeclareMathSymbol{c}\mathalpha{mathletters}{"63}
  63. \DeclareMathSymbol{d}\mathalpha{mathletters}{"64}
  64. \DeclareMathSymbol{e}\mathalpha{mathletters}{"65}
  65. \DeclareMathSymbol{f}\mathalpha{mathletters}{"66}
  66. \DeclareMathSymbol{g}\mathalpha{mathletters}{"67}
  67. \DeclareMathSymbol{h}\mathalpha{mathletters}{"68}
  68. \DeclareMathSymbol{i}\mathalpha{mathletters}{"69}
  69. \DeclareMathSymbol{j}\mathalpha{mathletters}{"6A}
  70. \DeclareMathSymbol{k}\mathalpha{mathletters}{"6B}
  71. \DeclareMathSymbol{l}\mathalpha{mathletters}{"6C}
  72. \DeclareMathSymbol{m}\mathalpha{mathletters}{"6D}
  73. \DeclareMathSymbol{n}\mathalpha{mathletters}{"6E}
  74. \DeclareMathSymbol{o}\mathalpha{mathletters}{"6F}
  75. \DeclareMathSymbol{p}\mathalpha{mathletters}{"70}
  76. \DeclareMathSymbol{q}\mathalpha{mathletters}{"71}
  77. \DeclareMathSymbol{r}\mathalpha{mathletters}{"72}
  78. \DeclareMathSymbol{s}\mathalpha{mathletters}{"73}
  79. \DeclareMathSymbol{t}\mathalpha{mathletters}{"74}
  80. \DeclareMathSymbol{u}\mathalpha{mathletters}{"75}
  81. \DeclareMathSymbol{v}\mathalpha{mathletters}{"76}
  82. \DeclareMathSymbol{w}\mathalpha{mathletters}{"77}
  83. \DeclareMathSymbol{x}\mathalpha{mathletters}{"78}
  84. \DeclareMathSymbol{y}\mathalpha{mathletters}{"79}
  85. \DeclareMathSymbol{z}\mathalpha{mathletters}{"7A}
  86.  
  87. \SetMathAlphabet{\mathrm}{normal}{EU2}{minionpro}{m}{n}
  88. \SetMathAlphabet{\mathrm}{bold}{EU2}{minionpro}{bx}{n}
  89. \SetMathAlphabet{\mathit}{normal}{EU2}{minionpro}{m}{it}
  90. \SetMathAlphabet{\mathit}{bold}{EU2}{minionpro}{bx}{it}
  91. \SetMathAlphabet{\mathbf}{normal}{EU2}{minionpro}{bx}{n}
  92. \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 1 guest