source: git/doc/singcard.tex @ fde4e4

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