Annotation of OpenXM_contrib/pari-2.2/doc/users.tex, Revision 1.1
1.1 ! noro 1: % $Id: users.tex,v 1.11 2001/09/11 12:25:20 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: % This file should be compiled with plain TeX
! 10: \def\TITLE{User's Guide to Pari-GP}
! 11: \input parimacro.tex
! 12: \ifPDF % PDF output (requires pdftex)
! 13: \input pdfmacs.tex
! 14: \fi
! 15:
! 16: %
! 17: % START TYPESET
! 18: %
! 19: \begintitle
! 20: \vskip 2.5truecm
! 21: \centerline{\mine User's Guide}
! 22: \vskip 1.truecm
! 23: \centerline{\mine to}
! 24: \vskip 1.truecm
! 25: \centerline{\mine PARI / GP}
! 26: \vskip 1.truecm
! 27: \authors
! 28: \centerline{last updated 28 August 2001}
! 29: \centerline{for version \vers}
! 30: \endtitle
! 31:
! 32: \copyrightpage
! 33:
! 34: \begintitle
! 35: \centerline{Table of Contents}\medskip
! 36: \ifsecondpass
! 37: \parskip=0pt plus 1pt
! 38: \parindent=0pt
! 39: \obeylines\input\jobname.toc
! 40: \else
! 41: % toc is 1 page long, uncomment below if it gets longer
! 42: % \newpage
! 43: \fi
! 44: \endtitle
! 45:
! 46: \chapno=0
! 47: { \input usersch1 }
! 48: { \input usersch2 }
! 49: { \input usersch3 }
! 50: { \input usersch4 }
! 51: { \input usersch5 }
! 52: { \input appa }
! 53: { \input appb }
! 54: { \input appc }
! 55:
! 56: %%
! 57: %% INDEX (Macros)
! 58: %%
! 59:
! 60: \ifsecondpass\else
! 61: \condwrite\index{The End}
! 62: \immediate\condwrite\toc{Index\string\dotfill\the\pageno}
! 63: \ifPDF \writesecnumbers \fi
! 64: \expandafter\end % stop here the first time (don't process index)
! 65: \fi
! 66:
! 67: \ifPDF
! 68: % Add a bookmark entry for the index. CHB
! 69: \putchapdest
! 70: \pdfoutline goto name {pdfchap@\the\pdfchapcntr} {Index}
! 71: \fi
! 72:
! 73: \newdimen\fullhsize
! 74: \fullhsize=\hsize
! 75: \advance\hsize by -20pt
! 76: \divide\hsize by 2
! 77:
! 78: \def\fullline{\hbox to\fullhsize}
! 79: \let\lr=L\newbox\leftcolumn
! 80:
! 81: \headline={\hfil\bf Index\hfil\global\headline={\hfil}}
! 82:
! 83: \def\makeheadline{\vbox to 0pt{\vskip-22.5pt
! 84: \fullline{\vbox to8.5pt{}\the\headline}\vss}
! 85: \nointerlineskip}
! 86:
! 87: \def\makefootline{\baselineskip=24pt\fullline{\the\footline}}
! 88:
! 89: \output={\if L\lr %cf. The TeXbook, p257
! 90: \global\setbox\leftcolumn=\columnbox\global\let\lr=R
! 91: \else\doubleformat\global\let\lr=L\fi
! 92: \ifnum\outputpenalty>-20000\else\dosupereject\fi}
! 93: \def\doubleformat{\shipout\vbox
! 94: {\makeheadline
! 95: \fullline{\box\leftcolumn\hfil\columnbox}
! 96: \makefootline}
! 97: \advancepageno}
! 98: \def\columnbox{\leftline{\pagebody}}
! 99:
! 100: \def\parse!#1#2!#3!#4!#5 {%
! 101: \uppercase{\def\theletter{#1}}%
! 102: \def\theword{#1#2}%
! 103: \def\thefont{#3}%
! 104: \def\thepage{#4}%
! 105: \def\thedest{#5}}
! 106:
! 107: \ifPDF
! 108: %% This puts the hyperlink command in the index, linked to the page
! 109: %% number. #1 is the usual page number, #2 the pdfcounter. CHB
! 110: \def\indxjump#1#2{\pdfannotlink attr {/Border [ 0 0 0 ] /H /O}
! 111: goto name {pdf@#2}\pushcolor{\linkcolor}#1\popcolor\pdfendlink}
! 112: \else
! 113: \def\indxjump#1#2{#1}
! 114: \fi
! 115:
! 116: \def\theoldword{}
! 117: \def\theoldletter{}
! 118: \def\theoldpage{}
! 119: \def\theend{The End }
! 120:
! 121: % more efficient to parse the glue specs once and keep them in registers
! 122: % for later use. These govern index lines with too many page numbers to
! 123: % fit in one line
! 124: % b: indentation for 2nd and further lines / a: compensation for same,
! 125: % and shrinkability for the normal word space
! 126: \newbox\dbox \setbox\dbox=\hbox to 3truemm{\hss.\hss}
! 127: \newskip\dfillskip \dfillskip=.5em plus .98\hsize
! 128: \def\dotfill{\leaders\copy\dbox\hskip\dfillskip\relax}
! 129: \newskip\interskipa \interskipa=-.4\hsize plus -1.5\hsize minus .11em
! 130: \newskip\interskipb \interskipb= .4\hsize plus 1.5\hsize
! 131:
! 132: % cf. The TeXbook, p393:
! 133: \def\interpage{,\penalty100\kern0.33em%normal space
! 134: \hskip\interskipa\vadjust{}\penalty10000 \hskip\interskipb\relax}
! 135:
! 136: \def\newword{\relax\endgraf%
! 137: {\csname\thefont\endcsname\theword}\dotfill\indxjump{\thepage}{\thedest}%
! 138: \let\theoldfont\thefont%
! 139: \let\theoldword\theword}
! 140:
! 141: %%
! 142: %% INDEX
! 143: %%
! 144: \parskip=0pt plus 1pt
! 145: \parindent=0pt
! 146: \parfillskip=0pt
! 147:
! 148: \catcode`\_=11 % make _ an ordinary char (frequent in function names)
! 149:
! 150: \def\li#1{\hbox to\hsize{#1\hfil}}
! 151: \li{\var{SomeWord} refers to PARI-GP concepts.}
! 152: \li{\kbd{SomeWord} is a PARI-GP keyword.}
! 153: \li{SomeWord is a generic index entry.}
! 154:
! 155: \checkfile{users.std}
! 156: \newif\ifmore
! 157: \loop
! 158: \read\std to\theline
! 159: \ifx\theline\theend\morefalse\else\moretrue\fi
! 160: \ifmore
! 161: \expandafter\parse\theline
! 162: \ifx \theletter \theoldletter \else \endgraf
! 163: \vskip 10pt plus 10pt\centerline{\bf\theletter}
! 164: \vskip 6pt plus 7pt
! 165: \fi
! 166: \ifx \theword \theoldword
! 167: \ifx \thefont \theoldfont
! 168: \ifx \thepage \theoldpage
! 169: \else \interpage \indxjump{\thepage}{\thedest}\fi
! 170: \else \newword \fi
! 171: \else \newword \fi
! 172: \let\theoldletter\theletter
! 173: \let\theoldpage\thepage
! 174: \repeat%
! 175: \end
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>