Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

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