From 5a7558513376185b97f10c78af55ead77ea1f6ea Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 4 Apr 2011 21:14:13 +0200 Subject: [PATCH] Prechod na novy format sazby - Misto starobyleho mjmac.tex pouzivame ucwmac.tex s prislusenstvim (prilozen v adresari ucw/*, viz commit e9f8d5a27e2b8f118f1c721d2bec0ac7728d55dd v jeho repository). - lecnotex.tex adaptovany na volani ucwmacu, navic do nich pribyla nova makra \= (priraditko v programu), \cmt (komentar v programu) a cislovani verzi v patickach stranek. - Makerules zjednoduseny, uz nevyrabeji preskladana PDFka (dnes uz si snad kazdy umi stranky preskladat, ale radeji se poptam). --- Makerules | 26 ++---- lecnotes.tex | 63 ++++++------- ucw/test.tex | 102 ++++++++++++++++++++ ucw/ucw-ofs.tex | 98 ++++++++++++++++++++ ucw/ucw-verb.tex | 136 +++++++++++++++++++++++++++ ucw/ucwmac.tex | 235 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 605 insertions(+), 55 deletions(-) create mode 100644 ucw/test.tex create mode 100644 ucw/ucw-ofs.tex create mode 100644 ucw/ucw-verb.tex create mode 100644 ucw/ucwmac.tex diff --git a/Makerules b/Makerules index 14eeea9..82e3eac 100644 --- a/Makerules +++ b/Makerules @@ -1,26 +1,14 @@ -export TEXINPUTS=.:..: +export TEXINPUTS=.:..:../ucw: -all: $P.ps +all: $P.ps $P.pdf -%.dvi: %.tex ../lecnotes.tex ../mjmac.tex +%.dvi: %.tex ../lecnotes.tex csplain $< -#%.pdf: %.tex ../lecnotes.tex ../mjmac.tex -# pdfcsplain $< - %.ps: %.dvi - dvips -D600 -o $@ -O-15.4mm,-15.4mm -t a5 $< - -%.pdf: %.dvi - dvipdfm -o $@ -x 9mm -y 9mm -p a5 -r 600 -z 9 $< - -%-booklet.ps: %.ps - psbook <$< | pstops '2:0L(210mm,0)+1L(210mm,148mm)' | sed 's/^%%BoundingBox: .*/%%BoundingBox: 0 0 595 842/;s/^%%DocumentPaperSizes:.*/%%DocumentPaperSizes: a4\n%%Orientation: Landscape/' | pstopsfix >$@ - -%-2in1.ps: %.ps - pstops '2:0L(210mm,0mm)+1L(210mm,148mm)' <$< | sed 's/^%%BoundingBox: .*/%%BoundingBox: 0 0 595 842/;s/^%%DocumentPaperSizes:.*/%%DocumentPaperSizes: a4\n%%Orientation: Landscape/' | pstopsfix >$@ + dvips -D600 -o $@ -t a5 $< -%-booklet.pdf: %-booklet.ps +%.pdf: %.ps ps2pdf $< $@ mostlyclean: @@ -31,8 +19,8 @@ clean:: mostlyclean ifndef CUSTOM_UPLOAD upload:: - make $P-booklet.pdf - scp -C $P-booklet.pdf jabberwock:www/vyuka/0809/ads1/$P-booklet.pdf + make $P.pdf + rsync $P.pdf jabberwock:www/vyuka/1011/ads1/$P.pdf endif .SECONDARY: diff --git a/lecnotes.tex b/lecnotes.tex index 087c9d3..9963432 100644 --- a/lecnotes.tex +++ b/lecnotes.tex @@ -1,28 +1,25 @@ % Makra pro sazbu zapisku z prednasky -\input mjmac.tex +\input ucwmac.tex +\input ucw-verb.tex +\input ucw-ofs.tex \input epsf.tex -%%\input btxmac.tex \language=\czech \chyph \lefthyphenmin=2 \righthyphenmin=2 - -% A4 s 0.5in okraji -%\hsize=184.6mm -%\vsize=271.6mm -%\parindent=0.25in +\inlineverbon % A5 s 1cm okraji, dolni rozsiren o 10pt, aby se tam veslo cislo stranky -\hsize=128mm -\vsize=190mm -\advance\vsize by -10pt +\setmargins{1cm} +\advance\bottommargin by 10pt +\setpaper{a5} \parindent=0.8cm % Zacatek prednasky {cislo prednasky}{jmeno prednasky}{jmeno zapisovatele} \def\prednaska#1#2#3{% -\line{{\Large\bf #1. #2} \hfil {\it #3}} +\line{{\setfonts[/14]\bf #1. #2} \hfil {\it #3}} \vskip 4pt \hrule \medskip @@ -43,7 +40,7 @@ % Srdicko na konci dukazu \def\qed{{\parfillskip=0pt\allowbreak\hfill\nobreak $\heartsuit$\par}} -% pokud je v seznamu: +% ... pokud je v seznamu: \def\qeditem{{\parfillskip=0pt\hfill\rlap{\hskip\rightskip\llap{$\heartsuit$}}\par}} % Poznamky pod carou @@ -64,14 +61,14 @@ % \endalgo \def\algo{ -\interlistskip \begingroup +\vskip\preitemizeskip \let\:=\algoitem \parskip=1pt plus 1pt minus 0.3pt \rightskip=2em \itemcount=0 } -\def\endalgo{\interlistskip\endgroup} +\def\endalgo{\vskip\postitemizeskip\endgroup} \def\algopar{\par \parindent=2em \hangindent=4em @@ -86,6 +83,12 @@ \def\algin{\:{\I Vstup:} } \def\algout{\:{\I Výstup:} } +% Priraditko +\def\={\leftarrow} + +% Komentar v programu +\def\cmt#1{~~{\sl (#1)}} + % Nekolikapismenkova promenna (mozno pouzit v textovem i math modu) \def\<#1>{\leavevmode\hbox{\it #1\/}} @@ -127,27 +130,15 @@ % Todo \def\todo#1{{\bf TODO: \it #1}} -% Blackboard bold font -\newfam\bbfam -\font\bbten=bbold10 -\font\bbseven=bbold7 -\font\bbfive=bbold5 -\textfont\bbfam=\bbten -\scriptfont\bbfam=\bbseven -\scriptscriptfont\bbfam=\bbfive -\def\bb{\bbten\fam\bbfam} - -% Reference na konci kapitoly -%\bibliographystyle{abbrv} -%\def\references{\h{Literatura}\dumprefs} -%\def\dumprefs{ -%\def\bblhook{\parskip=2pt plus 1pt minus 0.5pt} -%\bibliography{../ga} -%} - -% Predefinujeme odsazovani odrazek z mjmacu -\def\itemspacingrules{\ifitem\advance\leftskip by \parindent\parindent=0pt\itemfalse\else -\advance\leftskip by 2.5em\fi\rightskip=\leftskip} - % Matematicke symboly \def\symdiff{\mathop{\Delta}} + +%%% Cislovani verzi %%% + +\def\currentversion{% +\the\year +-\ifnum\month<10\relax 0\fi\the\month +-\ifnum\day<10\relax 0\fi\the\day +} + +\footline={\hfil {\tenrm\the\count0}\hfil \llap{\sevenrm\currentversion}} diff --git a/ucw/test.tex b/ucw/test.tex new file mode 100644 index 0000000..6fa2939 --- /dev/null +++ b/ucw/test.tex @@ -0,0 +1,102 @@ +\input ucwmac.tex +\input ucw-ofs.tex +\input ucw-verb.tex + +\showfonts + +\twelvepoint + +\pageunderlay{\placeat{0pt}{0pt}{\crosshair{10pt}}} + +\def\hd#1{\bigskip\leftline{\bf #1}\medskip} + +\hd{Box placement: ordinary word, vbox, vtop, vhang, vhanglines} + +\def\brum{\hbox{Brum}} +\def\brums{\brum\brum\brum} + +\noindent +\placeat{0pt}{0pt}{\vlap{\hbox to 0.5\hsize{\hrulefill}}}% +\placeat{0pt}{0pt}{\crosshair{10pt}}% +\brum{} +\vbox{\brums} +\vtop{\brums} +\vhang{\brums} +\vhanglines{\brums} + +\hd{Itemization} + +\noindent An~itemized list: + +\itemize\ibull +\:It is an important and popular fact that things are not always what +they seem. For instance, on the planet Earth, man had always assumed +that he was more intelligent than dolphins because he had achieved so +much -- the wheel, New York, wars and so on -- whilst all the dolphins +had ever done was muck about in the water having a good time. But +conversely, the dolphins had always believed that they were far more +intelligent than man -- for precisely the same reasons. +\:Curiously enough, the dolphins had long known of the impending +destruction of the of the planet Earth and had made many attempts to +alert mankind to the danger; but most of their communications were +misinterpreted\dots{} --- Douglas Addams: HHG +\:Third: + \itemize\istar + \:Primus + \: Secundus %% are spaces eaten correctly? + \:Tertius + \:Graecus: + \numlist\ngreek + \:alpha + \:beta + \: gamma + \endlist + \endlist +\:Fourth +\endlist + +\hd{Inline verbatim} + +\inlineverbon +Lo and behold: |a quick brown fox| {\showspacestrue |jumps over the lazy dog|} |!@#$%^&*()\_| + +\inlineverboff +When turned off, vertical lines work as usually: $|a-b| \ge 0$. + +Delimited verbatim: \verb@abracadabra@ or \verb|brekeke|. + +\hd{Block verbatim} + +\noindent Pre-verbatim +\showspacestrue +\verbatim{ +abracadabra {!@#$%^&*()\_} +1 tab +12 tab +123 tab +1234 tab +12345 tab +123456 tab +1234567 tab +12345678 tab tab +123456789 tab45678 tab +123456789 tab45678 tab&space +123456789 tabtab + +123456789 tabtab +} +\noindent Post-verbatim + +%\verbinput{ucwmac.tex} + +\hd{Font selection} + +{\bo non-extended bold} + +{\csc Caps And Small Caps} + +$x\in\fam\bbfam R$ + +The set{\settextsize{11}text}size macro does not strew spaces. + +\bye diff --git a/ucw/ucw-ofs.tex b/ucw/ucw-ofs.tex new file mode 100644 index 0000000..4ede88b --- /dev/null +++ b/ucw/ucw-ofs.tex @@ -0,0 +1,98 @@ +% The UCW Macro Collection: Interface to OFS (Olsak's Font System) +% Written by Martin Mares in 2010 and placed into public domain +% ------------------------------------------------------------------------- + +\ifx\OFSversion\undefined +\input ofs.tex +% \detailfontmessages +\fi + +% We extend OFS's default CM family by several fonts: cmb, cmcsc + +\ofsputfamlist{^^JUCW:} + +\ofsdeclarefamily [CMRomanUCW] {% ------------ Computer Modern Roman (UCW extended version) + \loadtextfam cmr\fotenc;% + cmbx\fotenc;% + cmti\fotenc;% + cmbxti\fotenc;\defaultextraenc;% + \newvariant8 \sl (Slanted) cmsl\fotenc;\defaultextraenc;% + \newvariant9 \bxsl (BoldSlanted) cmbxsl\fotenc;\defaultextraenc;% + \newvariant a \bo (BoldNormal) cmb\fotenc;\defaultextraenc;% + \newvariant b \csc (CapsAndSmallCaps) cmcsc\fotenc;\defaultextraenc;% + \newvariant c \sltt (SlantedTypewriter) cmsltt\fotenc;\defaultextraenc;% + \newvariant d \itt (ItalicTypewriter) cmitt\fotenc;\defaultextraenc;% + \modifyenc 8z:csfont;% +} +\registerenc: 8z + +\registertfm cmb8z - csb10 +\registertfm cmb8z 0pt-6pt csb5 +\registertfm cmb8z 6pt-7pt csb6 +\registertfm cmb8z 7pt-8pt csb7 +\registertfm cmb8z 8pt-9pt csb8 +\registertfm cmb8z 9pt-10pt csb9 +\registertfm cmb8z 10pt-12pt csb10 +\registertfm cmb8z 12pt-17pt csb12 +\registertfm cmb8z 17pt-* csb17 + +\registertfm cmcsc8z - cscsc10 +\registertfm cmcsc8z 0pt-6pt cscsc5 +\registertfm cmcsc8z 6pt-7pt cscsc6 +\registertfm cmcsc8z 7pt-8pt cscsc7 +\registertfm cmcsc8z 8pt-9pt cscsc8 +\registertfm cmcsc8z 9pt-10pt cscsc9 +\registertfm cmcsc8z 10pt-12pt cscsc10 +\registertfm cmcsc8z 12pt-17pt cscsc12 +\registertfm cmcsc8z 17pt-* cscsc17 + +\ofsdeclarefamily [BlackboardBold] {% + \loadtextfam bbm;% + ;% + ;% + ;\defaultextraenc;% +} + +\registertfm bbm - bbm10 +\registertfm bbm 0pt-6pt bbm5 +\registertfm bbm 6pt-7pt bbm6 +\registertfm bbm 7pt-8pt bbm7 +\registertfm bbm 8pt-9pt bbm8 +\registertfm bbm 9pt-10pt bbm9 +\registertfm bbm 10pt-12pt bbm10 +\registertfm bbm 12pt-17pt bbm12 +\registertfm bbm 17pt-* bbm17 + +\setfonts[CMRomanUCW/] + +% \bb - blackboard bold math font + +\newfam\bbfam +\def\bb{\fam\bbfam} + +\def\loadbbm{% + \loadmathfam\bbfam[/bbm]% +} +\loadbbm + +% Recalculate line spacing for a given point size of the font (assuming CM-like metrics). +% Also sets \strut and \topskip. +\def\setbaselines#1{% + \dimen0=1pt + \dimen0=#1\dimen0 + \normalbaselineskip=1.2\dimen0 + \normallineskip=0.1\dimen0 + \setbox\strutbox=\hbox{\vrule height 0.85\dimen0 depth 0.35\dimen0 width 0pt}% + \topskip=1\dimen0 + \normalbaselines +} + +% Switch to a specified font size (including math, line spacing etc.) +\def\settextsize#1{% + \def\fomenc{CM}% + \setfonts[/#1]% + \setmath[//]% + \setbaselines{#1}% + \loadbbm +} +\def\twelvepoint{\settextsize{12}} diff --git a/ucw/ucw-verb.tex b/ucw/ucw-verb.tex new file mode 100644 index 0000000..981aebe --- /dev/null +++ b/ucw/ucw-verb.tex @@ -0,0 +1,136 @@ +% The UCW Macro Collection: Verbatim environments +% Written by Martin Mares in 2010 and placed into public domain +% ------------------------------------------------------------------------- + +% We'll use internal macros of plain TeX +\catcode`@=11 + +% New \frenchspacing, which doesn't leave unwanted spaces in text. +\def\frenchsp@cing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m% +\sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m} + +% Typesetting of one verbatim word: |word| (enable by \inlineverbon) + +% Set if spaces should be rendered as "bath-tub" glyphs +\newif\ifshowspaces +\showspacesfalse + +\def\make@ther#1{\catcode`#1=12\relax} +\def\setverb@tim{\tt\frenchsp@cing\catcode`\`=13\catcode`\'=13\n@ligs% +\let\do=\make@ther\dospecials\obeyspaces\showsp@ces} + +{\catcode`'=13 +\catcode``=13 +\gdef\n@ligs{\def`{\relax\lq}\def'{\relax\rq}}} + +{\obeyspaces +\global\chardef\sp@ce=32 +\gdef\showsp@ces{\ifshowspaces\let =\sp@ce\fi} +\global\let =\ } + +{\catcode124=\active % Make | active +\gdef\ttst@rt{\begingroup\setverb@tim\let|=\endgroup} +\gdef\inlineverbon{\catcode124=\active\let|=\ttst@rt} +\gdef\inlineverboff{\catcode124=12} +} + +% Typesetting of verbatim text with a given delimiter: +% - usage: \verb%verbatim text% +% - the delimiter is the first character after \verb +% - remember that writing (for example) \verbz with meaning \verb +% with the delimiter 'z' is possible only if \catcode`z is not 11 + +\def\verb{\relax\def\sv@rb##1{\uccode`~=`##1% +\uppercase{\catcode`~13\global\let~\endgroup}}% +\begingroup\setverb@tim\sv@rb} + +% Typesetting of verbatim blocks: +% - the block is enclosed in balanced {}'s +% - leading and trailing empty lines are ignored +% - all other empty lines are converted to \verbemptylineskip's +% - tabs are interpreted (one tab stop per \verbtabsize columns) +% - \showspacestrue works here, too, but it does not apply to tabs + +\newskip\verbstartskip % vskip before \verbatim +\newskip\verbendskip % vskip after \verbatim +\newskip\verbinterlineskip % between adjacent non-empty lines +\newskip\verbemptylineskip % instead of every empty line +\newskip\verbleftskip % left and right margin +\newskip\verbrightskip + +\verbstartskip=3pt plus 1pt minus 0.3pt +\verbendskip=\verbstartskip +\verbinterlineskip=0pt +\verbemptylineskip=5pt plus 2pt +\verbleftskip=0in +\verbrightskip=0pt plus 1fil + +% Can be re-defined to customize the verbatim environment +\def\verblocaldefs{} + +% Size of a single tab +\newcount\verbtabsize +\verbtabsize=8 + +\newdimen\v@rbspace +\newdimen\t@b +\newdimen\t@bwidth + +% When a complete line is assembled in \box0, \verbship is called to add it +% to the main vertical list. You can override it to get e.g. line numbering. +\def\verbship{% + \ifdim\wd0>0pt + \ifdim\v@rbspace>0pt + \penalty-100 + \vskip\v@rbspace + \else + \ifdim\v@rbspace=0pt + \vskip\verbinterlineskip + \fi + \fi + \line{\hskip\verbleftskip \box0 \hskip\verbrightskip} + \v@rbspace=0pt + \else + \advance\v@rbspace by \verbemptylineskip + \fi +} + +\newcount\verbcnt +\def\v@rbend{\par\egroup\endgroup\vskip\verbendskip} +\def\v@rbl{\ifnum\verbcnt>0\{\fi\global\advance\verbcnt by 1\relax} +\def\v@rbr{\ifnum\verbcnt>1\}\else\v@rbend\fi\global\advance\verbcnt by -1\relax} + +\def\v@rbparams{% + \setverb@tim + \raggedbottom + \verbcnt=0 + \v@rbspace=-1000pt + \catcode124=12 + \vskip\verbstartskip + \let\par=\endb@x + \obeylines +} + +\def\startb@x{\setbox0=\hbox\bgroup} +\def\endb@x{\egroup\verbship\startb@x} + +{\catcode`\^^I=\active +\gdef\setupt@bs{\catcode`\^^I=\active +\setbox0=\hbox{\ }\t@bwidth=\wd0\multiply\t@bwidth by \verbtabsize +\def^^I{\egroup\t@b=\wd0\divide\t@b by \t@bwidth% +\multiply\t@b by \t@bwidth% +\advance\t@b by \t@bwidth\advance\t@b by -\wd0\startb@x\box0\hbox to \t@b{}}% +}} + +{ +\catcode`[=1\catcode`]=2\catcode123=\active\catcode125=\active +\gdef\verbatim[\begingroup\v@rbparams\catcode123=\active\catcode125=\active% +\let{=\v@rbl\let}=\v@rbr\chardef\{=123\chardef\}=125\verblocaldefs\setupt@bs\startb@x% +]] + +% Input file verbatim + +\def\verbinput#1{\begingroup\v@rbparams\verblocaldefs\setupt@bs\startb@x\input #1 \egroup\endgroup} + +% Let's hide all internal macros +\catcode`@=12 diff --git a/ucw/ucwmac.tex b/ucw/ucwmac.tex new file mode 100644 index 0000000..96680ad --- /dev/null +++ b/ucw/ucwmac.tex @@ -0,0 +1,235 @@ +% The UCW Macro Collection (a successor of mjmac.tex) +% Written by Martin Mares in 2010 and placed into public domain +% ------------------------------------------------------------------------- + +%%% Prolog %%% + +% We'll use internal macros of plain TeX +\catcode`@=11 + +%%% PDF output detection %%% + +\newif\ifpdf +\pdffalse + +\ifx\pdfoutput\undefined +\else\ifnum\pdfoutput>0 + \pdftrue +\fi\fi + +%%% Page size and margins %%% + +% If you modify these registers, call \setuppage afterwards +\newdimen\pagewidth +\newdimen\pageheight +\newdimen\leftmargin +\newdimen\rightmargin +\newdimen\topmargin +\newdimen\bottommargin +\newdimen\evenpageshift + +\def\setuppage{% + \hsize=\pagewidth + \advance\hsize by -\leftmargin + \advance\hsize by -\rightmargin + \vsize=\pageheight + \advance\vsize by -\topmargin + \advance\vsize by -\bottommargin + \hoffset=\leftmargin + \advance\hoffset by -1truein + \voffset=\topmargin + \advance\voffset by -1truein + \ifpdf + \pdfpagewidth=\pagewidth + \pdfpageheight=\pageheight + \fi +} + +% Set multiple margins to the same value +\def\sethmargins#1{\leftmargin=#1\relax\rightmargin=#1\relax\evenpageshift=0pt\relax} +\def\setvmargins#1{\topmargin=#1\relax\bottommargin=#1\relax} +\def\setmargins#1{\sethmargins{#1}\setvmargins{#1}} + +% Define inner/outer margin instead of left/right +\def\setinneroutermargin#1#2{\leftmargin#1\relax\rightmargin#2\relax\evenpageshift=\rightmargin\advance\evenpageshift by -\leftmargin} + +% Use a predefined paper format, calls \setuppage automagically +\def\setpaper#1{% + \expandafter\let\expandafter\currentpaper\csname paper-#1\endcsname + \ifx\currentpaper\relax + \errmessage{Undefined paper format #1} + \fi + \currentpaper +} + +% Switch to landscape orientation, calls \setuppage automagically +\def\landscape{% + \dimen0=\pageheight + \pageheight=\pagewidth + \pagewidth=\dimen0 + \setuppage +} + +% Common paper sizes +\def\defpaper#1#2#3{\expandafter\def\csname paper-#1\endcsname{\pagewidth=#2\pageheight=#3\setuppage}} +\defpaper{a3}{297truemm}{420truemm} +\defpaper{a4}{210truemm}{297truemm} +\defpaper{a5}{148truemm}{210truemm} +\defpaper{a6}{105truemm}{148truemm} +\defpaper{letter}{8.5truein}{11truein} +\defpaper{legal}{8.5truein}{14truein} + +% Default page parameters +\setmargins{1truein} +\setpaper{a4} + +%%% Placing material at specified coordinates %%% + +% Set all dimensions of a given box register to zero +\def\smashbox#1{\ht#1=0pt \dp#1=0pt \wd#1=0pt} +\def\smashedhbox#1{{\setbox0=\hbox{#1}\smashbox0\box0}} +\def\smashedvbox#1{{\setbox0=\vbox{#1}\smashbox0\box0}} + +% Variants of \llap and \rlap working equally on both sides and/or vertically +\def\hlap#1{\hbox to 0pt{\hss #1\hss}} +\def\vlap#1{\vbox to 0pt{\vss #1\vss}} +\def\clap#1{\vlap{\hlap{#1}}} + +% \placeat{right}{down}{hmaterial} places , so that its +% reference point lies at the given position wrt. the current ref point +\long\def\placeat#1#2#3{\smashedhbox{\hskip #1\lower #2\hbox{#3}}} + +% Like \vbox, but with reference point in the upper left corner +\def\vhang#1{\vtop{\hrule height 0pt\relax #1}} + +% Like \vhang, but respecting interline skips +\def\vhanglines#1{\vtop{\hbox to 0pt{}#1}} + +% Crosshair with reference point in its center +\def\crosshair#1{\clap{\vrule height 0.2pt width #1}\clap{\vrule height #1 width 0.2pt}} + +%%% Output routine %%% + +\newbox\pageunderlays +\newbox\pageoverlays +\newbox\commonunderlays +\newbox\commonoverlays + +% In addition to the normal page contents, you can define page overlays +% and underlays, which are zero-size vboxes positioned absolutely in the +% front / in the back of the normal material. Also, there are global +% versions of both which are not reset after every page. +\def\addlay#1#2{\setbox#1=\vbox{\ifvbox#1\box#1\fi\smashedvbox{#2}}} +\def\pageunderlay{\addlay\pageunderlays} +\def\pageoverlay{\addlay\pageoverlays} +\def\commonunderlay{\addlay\commonoverlays} +\def\commonoverlay{\addlay\commonoverlays} + +% Our variation on \plainoutput, which manages inner/outer margins and overlays +\output{\ucwoutput} +\def\ucwoutput{\wigglepage\shipout\vbox{% + \makeheadline + \ifvbox\commonunderlays\copy\commonunderlays\nointerlineskip\fi + \ifvbox\pageunderlays\box\pageunderlays\nointerlineskip\fi + \pagebody + \ifvbox\commonoverlays\vbox to 0pt{\vskip -\vsize\copy\commonoverlays}\fi + \ifvbox\pageoverlays\vbox to 0pt{\vskip -\vsize\box\pageoverlays}\fi + \makefootline +}\advancepageno +\ifnum\outputpenalty>-\@MM \else\dosupereject\fi} + +\def\wigglepage{\ifodd\pageno\else\advance\hoffset by \evenpageshift\fi} + +% Make it easier to redefine footline font (also, fix it so that OFS won't change it unless asked) +\let\footfont=\tenrm +\footline={\hss\footfont\folio\hss} + +%%% Itemization %%% + +% Default dimensions of itemized lists +\newdimen\itemindent \itemindent=0.5in +\newdimen\itemnarrow \itemnarrow=0.5in % make lines narrower by this amount +\newskip\itemmarkerskip \itemmarkerskip=0.4em % between marker and the item +\newskip\preitemizeskip \preitemizeskip=3pt plus 2pt minus 1pt % before the list +\newskip\postitemizeskip \postitemizeskip=3pt plus 2pt minus 1pt % after the list +\newskip\interitemskip \interitemskip=2pt plus 1pt minus 0.5pt % between two items + +% Analogues for nested lists +\newdimen\nesteditemindent \nesteditemindent=0.25in +\newdimen\nesteditemnarrow \nesteditemnarrow=0.25in +\newskip\prenesteditemizeskip \prenesteditemizeskip=0pt +\newskip\postnesteditemizeskip \postnesteditemizeskip=0pt + +\newif\ifitems\itemsfalse +\newbox\itembox +\newcount\itemcount + +\def\preitemize{ + \ifitems + \vskip\prenesteditemizeskip + \advance\leftskip by \nesteditemindent + \advance\rightskip by \nesteditemnarrow + \else + \vskip\preitemizeskip + \advance\leftskip by \itemindent + \advance\rightskip by \itemnarrow + \fi + \parskip=\interitemskip +} + +\def\postitemize{ + \ifitems + \vskip\postnesteditemizeskip + \else + \vskip\postitemizeskip + \fi +} + +\def\inititemize{\begingroup\preitemize\itemstrue\parindent=0pt} + +\def\itemize#1{\inititemize\setbox\itembox\llap{#1\hskip\itemmarkerskip}% +\let\:=\singleitem} + +\def\singleitem{\par\leavevmode\copy\itembox\ignorespaces} + +\def\endlist{\par\endgroup\postitemize} + +\def\ibull{\raise0.2ex\hbox{$\bullet$}} % Signs frequently used for \itemize +\def\idot{\raise0.2ex\hbox{$\cdot$}} +\def\istar{\raise0.2ex\hbox{$\ast$}} + +\def\numlist#1{\inititemize\itemcount=0\let\:=\numbereditem +\let\itemnumbering=#1} + +\def\numbereditem{\par\leavevmode\advance\itemcount by 1 +\llap{\itemnumbering\hskip\itemmarkerskip}\ignorespaces} + +\def\nnorm{\the\itemcount} +\def\ndotted{\nnorm.} +\def\nparen{\nnorm)} +\def\nroman{\romannumeral\itemcount} +\def\nromanp{\nroman)} +\def\nalpha{\count@=96\advance\count@ by\itemcount\char\count@)} +\def\nAlpha{\count@=64\advance\count@ by\itemcount\char\count@)} +\def\ngreek{$\ifcase\itemcount\or\alpha\or\beta\or\gamma\or\delta\or\epsilon\or +\zeta\or\eta\or\theta\or\iota\or\kappa\or\lambda\or\mu\or\nu\or\xi\or\pi\or\rho +\or\sigma\or\tau\or\upsilon\or\phi\or\chi\or\psi\or\omega\fi$)} + +%%% Miscellanea %%% + +% {\I italic} with automatic italic correction +\def\I{\it\aftergroup\/} + +% A breakable dash, to be repeated on the next line +\def\={\discretionary{-}{-}{-}} + +% Non-breakable identifiers +\def\<#1>{\leavevmode\hbox{\I #1}} + +% A handy shortcut +\let\>=\noindent + +%%% Epilog %%% + +% Let's hide all internal macros +\catcode`@=12 -- 2.39.5