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$
4
  • $\begingroup$ Have you tried "Save As" with PDF format? Alternatively you can print into a PDF using a suitable driver. $\endgroup$ Commented Mar 2, 2016 at 12:40
  • $\begingroup$ I tried both, but in both cases it only prints the code, without the cells etc. $\endgroup$ Commented Mar 2, 2016 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$ Commented Mar 2, 2016 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$ Commented Mar 2, 2016 at 12:59

1 Answer 1

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$
2
  • $\begingroup$ This command seems to work, to keep the styling: SetOptions[ SelectedNotebook[], PrintingStyleEnvironment -> "Printout", ShowSyntaxStyles -> True] $\endgroup$ Commented Mar 2, 2016 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$ Commented Mar 2, 2016 at 13:39

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.