When building documentation using the Workbench, some of the output cells get fully rasterized. I assume this is done to save space.
Can I turn this off, either globally, or on a per-cell basis? I want to keep certain output as vector graphics.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI 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.
buildDocumentation
I've added"ConvertGraphicsToBitmaps"
option. It doesn't do anything sophisticated, onFalse
it justBlock
sConvertGraphicsToBitmaps
function and replaces it with function doing nothing. $\endgroup$