forked from alexott/sicp-ru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sicp.sty
134 lines (115 loc) · 4.09 KB
/
sicp.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
%% Index
\ProvidesPackage{sicp}
% A trick to prevent \dimen overflowing
\def\newskimen#1%
{\ifx#1\undefined
\csname new\ifnum\count11>\count12 skip\else dimen\fi\endcsname#1%
\fi}
\def\LoadSkimmedStyle#1%
{\let\normalnewdimen\newdimen
\let\newdimen\newskimen
\usepackage{#1} \relax
\let\newdimen\normalnewdimen}
\usepackage{epic}
\usepackage{eepic}
\usepackage{multicol}
\usepackage{synttree}
\LoadSkimmedStyle{amsmath}
\usepackage{ifthen}
\renewcommand{\@idxitem}{\par\hangindent=20pt}
\renewcommand*{\subitem}{\par\hangindent=30pt\hspace*{10pt}}
\renewcommand*{\subsubitem}{\par\hangindent=30pt\hspace*{10pt}}
\parskip=0pt
\textwidth=140mm
\textheight = 194mm
\usepackage{geometry}
\DeclareOption{ebook}{
\geometry{papersize={8.8cm,11.6cm},margin=0.3cm}
}
\ProcessOptions
%(высота полосы набора - \headheight - \headsep -\topskip) \divide \baselineskip (целочисленно) * \baselineskip + \topskip.
\renewcommand{\@oddfoot}{}
\renewcommand{\@evenfoot}{}
\renewcommand{\textfraction}{0,1}
%\raggedbottom
%\renewcommand{\@chapapp}{Г\\л\\а\\в\\а}
%\renewcommand{\@makechapterhead}{%
% \marginpar{\Huge \bfseries{\@chapapp \\ \thechapter}}
% }
%Redefining chapterheads:
\renewcommand{\chapter}{\clearpage %instead of cleardoublepage.--MR
\thispagestyle{plain}
\global\@topnum=0%abracadabra from Lvovsky. I don't understand it.--MR
\@afterindenttrue%The first paragraph will be indented.--MR
\secdef\@chapter\@schapter}%abracadabra copied from Lvovsky. --MR
%\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
% \thispagestyle{empty}%
% \global\@topnum\z@
% \@afterindentfalse
% \secdef\@chapter\@schapter}
%Redefining contentslines for chapters:
\renewcommand{\l@chapter}[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode {\bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak}\dotfill \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
%%%%%%%%%%%%%%%%
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
{-3.25ex \@plus-1ex \@minus-.2ex}%
{1ex}%
{\normalfont\normalsize\bfseries}}
\setlength{\epigraphrule}{0pt}
\newcounter{exercise}[chapter]
\renewcommand{\theexercise}{\thechapter.\arabic{exercise}}
\renewcommand{\@dotsep}{1,8}
%%%%%%%%%%%%%%%%%
\newenvironment{exercise}[2][par]%
{\par\bigskip%
\noindent%
\refstepcounter{exercise}%
{\bf\small Упражнение #2.}%
\nopagebreak%
\ifthenelse{\equal{#1}{par}}{\par{}\noindent{}}{}%
\small{}}
{}
\newcommand{\translationnote}[1]{{\renewcommand{\@makefnmark}{\mbox{$^*$}}\footnotemark{}\footnotetext{#1 --- {\it прим. перев.}}}\addtocounter{footnote}{-1}}
\makeatother
\title{Структура и интерпретация компьютерных программ}
\author{Харольд Абельсон \and Джеральд Джей Сассман \and при участии Джули Сассман}
\renewcommand{\topfraction}{2}
\tolerance=400
\newenvironment{cntrfig}{\begin{figure}\begin{center}}%
{\end{center}\end{figure}}
\newcounter{pl}
\newenvironment{plainenum}%
{\begin{list}%
{\ralph{pl}.}
{\usecounter{pl}
\leftmargin=0pt
\parskip=0pt
\topsep=0pt
\partopsep=0pt
\itemindent=20pt
}%
}%
{\end{list}}
\newenvironment{plainlist}{\begin{list}%
{\textbullet}%
{\leftmargin=0pt
\itemsep=0pt
\parskip=0pt
\topsep=5pt
\itemindent=25pt%Как у абзацев. А может, сделать 0? Вопрос Вадику.
}
}
{\end{list} \par}