1

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

Peanut
  • 307
  • 1
  • 9
  • Have you tried "Save As" with PDF format? Alternatively you can print into a PDF using a suitable driver. – Yves Klett Mar 02 '16 at 12:40
  • I tried both, but in both cases it only prints the code, without the cells etc. – Peanut Mar 02 '16 at 12:43
  • 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... – Yves Klett Mar 02 '16 at 12:56
  • 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 – Peanut Mar 02 '16 at 12:59

1 Answers1

3

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.

Yves Klett
  • 15,383
  • 5
  • 57
  • 124
  • This command seems to work, to keep the styling: SetOptions[ SelectedNotebook[], PrintingStyleEnvironment -> "Printout", ShowSyntaxStyles -> True] – Peanut Mar 02 '16 at 13:36
  • @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... – Yves Klett Mar 02 '16 at 13:39