4
$\begingroup$

There are a number of issues that I encounter when I try to use my own stylesheet and publish on the cloud. The document looks great on the Mathematica running on my desktop. But when I publish to the cloud, lots of things break, especially with regard to fonts. This makes publishing to the cloud unusable currently for me.

Here is the first problem. This code snippet creates a simple notebook containing a cell of style "MyText", which it then publishes on the cloud.

myStyle = Notebook[{
    Cell[StyleData["MyText"], 
     FontFamily -> "EB Garamond",
     FontSize -> 24
     ]
    }];
myStyle = Export["mystyle.nb", myStyle];
myNB = CreateDocument[
   Cell[TextData[{"Hello! This is a MyText cell. It would be nice if \
it looks the same,  including the inline formula ", 
      Cell[BoxData[
        FormBox[RowBox[{SuperscriptBox["x", "2"], "=", 
           RowBox[{RowBox[{"a", " ", "b"}], " ", "+", " ", "c"}]}], 
         TraditionalForm]], FormatType -> "TraditionalForm"], 
      ", in the desktop app as in the cloud."}], "MyText"]];
SetOptions[myNB, StyleDefinitions -> Get[myStyle]];
CloudDeploy[myNB] // SystemOpen

Here's how it looks like on my desktop:

enter image description here

Here's how it looks like on the cloud, in Google Chrome. Note that the math is rendered differently.

enter image description here

If we open up Developer Tools in Chrome, we can try find out what is going on with the math glyphs:

enter image description here

It is not rendering correctly. It seems that in the desktop app, the "a" character is rendered in Garamond italic while on the cloud it is rendered in Garamond regular.

By the way, I wish it were possible to make Mathematica render all math --- including inline math inside text blocks, made using Ctrl + ( and ) --- with a fixed specialized math font, like the STIX fonts. Let prose fonts be handled by prose fonts, and leave math to the specialist fonts.

Update. If I add the SingleLetterItalics -> True option to the Cell, then I get the following result in the cloud on the browser:

enter image description here

On the desktop, it looks like this:

enter image description here

It's using different italic glyphs on the cloud somehow. And it makes quite a big difference, because on the desktop, the italic glyphs look correct in math, while in the cloud, the italic glyphs are just usual slanted regular Garamond text, which don't look correct in math.

$\endgroup$

1 Answer 1

1
$\begingroup$

Please add SingleLetterItalics -> True, i.e.:

myStyle = 
  Notebook[{Cell[StyleData["MyText"], FontFamily -> "EB Garamond", 
     SingleLetterItalics -> True, FontSize -> 24]}];

then all is fine. By the way: I think in Mathematica there should be no italic single letters, since it is not asked for in the StyleData of "MyText". It might have to do with unclear inheritance issues ("design") of the Stylesheet mechanism. But I am not sure. Call Wolfram.

$\endgroup$
4
  • $\begingroup$ Thanks. But when I make this change to the above code, the rendered font in the equation is in italics, but not the same italics as in the desktop. I have updated my question to give a screenshot. $\endgroup$ Apr 27, 2020 at 14:48
  • $\begingroup$ What did Wolfram answer? I think they are working on improving those style details. $\endgroup$ Apr 27, 2020 at 15:20
  • $\begingroup$ I have contacted them and they are looking into it. $\endgroup$ Apr 27, 2020 at 15:57
  • $\begingroup$ Hi Bruce, did you ever hear back? I am having a similar rendering problem: community.wolfram.com/groups/-/m/t/2309707?p_p_auth=xf8LNRmV $\endgroup$ Jul 11, 2021 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.