3
$\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$
0
$\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.

| improve this answer | |
$\endgroup$
  • $\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$ – Bruce Bartlett Apr 27 at 14:48
  • $\begingroup$ What did Wolfram answer? I think they are working on improving those style details. $\endgroup$ – Rolf Mertig Apr 27 at 15:20
  • $\begingroup$ I have contacted them and they are looking into it. $\endgroup$ – Bruce Bartlett Apr 27 at 15:57

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.