##// END OF EJS Templates
Enforce strict Sphinx style on headers and doc. attrib....
Jonathan Frederic -
Show More
@@ -32,13 +32,116 b''
32 \usepackage{((( resources.sphinx_texinputs )))/sphinx}
32 \usepackage{((( resources.sphinx_texinputs )))/sphinx}
33 \usepackage{multirow}
33 \usepackage{multirow}
34
34
35 \usepackage{amsmath}
36 \usepackage{amssymb}
37 \usepackage{graphicx}
38 \usepackage{ucs}
39 \usepackage{enumerate}
40
41 % Define a few colors for use in code, links and cell shading
42 \usepackage{color}
43 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
44 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
45 \definecolor{darkgreen}{rgb}{.12,.54,.11}
46 \definecolor{myteal}{rgb}{.26, .44, .56}
47 \definecolor{gray}{gray}{0.45}
48 \definecolor{lightgray}{gray}{.95}
49 \definecolor{mediumgray}{gray}{.8}
50 \definecolor{inputbackground}{rgb}{.95, .95, .85}
51 \definecolor{outputbackground}{rgb}{.95, .95, .95}
52 \definecolor{traceback}{rgb}{1, .95, .95}
53
54 % Framed environments for code cells (inputs, outputs, errors, ...). The
55 % various uses of \unskip (or not) at the end were fine-tuned by hand, so don't
56 % randomly change them unless you're sure of the effect it will have.
57 \usepackage{framed}
58
59 % remove extraneous vertical space in boxes
60 \setlength\fboxsep{0pt}
61
62 % codecell is the whole input+output set of blocks that a Code cell can
63 % generate.
64
65 % TODO: unfortunately, it seems that using a framed codecell environment breaks
66 % the ability of the frames inside of it to be broken across pages. This
67 % causes at least the problem of having lots of empty space at the bottom of
68 % pages as new frames are moved to the next page, and if a single frame is too
69 % long to fit on a page, will completely stop latex from compiling the
70 % document. So unless we figure out a solution to this, we'll have to instead
71 % leave the codecell env. as empty. I'm keeping the original codecell
72 % definition here (a thin vertical bar) for reference, in case we find a
73 % solution to the page break issue.
74
75 %% \newenvironment{codecell}{%
76 %% \def\FrameCommand{\color{mediumgray} \vrule width 1pt \hspace{5pt}}%
77 %% \MakeFramed{\vspace{-0.5em}}}
78 %% {\unskip\endMakeFramed}
79
80 % For now, make this a no-op...
81 \newenvironment{codecell}{}
82
83 \newenvironment{codeinput}{%
84 \def\FrameCommand{\colorbox{inputbackground}}%
85 \MakeFramed{\advance\hsize-\width \FrameRestore}}
86 {\unskip\endMakeFramed}
87
88 \newenvironment{codeoutput}{%
89 \def\FrameCommand{\colorbox{outputbackground}}%
90 \vspace{-1.4em}
91 \MakeFramed{\advance\hsize-\width \FrameRestore}}
92 {\unskip\medskip\endMakeFramed}
93
94 \newenvironment{traceback}{%
95 \def\FrameCommand{\colorbox{traceback}}%
96 \MakeFramed{\advance\hsize-\width \FrameRestore}}
97 {\endMakeFramed}
98
99 % Use and configure listings package for nicely formatted code
100 \usepackage{listingsutf8}
101 \lstset{
102 language=python,
103 inputencoding=utf8x,
104 extendedchars=\true,
105 aboveskip=\smallskipamount,
106 belowskip=\smallskipamount,
107 xleftmargin=2mm,
108 breaklines=true,
109 basicstyle=\small \ttfamily,
110 showstringspaces=false,
111 keywordstyle=\color{blue}\bfseries,
112 commentstyle=\color{myteal},
113 stringstyle=\color{darkgreen},
114 identifierstyle=\color{darkorange},
115 columns=fullflexible, % tighter character kerning, like verb
116 }
117
118 % The hyperref package gives us a pdf with properly built
119 % internal navigation ('pdf bookmarks' for the table of contents,
120 % internal cross-reference links, web links for URLs, etc.)
121 \usepackage{hyperref}
122 \hypersetup{
123 breaklinks=true, % so long urls are correctly broken across lines
124 colorlinks=true,
125 urlcolor=blue,
126 linkcolor=darkorange,
127 citecolor=darkgreen,
128 }
129
130 % hardcode size of all verbatim environments to be a bit smaller
131 \makeatletter
132 \g@addto@macro\@verbatim\small\topsep=0.5em\partopsep=0pt
133 \makeatother
134
135 % Prevent overflowing lines due to urls and other hard-to-break entities.
136 \sloppy
137
35 % Document level variables
138 % Document level variables
36 \title{((( nb.metadata.name )))}
139 \title{((( filterOutLatex(nb.metadata.name) )))}
37 \date{((( nb.metadata.date )))}
140 \date{((( filterOutLatex(nb.metadata.date) )))}
38 \release{((( nb.metadata.version )))}
141 \release{((( filterOutLatex(nb.metadata.version) )))}
39 \author{((( nb.metadata.author )))}
142 \author{((( filterOutLatex(nb.metadata.author) )))}
40 \newcommand{\sphinxlogo}{}
143 \newcommand{\sphinxlogo}{}
41 \renewcommand{\releasename}{((( nb.metadata.release )))}
144 \renewcommand{\releasename}{((( filterOutLatex(nb.metadata.release) )))}
42 \makeindex
145 \makeindex
43
146
44
147
@@ -81,7 +184,7 b''
81 ((* block h5 -*))subsubsection((* endblock h5 -*))
184 ((* block h5 -*))subsubsection((* endblock h5 -*))
82 ((*- elif cell.level == 6 -*))
185 ((*- elif cell.level == 6 -*))
83 ((* block h6 -*))paragraph((* endblock h6 -*))
186 ((* block h6 -*))paragraph((* endblock h6 -*))
84 ((*- endif -*)){((( cell.source | markdown2latex )))}
187 ((*- endif -*)){((( filterOutLatex(cell.source) )))} ((= | markdown2latex =))
85 ((*- endblock headingcell *))
188 ((*- endblock headingcell *))
86
189
87 ((* block unknowncell scoped*))
190 ((* block unknowncell scoped*))
@@ -102,6 +205,7 b' not get touched by the templating system. =))'
102
205
103 ((* macro filterOutLatex(text) -*))
206 ((* macro filterOutLatex(text) -*))
104 ((*- set text = text|replace("\\","\\backslash") -*))
207 ((*- set text = text|replace("\\","\\backslash") -*))
208 ((*- set text = text|replace("_","\\_") -*))
105 ((*- set text = text|replace("{","\\{") -*))
209 ((*- set text = text|replace("{","\\{") -*))
106 ((*- set text = text|replace("}","\\}") -*))
210 ((*- set text = text|replace("}","\\}") -*))
107 ((*- set text = text|replace("|","\\vert") -*))
211 ((*- set text = text|replace("|","\\vert") -*))
@@ -117,11 +221,10 b' not get touched by the templating system. =))'
117 \begin{center}\setlength{\fboxsep}{5pt}
221 \begin{center}\setlength{\fboxsep}{5pt}
118 \shadowbox{\box0}\end{center}
222 \shadowbox{\box0}\end{center}
119
223
120
121 ((========================================================================
224 ((========================================================================
122 EVERYTHING BELOW HERE STILL NEEDS TO BE FILLED IN!
225 EVERYTHING BELOW HERE STILL NEEDS TO BE FILLED IN!
123 ========================================================================))
226 ========================================================================))
124
227 ((=
125 ((*- block codecell scoped -*))
228 ((*- block codecell scoped -*))
126 ((*- block input_group -*))
229 ((*- block input_group -*))
127 ((*- block in_prompt -*))((*- endblock in_prompt -*))
230 ((*- block in_prompt -*))((*- endblock in_prompt -*))
@@ -161,3 +264,5 b' not get touched by the templating system. =))'
161 ((*- endblock output_group -*))
264 ((*- endblock output_group -*))
162 ((*- endif -*))
265 ((*- endif -*))
163 ((*- endblock codecell -*))
266 ((*- endblock codecell -*))
267 =))
268
General Comments 0
You need to be logged in to leave comments. Login now