source: git/doc/singcard.tex @ 8710568

spielwiese
Last change on this file since 8710568 was 9056a1, checked in by Jens Schmidt <schmidt@…>, 26 years ago
Initial revision git-svn-id: file:///usr/local/Singular/svn/trunk@1701 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 6.1 KB
Line 
1% $Id: singcard.tex,v 1.1 1998-05-12 07:24:04 schmidt Exp $
2
3%
4% singcard.tex - common macros for Singular reference cards.
5%
6% Some of the macros/settings ripped from gdb reference card.
7%
8
9%
10% - declare configurable parameters.
11%
12\newdimen\totalwidth
13\newdimen\totalheight
14\newdimen\hmargin
15\newdimen\vmargin
16
17\newdimen\barwidth
18\newdimen\barheight
19
20%%% START CONFIGURABLE SECTION
21
22%
23% - configure your papersize.
24%
25
26% US letter paper (8.5x11in)
27%\totalwidth=11in               % total width of paper
28%\totalheight=8.5in             % total height of paper
29%\hmargin=.25in                 % horizontal margin width
30%\vmargin=.25in                 % vertical margin width
31
32% A4 paper
33\totalwidth=29.7cm
34\totalheight=21cm
35\hmargin=6mm
36\vmargin=6mm
37
38%
39% - configure your folding guides.
40%
41\barwidth=.1pt                  % width of the folding guide
42\barheight=2pt                  % height of the folding guide
43
44% For NO printed folding guide,
45% comment out other \def\vdecor's and uncomment:
46%\def\vdecor{\hskip\hmargin plus1fil\hskip\barwidth plus1fil\hskip\hmargin plus1fil}
47
48% For SOLID LINE folding guide,
49% comment out other \def\vdecor's and uncomment:
50%\def\vdecor{\hskip\hmargin plus1fil \vrule width \barwidth \hskip\hmargin plus1fil}
51
52% For SMALL MARKS NEAR TOP AND BOTTOM as folding guide,
53% comment out other \def\vdecor's and uncomment:
54\def\vdecor{\hskip\hmargin plus1fil
55\vbox to \vsize{\hbox to \barwidth{\vrule height\barheight width\barwidth}\vfill
56\hbox to \barwidth{\vrule height\barheight width\barwidth}}%THIS PERCENT SIGN IS ESSENTIAL
57\hskip\hmargin plus1fil}
58
59%%% END CONFIGURABLE SECTION
60
61%
62% - compute parameters of three column format.
63%
64\newdimen\fullhsize             % width of area without margins
65\newdimen\itemwidth             % width of item column
66\newdimen\definitionwidth       % width of definition column
67\newdimen\temp                  % only for temporary use
68
69% adjust the offsets so the margins are measured *from paper edge*
70\hoffset=-1in \advance \hoffset by \hmargin
71\voffset=-1in \advance \voffset by \vmargin
72
73% fullhsize = totalwidth - (2 * hmargin)
74\fullhsize=\totalwidth
75\temp=\hmargin \multiply \temp by 2 \advance \fullhsize by -\temp
76
77% hsize = (fullhsize - (4 * hmargin) - (2 * barwidth)) / 3
78\hsize=\fullhsize
79\temp=\hmargin \multiply \temp by 4 \advance \hsize by -\temp
80\temp=\barwidth \multiply \temp by 2 \advance \hsize by -\temp
81\divide \hsize by 3
82
83% vsize = totalheight - (2 * vmargin)
84\vsize=\totalheight
85\temp=\vmargin \multiply \temp by 2 \advance \vsize by -\temp
86
87% default itemwidth = hsize * 1/4
88% default definitionwidth = hsize * 3/4
89\temp=\hsize \divide \temp by 4
90\itemwidth=\temp
91\definitionwidth=\hsize \advance \definitionwidth by -\itemwidth
92
93%
94% - miscellaneous parameters.
95%
96\tolerance=2000
97\hyphenpenalty=500
98
99\parindent=0pt
100\parskip=0pt
101\baselineskip=9pt
102
103\footline={\vbox to0pt{\hss}}
104
105%
106% - font definitions.
107%
108\font\rm=cmr7
109\font\bf=cmbx7
110\font\it=cmti7
111\font\bit=cmbxti10 at 7pt
112\font\tt=cmtt8                  % cmtt7 seems too small
113\font\sc=cmcsc10 at 7pt
114
115% huge fonts
116\font\hbf=cmbx12
117
118% large fonts
119\font\lbf=cmbx10
120
121% small fonts
122\font\srm=cmr6
123\font\ssc=cmcsc10 at 6pt
124
125% tiny fonts
126\font\tit=cmti7 at 5pt
127
128% math fonts
129\font\mathrm=cmr7
130\font\smathrm=cmr5
131\font\mathit=cmmi7
132\font\smathit=cmmi5
133\font\mathsy=cmsy7
134\font\smathsy=cmsy5
135\font\mathex=cmex7
136
137\textfont0=\mathrm \scriptfont0=\smathrm
138\textfont1=\mathit \scriptfont1=\smathit
139\textfont2=\mathsy \scriptfont2=\smathsy
140\textfont3=\mathex \scriptfont3=\mathex
141
142%
143% - macros for tree column format.
144%
145\def\fulline{\hbox to \fullhsize}
146\def\columnbox{\leftline{\pagebody}}
147\def\tripleformat{\shipout
148                  \vbox{\fulline{\box\leftcolumn\vdecor
149                                 \box\centercolumn\vdecor
150                                 \columnbox}}%
151                  \advancepageno}
152\def\bye{\par\vfill
153         \supereject
154         \if R\currentcolumn\null\vfill\eject\fi
155         \end}
156
157%
158% - miscellaneous macros.
159%
160% \Singular: for sake of corporate identity
161% \ctl: print control keys
162% \opt: print optional arguments
163% \rmslash: print a slash in roman type face
164% \eg, \ie: obvious
165% \verysmallskip: skip a very small amount (used between \sec entries).
166%   Extra skip does not harm in the applications of \verysmallskip,
167%   so we choose a large stretch for it.
168% \strut: redefinition of TeX's \strut macro
169%
170\def\Singular{{\sc Singular}}
171\def\ctl#1{{\tt C-#1}}
172\def\opt#1{{\rm[{\tt #1}]}}
173\def\rmslash{{\rm /}}
174\def\eg{e.g.~}
175\def\ie{i.e.~}
176
177\newskip\verysmallskipamount
178\verysmallskipamount=1pt plus 3pt minus 0.333333pt
179\def\verysmallskip{\vskip \verysmallskipamount}
180
181\newbox\sevenptstrutbox
182\setbox\sevenptstrutbox=\hbox{\vrule height6pt depth3pt width0pt}
183\def\strut{\relax\ifmmode\copy\sevenptstrutbox\else\unhcopy\sevenptstrutbox\fi}
184
185%
186% \sec - insert a new section into the card.
187%
188% First argument is section title, second argument the item column
189% width (defaults to 1/4*hsize), third the section itself.
190%
191% \setitemwidth: auxiliary macro
192%
193\def\setitemwidth#1{\itemwidth=#1
194                    \definitionwidth=\hsize
195                    \advance\definitionwidth by -\itemwidth}
196\long\def\sec#1(#2)#3\endsec{{%
197        \def\\{#2}\ifx\empty\\ \else\setitemwidth{#2}\fi
198        \halign{% column 1
199                \vtop{\hsize=\itemwidth\strut\tt##\strut}&
200                % column 2
201                \vtop{\hsize=\definitionwidth\strut\rm##\strut}\cr
202                % tail of \long\def fills in halign body with argument
203                \noalign{\bigskip\lbf #1\verysmallskip}%
204                #3}}}
205
206%
207% - macros to use inside a \sec.
208%
209% \subsec: insert a sub heading into a \sec
210% \sectext: insert non-aligned text into a \sec
211% \longentry: insert an entry with a long item field into a \sec
212% \longitem: insert an entry with a long item field and no
213%   definition field into a \sec
214%
215\def\subsec#1{\noalign{\smallskip\bf #1}}
216\long\def\sectext#1\cr{\noalign{\strut\hyphenpenalty=50 #1\strut}}
217% the `\ ' forces a non empty item field
218\long\def\longentry#1&#2\cr{\noalign{\strut\tt #1\strut}\ &#2\cr}
219\long\def\longitem#1\cr{\noalign{\strut\tt #1\strut}}
220
221%
222% - initialization.
223%
224
225% set output routine
226\newbox\leftcolumn
227\newbox\centercolumn
228\let\currentcolumn=L
229\output={\if L\currentcolumn
230            \global\setbox\leftcolumn=\columnbox \global\let\currentcolumn=C%
231         \else
232            \if C\currentcolumn
233               \global\setbox\centercolumn=\columnbox \global\let\currentcolumn=R%
234            \else
235               \tripleformat \global\let\currentcolumn=L%
236            \fi
237         \fi}
238
239% switch to our default font
240\rm
241
242% ragged format
243\raggedbottom
244\raggedright
Note: See TracBrowser for help on using the repository browser.