12
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ See this and all comments that follow. $\endgroup$
    – QuantumDot
    Nov 14, 2016 at 15:19
  • $\begingroup$ @QuantumDot Would you like to summarize that in an answer? $\endgroup$
    – Szabolcs
    Nov 15, 2016 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, 2016 at 20:45

1 Answer 1

10
+300
$\begingroup$

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}">
    <![CDATA[
        If[Not@MemberQ[$Path, #], PrependTo[$Path, #]]&@AntProperty["appPath"]
        Needs@"DocumentationBuild`"
        ConvertGraphicsToBitmaps = Null&
    ]]> 
</mathematica>

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.

$\endgroup$
1

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.