Show More
@@ -1,128 +1,136 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 | % Header, overrides base |
|
13 | % Header, overrides base | |
14 | ((* block header *)) |
|
14 | ((* block header *)) | |
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 | % Body |
|
48 | % Body | |
49 | ((* block bodyBegin *)) |
|
49 | ((* block bodyBegin *)) | |
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 | ((* endblock bodyBegin *)) |
|
55 | ((* endblock bodyBegin *)) | |
56 | ((* block bodyEnd *)) |
|
56 | ((* block bodyEnd *)) | |
57 |
|
57 | |||
58 |
|
58 | |||
59 | \renewcommand{\indexname}{Index} |
|
59 | \renewcommand{\indexname}{Index} | |
60 | \printindex |
|
60 | \printindex | |
61 | \end{document} |
|
61 | \end{document} | |
62 | ((* endblock bodyEnd *)) |
|
62 | ((* endblock bodyEnd *)) | |
63 |
|
63 | |||
64 | % Footer |
|
64 | % Footer | |
65 | ((* block footer *)) |
|
65 | ((* block footer *)) | |
66 | ((* endblock footer *)) |
|
66 | ((* endblock footer *)) | |
67 |
|
67 | |||
68 |
((*- block |
|
68 | ((*- block headingcell-*)) | |
69 | ((( cell.source))) |
|
69 | ||
70 |
((*- if cell. |
|
70 | ((*- if cell.level == 1 -*)) | |
|
71 | \part | |||
|
72 | ((*- elif cell.level == 2 -*)) | |||
|
73 | \chapter | |||
|
74 | ((*- elif cell.level == 3 -*)) | |||
|
75 | \section | |||
|
76 | ((*- elif cell.level == 4 -*)) | |||
|
77 | \subsection | |||
|
78 | ((*- elif cell.level == 5 -*)) | |||
|
79 | \subsubsection | |||
|
80 | ((*- elif cell.level == 6 -*)) | |||
|
81 | \paragraph | |||
|
82 | ((*- endif -*)){((( cell.source )))} | |||
|
83 | ((*- endblock headingcell -*)) | |||
71 |
|
84 | |||
72 |
|
|
85 | ((*- block codecell scoped -*)) | |
73 |
|
|
86 | ((*- block input_group -*)) | |
74 |
|
|
87 | ((*- block in_prompt -*))((*- endblock in_prompt -*)) | |
75 |
|
|
88 | ((*- block input -*))((*- endblock input -*)) | |
76 |
|
|
89 | ((*- endblock input_group -*)) | |
77 |
|
|
90 | ((*- if cell.outputs -*)) | |
78 |
|
|
91 | ((*- block output_group -*)) | |
79 |
|
|
92 | ((*- block output_prompt -*))((*- endblock output_prompt -*)) | |
80 |
|
|
93 | ((*- block outputs -*)) | |
81 |
|
|
94 | ((*- for output in cell.outputs -*)) | |
82 |
|
|
95 | ((*- if output.output_type in ['pyout'] -*)) | |
83 |
|
|
96 | ((*- block pyout scoped -*))((*- endblock pyout -*)) | |
84 |
|
|
97 | ((*- elif output.output_type in ['stream'] -*)) | |
85 |
|
|
98 | ((*- block stream scoped -*)) | |
86 |
|
|
99 | ((*- if output.stream in ['stdout'] -*)) | |
87 |
|
|
100 | ((*- block stream_stdout scoped -*)) | |
88 |
|
|
101 | ((*- endblock stream_stdout -*)) | |
89 |
|
|
102 | ((*- elif output.stream in ['stderr'] -*)) | |
90 |
|
|
103 | ((*- block stream_stderr scoped -*)) | |
91 |
|
|
104 | ((*- endblock stream_stderr -*)) | |
92 |
|
|
105 | ((*- endif -*)) | |
93 |
|
|
106 | ((*- endblock stream -*)) | |
94 |
|
|
107 | ((*- elif output.output_type in ['display_data'] -*)) | |
95 |
|
|
108 | ((*- block display_data scoped -*)) | |
96 |
|
|
109 | ((*- block data_priority scoped -*)) | |
97 |
|
|
110 | ((*- endblock data_priority -*)) | |
98 |
|
|
111 | ((*- endblock display_data -*)) | |
99 |
|
|
112 | ((*- elif output.output_type in ['pyerr'] -*)) | |
100 |
|
|
113 | ((*- block pyerr scoped -*)) | |
101 |
|
|
114 | ((*- for line in output.traceback -*)) | |
102 |
|
|
115 | ((*- block traceback_line scoped -*))((*- endblock traceback_line -*)) | |
103 |
|
|
116 | ((*- endfor -*)) | |
104 |
|
|
117 | ((*- endblock pyerr -*)) | |
105 |
|
|
118 | ((*- endif -*)) | |
106 |
|
|
119 | ((*- endfor -*)) | |
107 |
|
|
120 | ((*- endblock outputs -*)) | |
108 |
|
|
121 | ((*- endblock output_group -*)) | |
109 |
|
|
122 | ((*- endif -*)) | |
110 |
|
|
123 | ((*- endblock codecell -*)) | |
111 | ((*- elif cell.type in ['markdown'] -*)) |
|
|||
112 |
|
124 | |||
113 |
|
|
125 | ((*- block markdowncell scoped-*)) | |
|
126 | %TODO: Get this working! | |||
114 |
|
|
127 | ((*- endblock markdowncell -*)) | |
115 | ((*- elif cell.type in ['heading'] -*)) |
|
|||
116 |
|
128 | |||
117 | ((*- block headingcell scoped-*)) |
|
|||
118 | ((*- endblock headingcell -*)) |
|
|||
119 | ((*- elif cell.type in ['raw'] -*)) |
|
|||
120 |
|
129 | |||
121 |
|
|
130 | ((*- block rawcell scoped-*)) | |
|
131 | ||||
122 |
|
|
132 | ((*- endblock rawcell -*)) | |
123 | ((*- else -*)) |
|
|||
124 |
|
133 | |||
125 |
|
|
134 | ((*- block unknowncell scoped-*)) | |
|
135 | ||||
126 |
|
|
136 | ((*- endblock unknowncell -*)) | |
127 | ((*- endif -*)) |
|
|||
128 | ((*- endblock any_cell -*)) |
|
General Comments 0
You need to be logged in to leave comments.
Login now