Created
June 20, 2014 08:25
-
-
Save andreabedini/acc3c9c18eb148533273 to your computer and use it in GitHub Desktop.
Mathematica snippet to mass-export to pdf all notebooks in a directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myPrintNotebook[filename_String] := Block[{nbo, pdfnamne}, | |
nbo = NotebookOpen[ToFileName[Directory[], filename], | |
Visible -> False]; | |
FrontEndExecute[FrontEndToken[nbo, "SelectAll"]]; | |
FrontEndTokenExecute[nbo, "SelectionOpenAllGroups"]; | |
pdfname = StringReplace[filename, ".nb" -> "_nb.pdf"]; | |
Export[pdfname, nbo, "PDF"]; | |
Print["saving to ", pdfname]; | |
NotebookClose[nbo]; | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment