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