Show More
@@ -1,158 +1,159 b'' | |||
|
1 | 1 | ((============================================================================ |
|
2 | 2 | NBConvert Sphinx-Latex Template |
|
3 | 3 | |
|
4 | 4 | Purpose: Allow export of PDF friendly Latex inspired by Sphinx. Most of the |
|
5 | 5 | template is derived directly from Sphinx source. |
|
6 | 6 | |
|
7 | 7 | Inheritance: null>display_priority>latex_base |
|
8 | 8 | |
|
9 | 9 | ==========================================================================)) |
|
10 | 10 | |
|
11 | 11 | ((*- extends 'latex_base.tplx' -*)) |
|
12 | 12 | |
|
13 | 13 | ((* block header *)) |
|
14 | 14 | % Header, overrides base |
|
15 | 15 | |
|
16 | 16 | % Make sure that the sphinx doc style knows who it inherits from. |
|
17 | 17 | \def\sphinxdocclass{(((parentdocumentclass)))} |
|
18 | 18 | |
|
19 | 19 | % Declare the document class |
|
20 | 20 | \documentclass[letterpaper,10pt,english]{sphinx(((documentclass)))} |
|
21 | 21 | |
|
22 | 22 | % Imports |
|
23 | 23 | \usepackage[utf8]{inputenc} |
|
24 | 24 | \DeclareUnicodeCharacter{00A0}{\\nobreakspace} |
|
25 | 25 | \usepackage[T1]{fontenc} |
|
26 | 26 | \usepackage{babel} |
|
27 | 27 | \usepackage{times} |
|
28 | 28 | \usepackage{import} |
|
29 | 29 | \usepackage[Bjarne]{fncychap} |
|
30 | 30 | \usepackage{longtable} |
|
31 | 31 | \usepackage{sphinx} |
|
32 | 32 | \usepackage{multirow} |
|
33 | 33 | |
|
34 | 34 | % Document level variables |
|
35 | 35 | \title{((( nb.metadata.name )))} |
|
36 | 36 | \date{\today} |
|
37 | 37 | \release{} |
|
38 | 38 | \author{Unknown Author} |
|
39 | 39 | \newcommand{\sphinxlogo}{} |
|
40 | 40 | \renewcommand{\releasename}{Release} |
|
41 | 41 | \makeindex |
|
42 | 42 | |
|
43 | 43 | |
|
44 | 44 | ((* block sphinxheader *))((* endblock sphinxheader *)) |
|
45 | 45 | |
|
46 | 46 | ((* endblock header *)) |
|
47 | 47 | |
|
48 | 48 | ((* block bodyBegin *)) |
|
49 | 49 | % Body |
|
50 | 50 | |
|
51 | 51 | % Start of the document |
|
52 | 52 | \begin{document} |
|
53 | 53 | \maketitle |
|
54 | 54 | \tableofcontents |
|
55 | 55 | |
|
56 | 56 | ((* endblock bodyBegin *))((* block bodyEnd *)) |
|
57 | 57 | |
|
58 | 58 | \renewcommand{\indexname}{Index} |
|
59 | 59 | \printindex |
|
60 | 60 | |
|
61 | 61 | % End of document |
|
62 | 62 | \end{document} |
|
63 | 63 | ((* endblock bodyEnd *)) |
|
64 | 64 | |
|
65 | 65 | % Footer |
|
66 | 66 | ((* block footer *)) |
|
67 | 67 | ((* endblock footer *)) |
|
68 | 68 | |
|
69 | 69 | ((* block headingcell -*)) |
|
70 | 70 | |
|
71 | 71 | ((*- if cell.level == 1 -*)) |
|
72 | 72 | \part |
|
73 | 73 | ((*- elif cell.level == 2 -*)) |
|
74 | 74 | \chapter |
|
75 | 75 | ((*- elif cell.level == 3 -*)) |
|
76 | 76 | \section |
|
77 | 77 | ((*- elif cell.level == 4 -*)) |
|
78 | 78 | \subsection |
|
79 | 79 | ((*- elif cell.level == 5 -*)) |
|
80 | 80 | \subsubsection |
|
81 | 81 | ((*- elif cell.level == 6 -*)) |
|
82 | 82 | \paragraph |
|
83 | 83 | ((*- endif -*)){((( filterOutLatex(cell.source) )))} |
|
84 | 84 | ((*- endblock headingcell *)) |
|
85 | 85 | |
|
86 | 86 | ((*- block rawcell -*)) |
|
87 | 87 | ((("\n"))) |
|
88 | 88 | |
|
89 | 89 | \setbox0\vbox{ |
|
90 | 90 | \begin{minipage}{0.95\linewidth} |
|
91 | 91 | ((( filterOutLatex(cell.source) ))) |
|
92 | 92 | \end{minipage}} |
|
93 | 93 | \begin{center}\setlength{\fboxsep}{5pt} |
|
94 | 94 | \shadowbox{\box0}\end{center} |
|
95 | 95 | |
|
96 | 96 | ((*- endblock rawcell -*)) |
|
97 | 97 | |
|
98 | 98 | ((*- block unknowncell scoped-*)) |
|
99 | 99 | ((("\n"))) |
|
100 | 100 | |
|
101 | 101 | % Unsupported cell type, no formatting |
|
102 | 102 | ((( filterOutLatex(cell.source) ))) |
|
103 | 103 | ((*- endblock unknowncell -*)) |
|
104 | 104 | |
|
105 | ((*- block markdowncell scoped-*)) | |
|
106 | ((( super() ))) | |
|
107 | ((*- endblock markdowncell -*)) | |
|
108 | ||
|
105 | 109 | ((* macro filterOutLatex(text) -*)) |
|
106 | 110 | ((*- set text = text|replace("\\","\\backslash") -*)) |
|
107 | 111 | ((*- set text = text|replace("{","\\{") -*)) |
|
108 | 112 | ((*- set text = text|replace("}","\\}") -*)) |
|
109 | 113 | ((*- set text = text|replace("|","\\vert") -*)) |
|
110 | 114 | ((( text ))) |
|
111 | 115 | ((*- endmacro *)) |
|
112 | 116 | |
|
113 | 117 | ((======================================================================== |
|
114 | 118 | EVERYTHING BELOW HERE STILL NEEDS TO BE FILLED IN! |
|
115 | 119 | ========================================================================)) |
|
116 | 120 | |
|
117 | 121 | ((*- block codecell scoped -*)) |
|
118 | 122 | ((*- block input_group -*)) |
|
119 | 123 | ((*- block in_prompt -*))((*- endblock in_prompt -*)) |
|
120 | 124 | ((*- block input -*))((*- endblock input -*)) |
|
121 | 125 | ((*- endblock input_group -*)) |
|
122 | 126 | ((*- if cell.outputs -*)) |
|
123 | 127 | ((*- block output_group -*)) |
|
124 | 128 | ((*- block output_prompt -*))((*- endblock output_prompt -*)) |
|
125 | 129 | ((*- block outputs -*)) |
|
126 | 130 | ((*- for output in cell.outputs -*)) |
|
127 | 131 | ((*- if output.output_type in ['pyout'] -*)) |
|
128 | 132 | ((*- block pyout scoped -*))((*- endblock pyout -*)) |
|
129 | 133 | ((*- elif output.output_type in ['stream'] -*)) |
|
130 | 134 | ((*- block stream scoped -*)) |
|
131 | 135 | ((*- if output.stream in ['stdout'] -*)) |
|
132 | 136 | ((*- block stream_stdout scoped -*)) |
|
133 | 137 | ((*- endblock stream_stdout -*)) |
|
134 | 138 | ((*- elif output.stream in ['stderr'] -*)) |
|
135 | 139 | ((*- block stream_stderr scoped -*)) |
|
136 | 140 | ((*- endblock stream_stderr -*)) |
|
137 | 141 | ((*- endif -*)) |
|
138 | 142 | ((*- endblock stream -*)) |
|
139 | 143 | ((*- elif output.output_type in ['display_data'] -*)) |
|
140 | 144 | ((*- block display_data scoped -*)) |
|
141 | 145 | ((*- block data_priority scoped -*)) |
|
142 | 146 | ((*- endblock data_priority -*)) |
|
143 | 147 | ((*- endblock display_data -*)) |
|
144 | 148 | ((*- elif output.output_type in ['pyerr'] -*)) |
|
145 | 149 | ((*- block pyerr scoped -*)) |
|
146 | 150 | ((*- for line in output.traceback -*)) |
|
147 | 151 | ((*- block traceback_line scoped -*))((*- endblock traceback_line -*)) |
|
148 | 152 | ((*- endfor -*)) |
|
149 | 153 | ((*- endblock pyerr -*)) |
|
150 | 154 | ((*- endif -*)) |
|
151 | 155 | ((*- endfor -*)) |
|
152 | 156 | ((*- endblock outputs -*)) |
|
153 | 157 | ((*- endblock output_group -*)) |
|
154 | 158 | ((*- endif -*)) |
|
155 | 159 | ((*- endblock codecell -*)) |
|
156 | ||
|
157 | ((*- block markdowncell scoped-*)) | |
|
158 | ((*- endblock markdowncell -*)) |
General Comments 0
You need to be logged in to leave comments.
Login now