home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / text / pastex-1.3-3of8.lha / PasTeX / macros / nice.tex (.txt) < prev    next >
LaTeX Document  |  1991-01-15  |  19KB  |  457 lines

  1. % NICE Version 2 macro package for plain TeX
  2. % written by
  3. %   Christian Rank
  4. %   Br\"augasse 13/225
  5. %   D-8390 Passau
  6. %   E-Mail: rank@unipas.fmi.uni-passau.de
  7. %   (please don't e-mail from outside Germany!)
  8. % THIS MACRO PACKAGE MAY BE COPIED AND USED FREELY ONLY IN THIS ORIGINAL STATE
  9. % WITHOUT ANY CHANGES.
  10. % TO PRESERVE COMPATIBILITY, PLEASE DO NOT MODIFY THIS FILE UNDER ANY
  11. % CIRCUMSTANCES. YOU CAN CUSTOMIZE THE NICE PACKAGE FOR YOUR NEEDS VIA AN
  12. % AUXILIARY FILE WHICH READS IN NICE.TEX AND THEN CHANGES PARAMETERS
  13. % AND/OR DEFINES ADDITIONAL COMMANDS.
  14. % we check first if NICE has already been read, in which case we do not need
  15. % to define the NICE macros again.
  16. \expandafter\ifx\csname niceversion\endcsname \relax \else \endinput \fi
  17. % NICE hasn't already been read, so we continue
  18. \def\niceversion{2.0}
  19. \def\versionof {17/09/90}
  20. \immediate\write16 {NICE version \niceversion, (c) 1990 by C. Rank}
  21. \everyjob {\immediate\write16 {NICE version \niceversion \space of \versionof}}
  22. \catcode`\@=11 % for definition of private macros
  23. % adjustment of general parameters
  24. \vsize 9.2truein \hsize 6.5truein % page layout
  25. \baselineskip=12pt \lineskiplimit=0pt \lineskip=0pt
  26. \smallskipamount=6pt plus 1pt minus 1pt
  27. \medskipamount=12pt plus 2pt minus 2pt
  28. \bigskipamount=18pt plus 3pt minus 3pt
  29. \parskip=6pt plus 1pt minus 1pt
  30. \parindent=0pt
  31. \tolerance=10000
  32. \hbadness=5000
  33. % the fonts used
  34. \font\documenttitlefont=cmr10 scaled \magstep4
  35. \font\sectiontitlefont=cmbx10 scaled \magstep2
  36. \font\subsectiontitlefont=cmbx10 scaled \magstep1
  37. \font\subsubsectiontitlefont=cmbx10 scaled \magstephalf
  38. % fonts used for variable size styles
  39. \font\ninerm=cmr9 \font\eightrm=cmr8 \font\sixrm=cmr6
  40. \font\ninei=cmmi9 \font\eighti=cmmi8 \font\sixi=cmmi6
  41. \font\ninesy=cmsy9 \font\eightsy=cmsy8 \font\sixsy=cmsy6
  42. \font\ninebf=cmbx9 \font\eightbf=cmbx8 \font\sixbf=cmbx6
  43. \font\ninesl=cmsl9 \font\eightsl=cmsl8
  44. \font\ninett=cmtt9 \font\eighttt=cmtt8
  45. \font\nineit=cmti9 \font\eightit=cmti8 \font\sevenit=cmti7
  46. % the variable size styles
  47. \def\ninept{\textfont0=\ninerm \scriptfont0=\sevenrm
  48.         \scriptscriptfont0=\fiverm
  49.         \def\rm{\fam0 \ninerm}
  50.         \textfont1=\ninei \scriptfont1=\seveni \scriptscriptfont1=\fivei
  51.         \def\oldstyle{\fam1 \ninei}
  52.         \textfont2=\ninesy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  53.         \textfont\itfam=\nineit \def\it{\fam\itfam \nineit}
  54.         \textfont\slfam=\ninesl \def\sl{\fam\slfam \ninesl}
  55.         \textfont\bffam=\ninebf \scriptfont\bffam=\sevenbf
  56.         \scriptscriptfont\bffam=\fivebf \def\bf{\fam\bffam \ninebf}
  57.         \textfont\ttfam=\ninett \def\tt{\fam\ttfam \ninett}
  58.         \baselineskip=11pt
  59.         \rm
  60. \def\eightpt{\textfont0=\eightrm \scriptfont0=\sixrm
  61.         \scriptscriptfont0=\fiverm
  62.         \def\rm{\fam0 \eightrm}
  63.         \textfont1=\eighti \scriptfont1=\sixi \scriptscriptfont1=\fivei
  64.         \def\oldstyle{\fam1 \eighti}
  65.         \textfont2=\eightsy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  66.         \textfont\itfam=\eightit \def\it{\fam\itfam \eightit}
  67.         \textfont\slfam=\eightsl \def\sl{\fam\slfam \eightsl}
  68.         \textfont\bffam=\eightbf \scriptfont\bffam=\sixbf
  69.         \scriptscriptfont\bffam=\fivebf \def\bf{\fam\bffam \eightbf}
  70.         \textfont\ttfam=\eighttt \def\tt{\fam\ttfam \eighttt}
  71.         \baselineskip=10pt
  72.         \rm
  73. \def\sevenpt{\textfont0=\sevenrm \scriptfont0=\sixrm
  74.         \scriptscriptfont0=\fiverm
  75.         \def\rm{\fam0 \sevenrm}
  76.         \textfont1=\seveni \scriptfont1=\sixi \scriptscriptfont1=\fivei
  77.         \def\oldstyle{\fam1 \seveni}
  78.         \textfont2=\sevensy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  79.         \textfont\itfam=\sevenit \def\it{\fam\itfam \sevenit}
  80.         \textfont\slfam=\eightsl \def\sl{\fam\slfam \eightsl}
  81.         \textfont\bffam=\sevenbf \scriptfont\bffam=\sixbf
  82.         \scriptscriptfont\bffam=\fivebf \def\bf{\fam\bffam \sevenbf}
  83.         \textfont\ttfam=\eighttt \def\tt{\fam\ttfam \eighttt}
  84.         \baselineskip=9pt
  85.         \rm
  86. \def\sixpt{\textfont0=\sixrm \scriptfont0=\fiverm
  87.         \scriptscriptfont0=\fiverm
  88.         \def\rm{\fam0 \sixrm}
  89.         \textfont1=\sixi \scriptfont1=\fivei \scriptscriptfont1=\fivei
  90.         \def\oldstyle{\fam1 \sixi}
  91.         \textfont2=\sixsy \scriptfont2=\fivesy \scriptscriptfont2=\fivesy
  92.         \textfont\itfam=\sevenit \def\it{\fam\itfam \sevenit}
  93.         \textfont\slfam=\eightsl \def\sl{\fam\slfam \eightsl}
  94.         \textfont\bffam=\sixbf \scriptfont\bffam=\fivebf
  95.         \scriptscriptfont\bffam=\fivebf \def\bf{\fam\bffam \sixbf}
  96.         \textfont\ttfam=\eighttt \def\tt{\fam\ttfam \eighttt}
  97.         \baselineskip=8pt
  98.         \rm
  99. \def\fivept{\textfont0=\fiverm \scriptfont0=\fiverm
  100.         \scriptscriptfont0=\fiverm
  101.         \def\rm{\fam0 \fiverm}
  102.         \textfont1=\fivei \scriptfont1=\fivei \scriptscriptfont1=\fivei
  103.         \def\oldstyle{\fam1 \fivei}
  104.         \textfont2=\fivesy \scriptfont2=\fivesy \scriptscriptfont2=\fivesy
  105.         \textfont\itfam=\sevenit \def\it{\fam\itfam \sevenit}
  106.         \textfont\slfam=\eightsl \def\sl{\fam\slfam \eightsl}
  107.         \textfont\bffam=\fivebf \scriptfont\bffam=\fivebf
  108.         \scriptscriptfont\bffam=\fivebf \def\bf{\fam\bffam \fivebf}
  109.         \textfont\ttfam=\eighttt \def\tt{\fam\ttfam \eighttt}
  110.         \baselineskip=7pt
  111.         \rm
  112. % this stuff defines a macro `include', which has the same effect as plain
  113. % TeX's `input', except that it is no error if the file does not exist.
  114. \newread\testinclude
  115. \def\include#1{\immediate\openin\testinclude #1
  116.         \ifeof\testinclude \immediate\write16 {No file #1.}
  117.         \else \immediate\closein\testinclude \input #1
  118.         \fi}
  119. % general utilities
  120. \def\newpage{\vfill\eject}
  121. \def\\{$\backslash$}
  122. \def\raggedcenter{\leftskip=0pt plus 4em \rightskip=\leftskip
  123.         \parfillskip=0pt \spaceskip=.3333em \xspaceskip=.5em
  124.         \pretolerance=9999 \tolerance=9999 \hbadness=10000
  125.         \hyphenpenalty=9999 \exhyphenpenalty=9999}
  126. \def\parwithoutskip{{\parskip=0pt plus 0.5pt\par\noindent}\ignorespaces}
  127. \newdimen\narrowskip \narrowskip=20pt
  128. \def\lnarrower{\advance\leftskip by \narrowskip}
  129. \let\onarrower=\narrower
  130. \def\narrower{\advance\leftskip by \narrowskip
  131.         \advance\rightskip by \narrowskip}
  132. \def\tw@num#1{\ifnum#1>9 #1\else 0#1\fi}
  133. \def\date{\tw@num{\the\day}/\tw@num{\the\month}/\the\year}
  134. \def\ifndef#1{\expandafter\ifx\csname#1\endcsname\relax}
  135. % title and section layout
  136. \long\def\title#1{{\raggedcenter \documenttitlefont #1 \par}}
  137. \def\titlepage{\begingroup
  138.         \def\title##1{{\raggedcenter \documenttitlefont ##1 \par}\medskip}
  139.         \long\def\author##1{{\parskip=0pt \raggedcenter \rm ##1 \par}}
  140.         \def\release##1{\centerline{\bf ##1}}
  141.         \def\abstract{\centerline{\bf Abstract}\narrowskip=3truecm \narrower}
  142.         \def\endtitlepage{\vfil\egroup \newpage \endgroup}
  143.         \vbox to \vsize \bgroup \vfil}
  144. \newcount\sectionno \sectionno=0
  145. \newcount\subsectionno
  146. \newcount\subsubsectionno
  147. \newtoks\sectionnscheme
  148. \sectionnscheme={\gensect. }
  149. \newtoks\subsectionnscheme
  150. \subsectionnscheme={\gensect.\number\subsectionno. }
  151. \newtoks\subsubsectionnscheme
  152. \subsubsectionnscheme={\gensect.\number\subsectionno
  153.         .\number\subsubsectionno. }
  154. \def\genheading#1#2#3{\vskip\parskip \vbox{
  155.         \setbox0 \hbox{#1#2} \hangindent=\the\wd0 \hangafter=1
  156.         \noindent \raggedright \pretolerance=10000 \box0 #1#3\par}}
  157. \def\gensect{\ifnum \sectionno<0 \char\number-\sectionno
  158.         \else \number\sectionno\fi}
  159. \def\plainsection#1{\removelastskip
  160.         \bigskip
  161.         \genheading{\sectiontitlefont}{}{#1}
  162.         \ifnum\contentslevel>0
  163.         {\let\the=0 \edef\next{\write\fcontents
  164.                 {\vskip\contskip \hbox to \hsize
  165.                 {\scstyle \hskip\the\scindent #1 \the\contfill\ 
  166.                  \the\pageno}}}\next}
  167.         \immediate\write16 {#1}
  168.         \fi
  169.         \ifnum\marklevel>0 \mark {#1} \fi
  170.         \nobreak}
  171. \def\section#1{\removelastskip
  172.         \bigskip
  173.         \ifnum \sectionno<-1 \global\advance\sectionno by -1
  174.         \else \global\advance\sectionno by 1
  175.         \fi
  176.         \global\subsectionno=0
  177.         \genheading{\sectiontitlefont}{\the\sectionnscheme}{#1}
  178.         {\edef\nscheme{\the\sectionnscheme}
  179.         \ifnum\contents