Annotation of OpenXM_contrib/pari-2.2/doc/parimacro.tex, Revision 1.1.1.1
1.1 noro 1: % $Id: parimacro.tex,v 1.11 2001/02/08 17:56:03 karim Exp $
2: % Copyright (c) 2000 The PARI Group
3: %
4: % This file is part of the PARI/GP documentation
5: %
6: % Permission is granted to copy, distribute and/or modify this document
7: % under the terms of the GNU Free Documentation License
8:
9: \catcode`\@=11
10: %
11: % GENERAL FORMATTING
12: %
13: \newif\ifGPHELP
14: \newif\ifPDF
15: \newread\std
16: \def\checkfile#1{\def\@stdfile{#1}\openin\std=#1\relax}
17: \long\def\@ifundef#1#2#3{\expandafter\ifx\csname
18: #1\endcsname\relax#2\else#3\fi}
19:
20: % do we come from gphelp ?
21: \@ifundef{fromgphelp}{\GPHELPfalse}{\GPHELPtrue}
22: \ifGPHELP %YES
23: \magnification=\magstep1
24: \baselineskip=13pt
25: \else %NO
26: \magnification=\magstephalf
27: \checkfile{wantpdfoutput} % check if we want PDF output
28: \ifeof\std \else \PDFtrue \fi
29: \fi
30:
31: % if paricfg.tex is there (Configure succeeded), input it, otherwise use
32: % default values
33: \checkfile{paricfg.tex}
34: \ifeof\std
35: \checkfile{doc/paricfg.tex}
36: \fi
37: \ifeof\std
38: \ifGPHELP\else% OK for gphelp to use default values
39: \message{paricfg.tex not found. You should run Configure.}
40: \fi
41: \def\vers{2.0.x}
42: \def\miscdir{/usr/local/lib/pari}
43: \def\includedir{/usr/local/include/pari}
44: \def\libdir{/usr/local/lib}
45: \def\wwwsite{\kbd{http://www.parigp-home.de/}}
46: \else
47: \input\@stdfile
48: \fi
49:
50: \font\chaptertitlefont=cmr12 scaled \magstep1
51: \font\chaptertitlebf=cmbx10 scaled \magstep2
52: \font\sectiontitlebf=cmbx12
53: \font\seventt=cmtt8 scaled 875
54: \scriptfont\ttfam=\seventt % we should really set the \hyphenchar etc first
55: \parskip=6pt plus 3pt minus 1.5pt
56: \overfullrule=0pt
57:
58: %%
59: %% CROSS REFERENCING & INDEX
60: %%
61: \newif\ifsecondpass
62: \newwrite\out
63: \newwrite\aux
64: \ifGPHELP % disable crossreferences
65: \def\condwrite#1#2{}
66: \def\idx#1{#1}
67: \def\toindex#1{}
68: \def\tocwrite#1{}
69: \def\label#1{}
70: \def\ref#1{[{\bf ??}]} % all crossref marked as [??]
71: \else % none of the following is needed by gphelp
72: \def\typeout#1{\immediate\write\out{#1}}
73: \def\@namedef#1{\expandafter\def\csname#1\endcsname}
74: \def\newlabel#1#2{\@ifundef{r@#1}{}{\message{Label `#1' multiply
75: defined}}\global\@namedef{r@#1}{#2}}
76:
77: \openin\std=users.std
78: \ifeof\std
79: \secondpassfalse
80: \typeout{FIRST PASS}
81: \csname newwrite\endcsname\toc
82: \csname newwrite\endcsname\index
83: \openout\toc=\jobname.toc
84: \openout\index=\jobname.idx
85: \let\condwrite=\write
86: \else
87: \secondpasstrue
88: \typeout{SECOND PASS}
89: \let\immediate\relax
90: \def\condwrite#1#2{}
91: \fi
92:
93: %default font for index entry
94: \def\f@nt{rm}
95:
96: %% \toindex{#1} = put #1 in index; use font \f@nt, indicate \pageno.
97: %% If PDF, associate the page to a unique integer (\pdfdestcntr).
98: \ifPDF
99: \def\toindex#1{\putdest
100: \immediate\condwrite\index{!#1!\f@nt!\the\pageno!\number\pdfdestcntr}}
101: \else
102: \def\toindex#1{%
103: \immediate\condwrite\index{!#1!\f@nt!\the\pageno!}}
104: \fi
105:
106: \checkfile{users.aux}% don't use \jobname: may be used by tutorial.tex
107: \ifeof\std
108: \message{No aux file.}
109: \else
110: \input\@stdfile% input aux file if present
111: \fi
112:
113: % \ref, \label. We need an auxiliary file written during first pass
114: \openout\aux=\jobname.aux
115:
116: \ifx\inputlineno\undefined
117: \let\on@line\empty
118: \else
119: \def\on@line{ on input line \the\inputlineno}
120: \fi
121: \def\@errundef#1{\typeout{Reference `#1' on page \the\pageno \space
122: undefined\on@line}}
123:
124: \def\@car#1#2\@nil{#1}
125: \def\@cdr#1#2\@nil{#2}
126:
127: \def\@ref {\expandafter\@cdr\@temp \@nil\null}
128: \def\@cref{\expandafter\@car\@temp \@nil\null}
129:
130: \def\label#1{\immediate\write\aux{\string
131: \newlabel{#1}{{\the\chapno}{\currentlabel}}}}
132: \def\ref#1{\@ifundef{r@#1}
133: {{\bf ??}\@errundef{#1}}
134: {\edef\@temp{\csname r@#1\endcsname}%
135: \def\lbl{\@ref}\def\chp{\@cref}%
136: \ifx\chp{\the\chapno}\lbl\else\chp.\lbl\fi}}
137: \fi % end of non-gphelp section
138:
139: %%
140: %% VERBATIM MODE
141: %%
142: % \doverb: setup verbatim mode for the first argument, and execute \do{\arg}
143: \def\setupverb{\def\do##1{\catcode`##1=12}\dospecials
144: \catcode`\ =10% standard space
145: \catcode`\f=13% to break ugly ligatures as in nf{}init, use \EFF instead
146: }
147: % f won't produce any ligature if catcode 13, e.g in verbatim mode (cf above).
148: { \let\GDEF=\gdef \global\let\EFF=f \catcode`\f=13
149: \GDEFf{\EFF{}}}
150:
151: \begingroup
152: \catcode`<=1\catcode`\{=12
153: \catcode`>=2\catcode`\}=12
154: \gdef\d@verb#1<% gobble #1 = {
155: \def\next##1}<\gdef\@verb<##1>\endgroup%
156: \do<\@verb>>% \@verb is the (verbatim) argument
157: \next>
158: \gdef\d@verbb#1<% gobble #1 = {
159: \def\next##1}{##2}<\gdef\@verba<##1>\gdef\@verbb<##2>\endgroup%
160: \do<\@verba><\@verbb>>% \@verba, \@verbb are the two (verbatim) argument
161: \next>
162: %
163: \endgroup
164: \def\doverb {\begingroup\setupverb\d@verb}
165: \def\doverbb{\begingroup\setupverb\d@verbb}
166:
167: % argument (silently) goes to index
168: \def\sidx{\gdef\f@nt{rm}\let\do=\toindex\doverb} % \rm
169: \def\kbdsidx{\gdef\f@nt{tt}\let\do=\toindex\doverb}% \tt
170:
171: % argument printed + sent to index
172: \def\@idx#1{#1\toindex{#1}}
173: \def\idx{\gdef\f@nt{rm}\let\do=\@idx\doverb}
174:
175: % to index + set up as key (keyword)
176: \def\@keyidx#1{{\bf\@idx{#1}}}
177: \def\teb{\gdef\f@nt{tt}\let\do=\@keyidx\doverb}
178:
179: % to index + set up as kbd (verbatim)
180: \def\@kbdidx#1{{\tt\@idx{#1}}}
181: \def\tet{\gdef\f@nt{tt}\let\do=\@kbdidx\doverb}
182:
183: % to index + set up as var (variable)
184: \def\@kbdvar#1{{\it\@idx{#1}\/}}
185: \def\tev{\gdef\f@nt{it}\let\do=\@kbdvar\doverb}
186:
187: \def\@syn#1#2{\gdef\f@nt{tt}\toindex{#1}The library syntax is $\key{#1}(#2)$}
188: \def\syn{\let\do=\@syn\doverb}
189: \def\@synt#1#2{\@syn{#1}{\hbox{\tt#2}}}
190: \def\synt{\let\do=\@synt\doverb}
191:
192: % function prototypes
193: % types omitted in funs (for chap 3)
194: \def\funno#1#2#3{\noindent{\tt#1 $\key{#2}$(#3)}} % no index
195: \def\@funs#1#2{\gdef\f@nt{tt}\noindent\toindex{#1}$\key{#1}(#2)$}
196: \def\@fun#1#2#3{\gdef\f@nt{tt}\toindex{#2}\funno{#1}{#2}{#3}}
197: \def\fun{\let\do=\@fun\doverbb}
198: \def\funs{\let\do=\@funs\doverb} % simple fun (omit return type)
199:
200: \def\secref#1{Section~\ref{#1}}
201:
202: %%
203: %% SECTIONS
204: %%
205: \newcount\appno
206: \newcount\chapno
207: \newcount\secno
208: \newcount\subsecno
209: \newcount\subsubsecno
210:
211: \def\newpage{\hbox{}\vfill\eject}
212: %Table of contents. cf TeXBook Exercice 21.10
213: \def\tocwrite#1{{\let\the=0\edef\next{\condwrite\toc{#1}}\next}}
214: \let\putchapdest\relax
215: \let\sectionhook\relax
216:
217: \def\title#1#2{%
218: \ifodd\pageno\else\newpage\fi
219: \tocwrite{#1 #2\string\dotfill\the\pageno}
220: \ifGPHELP\else
221: \putchapdest
222: \centerline{\chaptertitlefont #1}\medskip
223: \fi
224: \centerline{\let\bf\chaptertitlebf \chaptertitlefont #2}\vskip1cm}
225: \def\sectitle#1{%
226: \tocwrite{{\sevenrm\hskip0.5cm#1\string\dotfill\the\pageno}}%
227: \vskip 0pt plus 54pt\penalty-600% good break
228: \vskip 24pt plus -45pt minus 9pt%
229: \putchapdest%
230: \leftline{\sectionhook{\sectiontitlebf #1}.}
231: \penalty10000 % impossible break
232: \smallskip}% whatever follows will add a \parskip
233:
234: \def\subsectitle#1{%
235: \vskip 0pt plus 45pt\penalty-300
236: \vskip 6pt plus -42pt minus 3pt
237: \sectionhook\noindent{\bf#1}}
238:
239: \def\subsubsectitle#1{% a \parskip is being added anyway by \noindent
240: \par\vskip 0pt plus 39pt\penalty-200
241: \vskip 0pt plus -37pt minus 1.5pt
242: \sectionhook\noindent{\bf#1}}
243:
244: \ifGPHELP
245: \let\maketitle\relax
246: \else
247: \def\maketitle{%
248: \ifnum\chapno=0
249: \currentlabel.
250: \else
251: \number\chapno.\currentlabel\
252: \fi}
253: \fi
254:
255: \def\misctitle#1{\par\vskip 0pt plus 66pt\penalty-400
256: \vskip 3pt plus -64pt minus 1.5pt\noindent{\bf #1}}
257:
258: % Chapter headings occupy two lines in the manual (only one in
259: % INSTALL.tex and gphelp-extracted bits). Syntax requirement: After calling
260: % \chapter{...} and possibly \label{...} etc, an empty line _must_ follow
261: % before the first paragraph of text or section heading begins. [GN]
262: \def\chapter#1#2\par{
263: \secno=0\global\advance\chapno by 1
264: \title{Chapter \number\chapno:}{#1}#2\noindent\ignorespaces}
265: \def\appendix#1\par{
266: \chapno=0
267: \secno=0\global\advance\appno by 1
268: \def\applet{\ifcase\appno\or A\or B\or C\or D\or E\or F\or G\fi}
269: \title{Appendix \applet:}{#1}\noindent\ignorespaces}
270: \def\section#1{%
271: \subsecno=0\global\advance\secno by 1%
272: \gdef\currentlabel{\number\secno}%
273: \sectitle{\maketitle#1}}
274: \def\subsec#1{
275: \subsubsecno=0\global\advance\subsecno by 1
276: \gdef\currentlabel{\number\secno.\number\subsecno}
277: \subsectitle{\maketitle#1}}
278: \def\subsubsec#1{
279: \global\advance\subsubsecno by 1
280: \gdef\currentlabel{\number\secno.\number\subsecno.\number\subsubsecno}
281: \subsubsectitle{\maketitle#1}}
282:
283: \def\annotepar#1{\noindent\llap{#1:\ \ }}
284: \def\unix{\annotepar{UNIX}}
285: \def\emacs{\annotepar{EMACS}}
286:
287: \def\@secunix#1{\begingroup\def\sectionhook{\unix{}}\do{#1}\endgroup}
288: \def\sectionunix#1{{\let\do=\section\@secunix{#1}}}
289: \def\subsecunix#1{{\let\do=\subsec\@secunix{#1}}}
290: \def\subsubsecunix#1{{\let\do=\subsubsec\@secunix{#1}}}
291: \def\@subsecidxunix#1{{\let\do=\@subsecidx\@secunix{#1}}}
292: \def\@subsubsecidxunix#1{{\let\do=\@subsubsecidx\@secunix{#1}}}
293:
294: \def\subseckbd#1{\subsec{\kbd{#1}}}
295: \def\@subsecidx#1{\subsec{#1}\toindex{#1}}
296: \def\subsecidx{\gdef\f@nt{tt}\let\do=\@subsecidx\doverb}
297: \def\@subsubsecidx#1{\subsubsec{#1}\toindex{#1}}
298: \def\subsubsecidx{\gdef\f@nt{tt}\let\do=\@subsubsecidx\doverb}
299:
300: \def\subsecidxunix{\gdef\f@nt{tt}\let\do=\@subsecidxunix\doverb}
301: \def\subsubsecidxunix{\gdef\f@nt{tt}\let\do=\@subsubsecidxunix\doverb}
302:
303: %
304: % General purpose
305: %
306: \def\begintitle{
307: \begingroup\nopagenumbers
308: \font\mine=cmb10 scaled 1893
309: \hbox{}
310: }
311: \def\authors{
312: \centerline{C. Batut, K. Belabas, D. Bernardi, H. Cohen, M. Olivier}
313: \vskip 1.truecm
314: \centerline{Laboratoire A2X, U.M.R. 9936 du C.N.R.S.}
315: \centerline{Universit\'e Bordeaux I, 351 Cours de la Lib\'eration}
316: \centerline{33405 TALENCE Cedex, FRANCE}
317: \centerline{\tt e-mail: pari@math.u-bordeaux.fr}
318: \vskip 2.truecm
319: \centerline{Home Page:}
320: \centerline{\wwwsite}
321: \vskip .5truecm
322: \centerline{Primary {\tt ftp} site:}
323: \centerline{\tt ftp://megrez.math.u-bordeaux.fr/pub/pari/}
324: \vskip 1.truecm
325: }
326:
327: \def\copyrightpage{
328: \begintitle
329: \vskip 14cm
330: \noindent Copyright \copyright\ 2000 The PARI Group
331: \medskip\par
332: \noindent Permission is granted to make and distribute verbatim copies of
333: this manual provided the copyright notice and this permission notice are
334: preserved on all copies.
335: \medskip\par
336: \noindent Permission is granted to copy and distribute modified versions, or
337: translations, of this manual under the conditions for verbatim copying,
338: provided also that the entire resulting derived work is distributed under the
339: terms of a permission notice identical to this one.
340: \bigskip\par
341: \noindent PARI/GP is Copyright \copyright\ 2000 The PARI Group
342: \medskip\par
343: \noindent PARI/GP is free software; you can redistribute it and/or modify it
344: under the terms of the GNU General Public License as published by the Free
345: Software Foundation. It is distributed in the hope that it will be useful,
346: but WITHOUT ANY WARRANTY WHATSOEVER.
347: \endtitle
348: }
349:
350: \def\endtitle{\newpage\endgroup}
351:
352: \newfam\euffam
353: \font\teneuf=eufm10
354: \textfont\euffam=\teneuf
355: \def\goth#1{{\fam\euffam#1}}
356: \def\d{\goth d}
357: \def\f{\goth f}
358: \def\p{{\bf p}}
359: \def\kbd#1{{\tt #1}}
360: \def\key#1{{\bf #1}}
361: \def\var#1{\hbox{\it #1\/}}
362: \def\fl{\var{f\kern0pt lag}}
363:
364: \def\bs{{\char'134}}
365: \def\obr{{\char'173}}
366: \def\cbr{{\char'175}}
367: \def\pow{\^{}\hskip0pt}
368: \def\til{\raise-0.3em\hbox{\~{}}}
369: \def\b#1{{\tt \bs#1}}
370: \def\mod{\,{\rm mod}\,}
371: \def\text#1{{\rm#1}}
372: \def\dfrac#1#2{{{#1}\over{#2}}}
373: \def\binom#1#2{\pmatrix{{#1}\cr{#2}}}
374: \def\Bbb#1{{\bf #1}}
375: {\catcode`\_=11
376: \gdef\typ#1{\kbd{t_#1}}}
377: \def\Z{\Bbb Z}
378: \def\Q{\Bbb Q}
379: \def\F{\Bbb F}
380: \def\R{\Bbb R}
381: \def\C{\Bbb C}
382: \def\dotfill{\leaders\hbox to 3truemm{\hfil.\hfil}\hfill}
383: \def\B{\kbd{BIL}}
384: \def\op{{\it op\/}}
385:
386: % verbatim mode, leave alone $ and _
387: % @ made active: assume verbatim text doesn't contain it
388: \newif\ifnopar
389: {\catcode`\^=13\global\let^=\pow\obeyspaces\global\let \ }
390: \def\ttverb{%
391: \nopartrue
392: \catcode`\\=12%
393: \catcode`\{=12%
394: \catcode`\}=12%
395: \catcode`\&=12%
396: \catcode`\#=12%
397: \catcode`\%=12%
398: \catcode`\^=13%
399: \catcode`\~=13\def~{{\til}}%
400: \catcode`\@=0%
401: \def\par{\futurelet\next\dopars}%
402: \def\dopars{%
403: \ifnopar \noparfalse%
404: \else% treat two consecutive \par specialy
405: \ifx\next\par \vskip4pt plus 1pt\nopartrue%
406: \else \leavevmode\endgraf\fi\fi}%
407: \obeyspaces\obeylines\tt}
408:
409: % back to normalcy
410: \def\unverb{%
411: \catcode`\\=0%
412: \catcode`\{=1%
413: \catcode`\}=2%
414: \catcode`\$=3%
415: \catcode`\&=4%
416: \catcode`\#=6%
417: \catcode`\^=7%
418: \catcode`\_=8%
419: \catcode`\^^I=10}
420:
421: \def\bprogpart{\begingroup%
422: \vskip 0pt plus 1pt%
423: \leavevmode\parskip=0pt plus 1pt%
424: \interlinepenalty2000\clubpenalty9000\widowpenalty9000%
425: \ttverb}
426:
427: % complete verbatim (including _ and $)
428: \def\bprogfile#1{\bprog\input#1\eprog}
429: \def\bprog{\bprogpart\catcode`\_=12\catcode`\$=12}
430: \def\eprog{\endgroup\par}
431: {\obeylines
432: \gdef\com{\begingroup\unverb\comstart}
433: \gdef\comstart#1^^M{\it#1\endgroup
434: } % newline after @endgroup is important
435: }
436: % comments
437: \def\Ccom{\begingroup\unverb\Ccomstart}
438: \def\Ccomstart#1*/{\rm#1\endgroup*/}
439: \catcode`\@=12
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>