-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathst80.tex
More file actions
85 lines (82 loc) · 3.06 KB
/
Copy pathst80.tex
File metadata and controls
85 lines (82 loc) · 3.06 KB
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
% $Author: oscar $
% $Date: 2009-11-06 14:37:12 +0100 (Fri, 06 Nov 2009) $
% $Revision: 29604 $
%=============================================================
% ST80 listings macros
% Adapted from Squeak by Example book
%=============================================================
% If you want >>> appearing as right guillemet, you need these two lines:
%\usepackage[T1]{fontenc}
%\newcommand{\sep}{\mbox{>>}}
% Otherwise use this:
\newcommand{\sep}{\mbox{$\gg$}}
%=============================================================
%:\needlines{N} before code block to force page feed
%\usepackage{needspace}
%\newcommand{\needlines}[1]{\Needspace{#1\baselineskip}}
%=============================================================
%:Listings package configuration for ST80
\usepackage[english]{babel}
\usepackage{amssymb,textcomp}
\usepackage{listings}
% \usepackage[usenames,dvipsnames]{color}
\usepackage[usenames]{color}
% \definecolor{source}{gray}{0.95}
\lstdefinelanguage{Smalltalk}{
morekeywords={self,super,true,false,nil,thisContext, eachModel}, % This is overkill
morestring=[d]',
morecomment=[s]{"}{"},
alsoletter={\#:},
escapechar={!},
literate=
{BANG}{!}1
{UNDERSCORE}{\_}1
{\\st}{Smalltalk}9 % convenience -- in case \st occurs in code
% {'}{{\textquotesingle}}1 % replaced by upquote=true in \lstset
{_}{{$\leftarrow$}}1
{>>>}{{\sep}}1
{^}{{$\uparrow$}}1
{~}{{$\sim$}}1
{-}{{\sf -\hspace{-0.13em}-}}1 % the goal is to make - the same width as +
{+}{\raisebox{0.08ex}{+}}1 % and to raise + off the baseline to match -
{-->}{{\quad$\longrightarrow$\quad}}3
, % Don't forget the comma at the end!
tabsize=4
}[keywords,comments,strings]
\definecolor{source}{gray}{0.95}
\lstset{language=Smalltalk,
basicstyle=\sffamily,
keywordstyle=\color{black}\bfseries,
% numbers=left, % where to put the line-numbers
% numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
% stepnumber=1, % the step between two line-numbers. If it is 1 each line will be numbered
% numbersep=5pt, % how far the line-numbers are from the code
% stringstyle=\ttfamily, % Ugly! do we really want this? -- on
mathescape=true,
showstringspaces=false,
keepspaces=true,
breaklines=true,
breakautoindent=true,
backgroundcolor=\color{source},
%lineskip={-1pt}, % Ugly hack
upquote=true, % straight quote; requires textcomp package
columns=fullflexible} % no fixed width fonts
% In-line code (literal)
% Normally use this for all in-line code:
\newcommand{\ct}{\lstinline[mathescape=false,backgroundcolor=\color{white},basicstyle={\sffamily\upshape}]}
% In-line code (latex enabled)
% Use this only in special situations where \ct does not work
% (within section headings ...):
\newcommand{\lct}[1]{{\textsf{\textup{#1}}}}
% Code environments
\lstnewenvironment{code}{%
\lstset{%
% frame=lines,
frame=single,
framerule=0pt,
mathescape=false
}
}{}
% Useful to add a matching $ after code containing a $
% \def\ignoredollar#1{}
%=============================================================