Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a simple way to export all open notebooks to pdfs? Also, when I export notebooks the font looks too big / the margins are too big. Can I change these settings when exporting?

share|improve this question
up vote 1 down vote accepted

This could be a basic code for this:

(* SetDirectory[] ??? Here you could set a directory to write the files... *)
    name=Check[NotebookFileName[nb], "NotSaved.nb", NotebookFileName::nosv];
    (* Set the stylesheet that fit your needs *)
    iniStyle = StyleDefinitions /. Options[nb];
share|improve this answer
How do I change the font size? And this looks like it will change my working notebook styles. I don't want to change those. I just want the font size smaller in the exported pdf, but not in the actual notebook while I am working in mathematica. – nullUser Dec 4 '13 at 17:42
I edited the code so that leaves the initial stylesheet. I don't know the exact style that you want to modify. The easy way could be edit the actual stylesheet a save as new one (you should change "Default.nb" for this) a edit the "printout" style that you need. – SMiranda Dec 4 '13 at 18:16

If you evaluate this:

 StyleDefinitions -> 
  Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData[All, "Printout"], Magnification -> 1, 
     FontSize -> 12]}, 
   StyleDefinitions -> "PrivateStylesheetFormatting.nb"]]

You can adjust magnification and font size accordingly (and include cell margins if needed). For this to work you need to have your printing environment set to "Printout". The fact that your fonts are too big makes me think your printing environment is set to another mode. Ideally your would adjust this in your stylesheet.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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