Skip to content

Commit 8efe8b9

Browse files
committed
2 parents d7d2b79 + 0c7b7b2 commit 8efe8b9

3 files changed

Lines changed: 99 additions & 9 deletions

File tree

book/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ PDFFLAGS = -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress \
1717
ps2pdf $(PDFFLAGS) $<
1818

1919
all: book.tex
20+
pdflatex book
2021
makeindex book.idx
2122
pdflatex book
2223
mv book.pdf thinkpython2.pdf
23-
evince thinkpython2.pdf
2424

2525
hevea: book.tex header.html footer.html
2626
# replace the pdfs with eps

book/book.tex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,8 @@ \section*{Contributor List}
718718

719719
\item William Murray corrected my definition of floor division.
720720

721+
\item Per Starb{\"a}ck brought me up to date on universal newlines in Python 3.
722+
721723
% ENDCONTRIB
722724

723725
In addition, people who spotted typos or made corrections include
@@ -3566,8 +3568,7 @@ \section{Floor division and modulus}
35663568
\end{verbatim}
35673569

35683570
But we don't normally write hours with decimal points. Floor
3569-
division returns the integer number of hours, dropping the
3570-
fraction part:
3571+
division returns the integer number of hours, rounding down:
35713572

35723573
\begin{verbatim}
35733574
>>> minutes = 105
@@ -6855,25 +6856,24 @@ \section{Reading word lists}
68556856

68566857
\begin{verbatim}
68576858
>>> fin.readline()
6858-
'aa\r\n'
6859+
'aa\n'
68596860
\end{verbatim}
68606861
%
68616862
The first word in this particular list is ``aa'', which is a kind of
6862-
lava. The sequence \verb"\r\n" represents two whitespace characters,
6863-
a carriage return and a newline, that separate this word from the
6864-
next.
6863+
lava. The sequence \verb"\n" represents the newline character that
6864+
separates this word from the next.
68656865

68666866
The file object keeps track of where it is in the file, so
68676867
if you call {\tt readline} again, you get the next word:
68686868

68696869
\begin{verbatim}
68706870
>>> fin.readline()
6871-
'aah\r\n'
6871+
'aah\n'
68726872
\end{verbatim}
68736873
%
68746874
The next word is ``aah'', which is a perfectly legitimate
68756875
word, so stop looking at me like that.
6876-
Or, if it's the whitespace that's bothering you,
6876+
Or, if it's the newline character that's bothering you,
68776877
we can get rid of it with the string method {\tt strip}:
68786878
\index{strip method}
68796879
\index{method!strip}

book/hevea.sty

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
% hevea : hevea.sty
2+
% This is a very basic style file for latex document to be processed
3+
% with hevea. It contains definitions of LaTeX environment which are
4+
% processed in a special way by the translator.
5+
% Mostly :
6+
% - latexonly, not processed by hevea, processed by latex.
7+
% - htmlonly , the reverse.
8+
% - rawhtml, to include raw HTML in hevea output.
9+
% - toimage, to send text to the image file.
10+
% The package also provides hevea logos, html related commands (ahref
11+
% etc.), void cutting and image commands.
12+
\NeedsTeXFormat{LaTeX2e}
13+
\ProvidesPackage{hevea}[2002/01/11]
14+
\RequirePackage{comment}
15+
\newif\ifhevea\heveafalse
16+
\@ifundefined{ifimagen}{\newif\ifimagen\imagenfalse}
17+
\makeatletter%
18+
\newcommand{\heveasmup}[2]{%
19+
\raise #1\hbox{$\m@th$%
20+
\csname S@\f@size\endcsname
21+
\fontsize\sf@size 0%
22+
\math@fontsfalse\selectfont
23+
#2%
24+
}}%
25+
\DeclareRobustCommand{\hevea}{H\kern-.15em\heveasmup{.2ex}{E}\kern-.15emV\kern-.15em\heveasmup{.2ex}{E}\kern-.15emA}%
26+
\DeclareRobustCommand{\hacha}{H\kern-.15em\heveasmup{.2ex}{A}\kern-.15emC\kern-.1em\heveasmup{.2ex}{H}\kern-.15emA}%
27+
\DeclareRobustCommand{\html}{\protect\heveasmup{0.ex}{HTML}}
28+
%%%%%%%%% Hyperlinks hevea style
29+
\newcommand{\ahref}[2]{{#2}}
30+
\newcommand{\ahrefloc}[2]{{#2}}
31+
\newcommand{\aname}[2]{{#2}}
32+
\newcommand{\ahrefurl}[1]{\texttt{#1}}
33+
\newcommand{\footahref}[2]{#2\footnote{\texttt{#1}}}
34+
\newcommand{\mailto}[1]{\texttt{#1}}
35+
\newcommand{\imgsrc}[2][]{}
36+
\newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1}
37+
\AtBeginDocument
38+
{\@ifundefined{url}
39+
{%url package is not loaded
40+
\let\url\ahref\let\oneurl\ahrefurl\let\footurl\footahref}
41+
{}}
42+
%% Void cutting instructions
43+
\newcounter{cuttingdepth}
44+
\newcommand{\tocnumber}{}
45+
\newcommand{\notocnumber}{}
46+
\newcommand{\cuttingunit}{}
47+
\newcommand{\cutdef}[2][]{}
48+
\newcommand{\cuthere}[2]{}
49+
\newcommand{\cutend}{}
50+
\newcommand{\htmlhead}[1]{}
51+
\newcommand{\htmlfoot}[1]{}
52+
\newcommand{\htmlprefix}[1]{}
53+
\newenvironment{cutflow}[1]{}{}
54+
\newcommand{\cutname}[1]{}
55+
\newcommand{\toplinks}[3]{}
56+
\newcommand{\setlinkstext}[3]{}
57+
\newcommand{\flushdef}[1]{}
58+
\newcommand{\footnoteflush}[1]{}
59+
%%%% Html only
60+
\excludecomment{rawhtml}
61+
\newcommand{\rawhtmlinput}[1]{}
62+
\excludecomment{htmlonly}
63+
%%%% Latex only
64+
\newenvironment{latexonly}{}{}
65+
\newenvironment{verblatex}{}{}
66+
%%%% Image file stuff
67+
\def\toimage{\endgroup}
68+
\def\endtoimage{\begingroup\def\@currenvir{toimage}}
69+
\def\verbimage{\endgroup}
70+
\def\endverbimage{\begingroup\def\@currenvir{verbimage}}
71+
\newcommand{\imageflush}[1][]{}
72+
%%% Bgcolor definition
73+
\newsavebox{\@bgcolorbin}
74+
\newenvironment{bgcolor}[2][]
75+
{\newcommand{\@mycolor}{#2}\begin{lrbox}{\@bgcolorbin}\vbox\bgroup}
76+
{\egroup\end{lrbox}%
77+
\begin{flushleft}%
78+
\colorbox{\@mycolor}{\usebox{\@bgcolorbin}}%
79+
\end{flushleft}}
80+
%%% Style sheets macros, defined as no-ops
81+
\newcommand{\newstyle}[2]{}
82+
\newcommand{\addstyle}[1]{}
83+
\newcommand{\setenvclass}[2]{}
84+
\newcommand{\getenvclass}[1]{}
85+
\newcommand{\loadcssfile}[1]{}
86+
\newenvironment{divstyle}[1]{}{}
87+
\newenvironment{cellstyle}[2]{}{}
88+
\newif\ifexternalcss
89+
%%% Postlude
90+
\makeatother

0 commit comments

Comments
 (0)