1
$\begingroup$

When I create an equation in MS Office, it uses Cambria Math, and I get the following when I use variable 'a'.

enter image description here

When I try to use Mathematica to create graphics for my files, I can try to use Text[] with Style["a",{Large,"Graphics"}] and it gives the following.

enter image description here

Well, that's no good. Let me use the same Font Face, so things look consistent.
Style["a",{Large,"Graphics",FontFamily -> "Cambria Math"}] gives:

enter image description here

Uhhhhhh.... I get that Mathematica uses this archaic style for the letter a, but how do I tell it to give me the same thing one would expect from using the same font face in two different places?


Edit: I turned off italic in the MS Office equation environment and it reverted from the script style to the antique style, so I tried turning on Italic in Mathematica, but that didn't work.
Style["a", {Large, Italic, "Graphics", FontFamily -> "Cambria Math"}]

enter image description here

$\endgroup$
  • 2
    $\begingroup$ MS Office clearly uses the italic version. Try this: Style[..., {FontSlant -> Italic, FontFamily -> "Cambria"}] You can also try using "Times" to make it swoopier. I like "Times" as a math font if I don't have the CMU fonts. $\endgroup$ – b3m2a1 Mar 20 at 21:31
  • 1
    $\begingroup$ I don't think Mathematica is finding (or using) the correct font when you specify "Cambria Math" $\endgroup$ – chuy Mar 20 at 21:54
  • $\begingroup$ Looking at the fonts on my system, I don't see an italic version of CM. I wonder then, when I ask for CM Italic, if MS Office is using Cambria Italic and Mathematica is going with some other fallback. Edit: Nope. Cambria Italic looks slightly different than what the MS equation environment is giving. $\endgroup$ – Travis Bemrose Mar 20 at 23:26
0
$\begingroup$

If you look at the fonts installed in Windows there is "Cambria Italic" font and "Cambria Math" which is not italic and very different. Try the code

Style["abcdefghijklmnopqrstuvwxyz", {Large, FontFamily -> "Cambria Italic"}]

which looks almost exactly the same as equation mode in Word. I did notice that in Word there is a gap between "f" and "g" and the serifs are slightly different and curvier. This is most noticeable in the "v" in Word. Other than that they are very close. An expert in fonts will be able to detect the difference right away, so there is still some mystery here. Where is the font that Word uses for equation variables?

I made a test document with "a" through "z" equation variables and saved it as a "docx" file. I looked at the XML files inside it and found reference to a few fonts but none of them looked exactly like ones used for Word equation variables. Still a mystery to me.

$\endgroup$
  • $\begingroup$ That code gives the same as ...{Large,Italic,FontFamily->"Cambria"}], which I've been using instead. You're right, it's close, but not the same. As to the font used in Word, all I can say is in this pic: i.stack.imgur.com/lv5v4.png $\endgroup$ – Travis Bemrose Mar 21 at 12:43
  • $\begingroup$ @TravisBemrose Any luck after a v12 update and/or using "Cambria Italic"/"Cambria Math" in place of "Cambria"? Also, what does evaluating $FontFamilies give you? $\endgroup$ – CA Trevillian Apr 20 at 21:22

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.