forked from episanty/RB-SFA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPDFexporter.m
executable file
·44 lines (34 loc) · 1.2 KB
/
PDFexporter.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(* ::Package:: *)
(*
This file is for internal handling and is used to create
pdf printouts of the main code notebook RB-SFA.nb and the
Usage and Examples.nb notebook.
It can be run directly from the terminal with the command
MathKernel -script PDFexporter.m
or it can be run directly from Mathematica.
*)
directory=Quiet[Check[NotebookDirectory[],DirectoryName[$InputFileName]],{FrontEndObject::notavail}];
Export[
FileNameJoin[{directory,"RB-SFA.pdf"}],
Import[FileNameJoin[{directory,"RB-SFA.nb"}]]/.{Closed->Open}
];
Export[
FileNameJoin[{directory,"Usage and Examples.pdf"}],
Import[FileNameJoin[{directory,"Usage and Examples.nb"}]]/.{
Cell[CellGroupData[{
Cell[contents__,CellTags->"Collapse-to-print"],otherCells___
},Closed]]->Cell[CellGroupData[{
Cell[contents,CellTags->"Collapse-to-print"],otherCells
},TempClosed]]
}/.{Closed->Open,TempClosed->Closed}
];
Export[
FileNameJoin[{directory,"Quantum Orbits Usage.pdf"}],
Import[FileNameJoin[{directory,"Quantum Orbits Usage.nb"}]]/.{
Cell[CellGroupData[{
Cell[contents__,CellTags->"Collapse-to-print"],otherCells___
},Closed]]->Cell[CellGroupData[{
Cell[contents,CellTags->"Collapse-to-print"],otherCells
},TempClosed]]
}/.{Closed->Open,TempClosed->Closed}
];