5
$\begingroup$

Alright, so I am trying to export a homework assignment in full color. I tried simply saving as a pdf, however I lost my frame color. Is there a SetOptions[] command that I am missing to retain this color seen in the first image?

Notebook Image 1^^

PDF Image 2^^

Edited Style Image 3^^

Thanks, I appreciate any help with this issue.

$\endgroup$
  • 2
    $\begingroup$ For one I'd report this as a bug to Wolfram $\endgroup$ – user6014 Sep 1 '18 at 2:35
3
$\begingroup$

When saving to PDF, Mathematica uses the Printout ScreenStyleEnvironment. So, if you want to see what the PDF will look like, you should switch to the Printout environment by using the menu item Format | Screen Environment | Printout. If you do this, you will see that the colors in the Printout environment are what you see in the PDF document.

The above explains why the colors are different. To change this, you can either force the document to be saved using the Workout environment, or you can modify the stylesheet. I will show how to change the stylesheet. First, let's see what the changes are to the "Section" style when you switch environments. Here is the Workout environment "Section" CellFrameColor option:

CurrentValue[
    EvaluationNotebook[],
    {StyleDefinitions,{"Section", "Working"}, CellFrameColor}
]

RGBColor[0.500008, 0.500008, 0.749996]

And here is the Printout environment "Section" CellFrameColor option:

CurrentValue[
    EvaluationNotebook[],
    {StyleDefinitions, {"Section", "Printout"}, CellFrameColor}
]

GrayLevel[0.6]

Go to the style sheet (using Format | Edit Stylesheet...) and in the "Enter a style name" input field, type Section. You should see something like:

enter image description here

Use the menu item Cell | Show Expression (or the equivalent keyboard shortcut) on the Section cell:

enter image description here

Change it to something like:

Cell[StyleData["Section", "Printout"],
 CellFrameColor -> RGBColor[0.500008, 0.500008, 0.749996]
]

Use Cell | Show Expression again to toggle back, and then your Printout environment will now have the same color Section frame as in the Working environment. This should cause the PDF to use those colors as well.

$\endgroup$
  • $\begingroup$ Thanks! This did the charm! One slight catch though. When I toggle back into the working screen environment, the frame color is now reverted back to default. This is not the end of the world, because it prints out the way I want. Any thought as to how to have it look correct in both places? Thanks. $\endgroup$ – MGoforth Sep 2 '18 at 13:40
  • $\begingroup$ Much simpler is to set PrintingStyleEnvironment to "Working". $\endgroup$ – Alexey Popkov Sep 16 '18 at 9:07

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.