##// END OF EJS Templates
Grammar fixes, run on sentence trim.
Kyle Kelley -
Show More
@@ -1,113 +1,113
1 %% This is the automatic preamble used by IPython. Note that it does *not*
1 %% This is the automatic preamble used by IPython. Note that it does *not*
2 %% include a documentclass declaration, that is added at runtime to the overall
2 %% include a documentclass declaration. The documentclass is added at runtime
3 %% document.
3 %% to the overall document.
4
4
5 \usepackage{amsmath}
5 \usepackage{amsmath}
6 \usepackage{amssymb}
6 \usepackage{amssymb}
7 \usepackage{graphicx}
7 \usepackage{graphicx}
8 \usepackage{ucs}
8 \usepackage{ucs}
9 \usepackage[utf8x]{inputenc}
9 \usepackage[utf8x]{inputenc}
10
10
11 % needed for markdown enumerations to work
11 % needed for markdown enumerations to work
12 \usepackage{enumerate}
12 \usepackage{enumerate}
13
13
14 % Slightly bigger margins than the latex defaults
14 % Slightly bigger margins than the latex defaults
15 \usepackage{geometry}
15 \usepackage{geometry}
16 \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2.5cm,rmargin=2.5cm}
16 \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2.5cm,rmargin=2.5cm}
17
17
18 % Define a few colors for use in code, links and cell shading
18 % Define a few colors for use in code, links and cell shading
19 \usepackage{color}
19 \usepackage{color}
20 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
20 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
21 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
21 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
22 \definecolor{darkgreen}{rgb}{.12,.54,.11}
22 \definecolor{darkgreen}{rgb}{.12,.54,.11}
23 \definecolor{myteal}{rgb}{.26, .44, .56}
23 \definecolor{myteal}{rgb}{.26, .44, .56}
24 \definecolor{gray}{gray}{0.45}
24 \definecolor{gray}{gray}{0.45}
25 \definecolor{lightgray}{gray}{.95}
25 \definecolor{lightgray}{gray}{.95}
26 \definecolor{mediumgray}{gray}{.8}
26 \definecolor{mediumgray}{gray}{.8}
27 \definecolor{inputbackground}{rgb}{.95, .95, .85}
27 \definecolor{inputbackground}{rgb}{.95, .95, .85}
28 \definecolor{outputbackground}{rgb}{.95, .95, .95}
28 \definecolor{outputbackground}{rgb}{.95, .95, .95}
29 \definecolor{traceback}{rgb}{1, .95, .95}
29 \definecolor{traceback}{rgb}{1, .95, .95}
30
30
31 % Framed environments for code cells (inputs, outputs, errors, ...). The
31 % Framed environments for code cells (inputs, outputs, errors, ...). The
32 % various uses of \unskip (or not) at the end were fine-tuned by hand, so don't
32 % various uses of \unskip (or not) at the end were fine-tuned by hand, so don't
33 % randomly change them unless you're sure of the effect it will have.
33 % randomly change them unless you're sure of the effect it will have.
34 \usepackage{framed}
34 \usepackage{framed}
35
35
36 % remove extraneous vertical space in boxes
36 % remove extraneous vertical space in boxes
37 \setlength\fboxsep{0pt}
37 \setlength\fboxsep{0pt}
38
38
39 % codecell is the whole input+output set of blocks that a Code cell can
39 % codecell is the whole input+output set of blocks that a Code cell can
40 % generate.
40 % generate.
41
41
42 % TODO: unfortunately, it seems that using a framed codecell environment breaks
42 % TODO: unfortunately, it seems that using a framed codecell environment breaks
43 % the ability of the frames inside of it to be broken across pages. This
43 % the ability of the frames inside of it to be broken across pages. This
44 % causes at least the problem of having lots of empty space at the bottom of
44 % causes at least the problem of having lots of empty space at the bottom of
45 % pages as new frames are moved to the next page, and if a single frame is too
45 % pages as new frames are moved to the next page, and if a single frame is too
46 % long to fit on a page, will completely stop latex from compiling the
46 % long to fit on a page, it will completely stop latex from compiling the
47 % document. So unless we figure out a solution to this, we'll have to instead
47 % document. So unless we figure out a solution to this, we'll have to instead
48 % leave the codecell env. as empty. I'm keeping the original codecell
48 % leave the codecell env. as empty. I'm keeping the original codecell
49 % definition here (a thin vertical bar) for reference, in case we find a
49 % definition here (a thin vertical bar) for reference, in case we find a
50 % solution to the page break issue.
50 % solution to the page break issue.
51
51
52 %% \newenvironment{codecell}{%
52 %% \newenvironment{codecell}{%
53 %% \def\FrameCommand{\color{mediumgray} \vrule width 1pt \hspace{5pt}}%
53 %% \def\FrameCommand{\color{mediumgray} \vrule width 1pt \hspace{5pt}}%
54 %% \MakeFramed{\vspace{-0.5em}}}
54 %% \MakeFramed{\vspace{-0.5em}}}
55 %% {\unskip\endMakeFramed}
55 %% {\unskip\endMakeFramed}
56
56
57 % For now, make this a no-op...
57 % For now, make this a no-op...
58 \newenvironment{codecell}{}
58 \newenvironment{codecell}{}
59
59
60 \newenvironment{codeinput}{%
60 \newenvironment{codeinput}{%
61 \def\FrameCommand{\colorbox{inputbackground}}%
61 \def\FrameCommand{\colorbox{inputbackground}}%
62 \MakeFramed{\advance\hsize-\width \FrameRestore}}
62 \MakeFramed{\advance\hsize-\width \FrameRestore}}
63 {\unskip\endMakeFramed}
63 {\unskip\endMakeFramed}
64
64
65 \newenvironment{codeoutput}{%
65 \newenvironment{codeoutput}{%
66 \def\FrameCommand{\colorbox{outputbackground}}%
66 \def\FrameCommand{\colorbox{outputbackground}}%
67 \vspace{-1.4em}
67 \vspace{-1.4em}
68 \MakeFramed{\advance\hsize-\width \FrameRestore}}
68 \MakeFramed{\advance\hsize-\width \FrameRestore}}
69 {\unskip\medskip\endMakeFramed}
69 {\unskip\medskip\endMakeFramed}
70
70
71 \newenvironment{traceback}{%
71 \newenvironment{traceback}{%
72 \def\FrameCommand{\colorbox{traceback}}%
72 \def\FrameCommand{\colorbox{traceback}}%
73 \MakeFramed{\advance\hsize-\width \FrameRestore}}
73 \MakeFramed{\advance\hsize-\width \FrameRestore}}
74 {\endMakeFramed}
74 {\endMakeFramed}
75
75
76 % Use and configure listings package for nicely formatted code
76 % Use and configure listings package for nicely formatted code
77 \usepackage{listingsutf8}
77 \usepackage{listingsutf8}
78 \lstset{
78 \lstset{
79 language=python,
79 language=python,
80 inputencoding=utf8x,
80 inputencoding=utf8x,
81 extendedchars=\true,
81 extendedchars=\true,
82 aboveskip=\smallskipamount,
82 aboveskip=\smallskipamount,
83 belowskip=\smallskipamount,
83 belowskip=\smallskipamount,
84 xleftmargin=2mm,
84 xleftmargin=2mm,
85 breaklines=true,
85 breaklines=true,
86 basicstyle=\small \ttfamily,
86 basicstyle=\small \ttfamily,
87 showstringspaces=false,
87 showstringspaces=false,
88 keywordstyle=\color{blue}\bfseries,
88 keywordstyle=\color{blue}\bfseries,
89 commentstyle=\color{myteal},
89 commentstyle=\color{myteal},
90 stringstyle=\color{darkgreen},
90 stringstyle=\color{darkgreen},
91 identifierstyle=\color{darkorange},
91 identifierstyle=\color{darkorange},
92 columns=fullflexible, % tighter character kerning, like verb
92 columns=fullflexible, % tighter character kerning, like verb
93 }
93 }
94
94
95 % The hyperref package gives us a pdf with properly built
95 % The hyperref package gives us a pdf with properly built
96 % internal navigation ('pdf bookmarks' for the table of contents,
96 % internal navigation ('pdf bookmarks' for the table of contents,
97 % internal cross-reference links, web links for URLs, etc.)
97 % internal cross-reference links, web links for URLs, etc.)
98 \usepackage{hyperref}
98 \usepackage{hyperref}
99 \hypersetup{
99 \hypersetup{
100 breaklinks=true, % so long urls are correctly broken across lines
100 breaklinks=true, % so long urls are correctly broken across lines
101 colorlinks=true,
101 colorlinks=true,
102 urlcolor=blue,
102 urlcolor=blue,
103 linkcolor=darkorange,
103 linkcolor=darkorange,
104 citecolor=darkgreen,
104 citecolor=darkgreen,
105 }
105 }
106
106
107 % hardcode size of all verbatim environments to be a bit smaller
107 % hardcode size of all verbatim environments to be a bit smaller
108 \makeatletter
108 \makeatletter
109 \g@addto@macro\@verbatim\small\topsep=0.5em\partopsep=0pt
109 \g@addto@macro\@verbatim\small\topsep=0.5em\partopsep=0pt
110 \makeatother
110 \makeatother
111
111
112 % Prevent overflowing lines due to urls and other hard-to-break entities.
112 % Prevent overflowing lines due to urls and other hard-to-break entities.
113 \sloppy
113 \sloppy
General Comments 0
You need to be logged in to leave comments. Login now