1
$\begingroup$

I would like to export my notebook to a PDF File. I was wondering if it is possible to keep the whole layout, like In[1]:= on the left side. The cell brackets on the right side, syntax highlighting etc. So the PDF should be pretty much like a screenshot.

Cheers

$\endgroup$
  • $\begingroup$ Have you tried "Save As" with PDF format? Alternatively you can print into a PDF using a suitable driver. $\endgroup$ – Yves Klett Mar 2 '16 at 12:40
  • $\begingroup$ I tried both, but in both cases it only prints the code, without the cells etc. $\endgroup$ – Peanut Mar 2 '16 at 12:43
  • $\begingroup$ Try to check "Print cell bracket" under "File->Printing Settings->Printing Options". The printing preview then shows a fairly good replica of the notebook for me... $\endgroup$ – Yves Klett Mar 2 '16 at 12:56
  • $\begingroup$ Thanks that worked! The only that is missing now is the syntax highlighting, however I think I can fix that. There is a related topic $\endgroup$ – Peanut Mar 2 '16 at 12:59
3
$\begingroup$

Try to check the following option: File->Printing Settings->Printing Options -> Print cell brackets->True (also available in the Option Inspector under "PrintCellBrackets").

Mathematica graphicsMathematica graphics

To keep syntax coloring etc., please have a look at: Saving a notebook as PDF, preserving syntax highlighting.

$\endgroup$
  • $\begingroup$ This command seems to work, to keep the styling: SetOptions[ SelectedNotebook[], PrintingStyleEnvironment -> "Printout", ShowSyntaxStyles -> True] $\endgroup$ – Peanut Mar 2 '16 at 13:36
  • $\begingroup$ @Peanut this is from the linked Q&A, right? Your question, while not a direct duplicate, benefits from the same solution. We might also mark as duplicate, but I am not sure if there is any benefit in doing so... $\endgroup$ – Yves Klett Mar 2 '16 at 13:39

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.