When exporting a notebook to HTML, the notebook's cells render as images, but the text is often squished. For example, this notebook:
... renders as
If I manually line-break the code, the picture looks ok. However, I'd prefer an automated solution.
Is there a magic incantation to give to Export
to have it break the lines before converting them to snapshots?
Thanks.
(There are links related to converting cells to text instead of images: 1, 2, 3. I don't mind the images, if only they didn't squish the text.)
Update 2: The problem was solved by resetting Mathematica to "factory defaults" by holding Alt+Shift while starting the program. More info Note: this wipes out everything in ~/Library/Mathematica
and /Library/Mathematica
, including any customizations to your init.m file in ~/Library/Mathematica/Kernel/init.m
.
Update: After some experimentation, it seems the line-breaking depends on the size of the notebook's window at the time it was exported to HTML.
To reproduce the problem reliably, try this example, which produces a sequence of longer and longer output lines:
Column[Table[Series[Exp[x], {x, 0, i}], {i, 20}]]
Notebook:
HTML output:
The situation can be helped by outputting to SVG instead of the default GIF, like this:
t = "SVG";
Export["foo.html", EvaluationNotebook[], "Graphics3DOutput" -> t, "GraphicsOutput" -> t, "ManipulateOutput" -> t, "MathOutput" -> t]
This produces a beautiful HTML page like this:
Column[Table[Series[Exp[x], {x, 0, i}], {i, 20}]]
$\endgroup$"MathOutput"
is the only option that might affect your examples. $\endgroup$~/Library/Mathematica
and/Library/Mathematica
, including any customizations to your init.m file in~/Library/Mathematica/Kernel/init.m
. $\endgroup$