When building documentation using the Workbench, some of the output cells get fully rasterized. I assume this is done to save space.

enter image description here

Can I turn this off, either globally, or on a per-cell basis? I want to keep certain output as vector graphics.

  • $\begingroup$ See this and all comments that follow. $\endgroup$ – QuantumDot Nov 14 '16 at 15:19
  • $\begingroup$ @QuantumDot Would you like to summarize that in an answer? $\endgroup$ – Szabolcs Nov 15 '16 at 17:16
  • $\begingroup$ In buildDocumentation I've added "ConvertGraphicsToBitmaps" option. It doesn't do anything sophisticated, on False it just Blocks ConvertGraphicsToBitmaps function and replaces it with function doing nothing. $\endgroup$ – jkuczm Nov 19 '16 at 20:45

I don't know any option that would control this behavior, but there are hacks that can completely prevent this rasterization.

Rasterization is performed by ConvertGraphicsToBitmaps function from DocumentationBuild`Common` package. This function performs rasterization of output cells from given NotebookObject and returns Null, that's all it does, so we can safely override it with function that only returns Null.

For this override to take effect during documentation build, governed by docbuild.xml file, we can add following code, right before <ant antfile="${appPath}/DocumentationBuild/SystemFiles/ant/Build/notebook.xml" line:

<mathematica exe="${mathExe}">
        If[Not@MemberQ[$Path, #], PrependTo[$Path, #]]&@AntProperty["appPath"]
        ConvertGraphicsToBitmaps = Null&

First line adds directory containing documentation building packages to $Path (this directory is stored in Ant "appPath" property), second line loads DocumentationBuild` package, third overrides relevant function.


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.