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:
Here's how it looks like on the cloud, in Google Chrome. Note that the math is rendered differently.
If we open up Developer Tools in Chrome, we can try find out what is going on with the math glyphs:
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:
On the desktop, it looks like this:
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.