commit 2a0afd7e8e5a1ad38a0902f5e424d2295ea06591
parent 963804fe82bc0f125867042c714e30217a768a8d
Author: robert <robertrussell.72001@gmail.com>
Date: Fri, 17 Dec 2021 21:35:58 -0800
Import and organize more text macros from plain
Diffstat:
| M | text.tex | | | 104 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- |
1 file changed, 103 insertions(+), 1 deletion(-)
diff --git a/text.tex b/text.tex
@@ -2,16 +2,17 @@
% for uppercase letters. The following changes are needed:
\sfcode`\)=0 \sfcode`\'=0 \sfcode`\]=0
+% Punctuation spacing control
\def\frenchspacing{%
\sfcode`\.=1000 \sfcode`\?=1000 \sfcode`\!=1000
\sfcode`\:=1000 \sfcode`\;=1000 \sfcode`\,=1000
}
-
\def\nonfrenchspacing{%
\sfcode`\.=3000 \sfcode`\?=3000 \sfcode`\!=3000
\sfcode`\:=2000 \sfcode`\;=1500 \sfcode`\,=1250
}
+% Interlineskip control
\def\nointerlineskip{\prevdepth=-1000pt }
\def\normalbaselines{%
\baselineskip=\normalbaselineskip
@@ -26,6 +27,25 @@
\def\constlineskip{\afterassignment\@constlineskip \dimenA=}
\def\offinterlineskip{\constlineskip0pt\relax}
+% Parskip control
+% TODO: \par should be an event, and this should be accordingly rewritten
+\newskip\@oldparskip
+\def\tmpparskip{%
+ \ifx\@oldpar\@undefined
+ \glet\@oldpar=\par
+ \g\@oldparskip=\parskip
+ \gdef\@restorepar{%
+ \g\parskip=\@oldparskip
+ \glet\par=\@oldpar
+ \glet\@oldpar=\@undefined
+ }%
+ \gdef\par{\ifhmode \@restorepar\ea\par \fi}%
+ \fi
+ \g\parskip=%
+}
+\def\noparskip{\tmpparskip0pt }
+
+% Unbreakable glue
\def\topglue{\nointerlineskip \vglue-\topskip \vglue}
\def\@vglue{%
\par \dimenA=\prevdepth \hrule height0pt
@@ -38,18 +58,27 @@
}
\def\hglue{\afterassignment\@hglue \skipA=}
+% Vertical skips
+\def\smallskip{\vskip\smallskipamount}
+\def\medskip{\vskip\medskipamount}
+\def\bigskip{\vskip\bigskipamount}
+
+% Horizontal spaces
\def\negthinspace{\kern-.16667em }
\def\thinspace{\kern.16667em }
\def\enspace{\kern.5em }
+% Horizontal skips
\def\enskip{\hskip.5em\relax}
\def\quad{\hskip1em\relax}
\def\qquad{\hskip2em\relax}
+% Break control
\def~{\nobreak\ }
\def\break{\penalty-10000 }
\def\nobreak{\penalty10000 }
\def\allowbreak{\penalty0 }
+\def\eject{\par\break}
% Horizontal overlaps
\newif\if@l \newif\if@r
@@ -68,3 +97,76 @@
\def\@smash#1{\setbox0=\hbox{#1}\@finsmash}
\def\@mathsmash#1#2{\setbox0=\hbox{$\m@th\sty#1{#2}$}\@finsmash}
\def\@finsmash{\ht0=0pt \dp0=0pt \box0 }
+
+
+% TODO: sort through all this; after this, all that remains is line 729 and
+% onwards in plain.tex
+
+% \def\removelastskip{\ifdim\lastskip=\z@\else\vskip-\lastskip\fi}
+% \def\smallbreak{\par\ifdim\lastskip<\smallskipamount
+ % \removelastskip\penalty-50\smallskip\fi}
+% \def\medbreak{\par\ifdim\lastskip<\medskipamount
+ % \removelastskip\penalty-100\medskip\fi}
+% \def\bigbreak{\par\ifdim\lastskip<\bigskipamount
+ % \removelastskip\penalty-200\bigskip\fi}
+
+% \def\line{\hbox to\hsize}
+% \def\leftline#1{\line{#1\hss}}
+% \def\rightline#1{\line{\hss#1}}
+% \def\centerline#1{\line{\hss#1\hss}}
+
+% \newbox\strutbox
+% \setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}
+% \def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
+
+% \def\hidewidth{\hskip\hideskip} % for alignment entries that can stick out
+% \def\ialign{\everycr{}\tabskip\z@skip\halign} % initialized \halign
+% \newcount\mscount
+% \def\multispan#1{\omit \mscount#1\relax
+ % \loop\ifnum\mscount>\@ne \sp@n\repeat}
+% \def\sp@n{\span\omit\advance\mscount\m@ne}
+
+% \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}}
+
+% \def\mathhexbox#1#2#3{\leavevmode
+ % \hbox{$\m@th \mathchar"#1#2#3$}}
+% \def\dag{\mathhexbox279}
+% \def\ddag{\mathhexbox27A}
+% \def\S{\mathhexbox278}
+% \def\P{\mathhexbox27B}
+% \def\Orb{\mathhexbox20D}
+
+% \def\oalign#1{\leavevmode\vtop{\baselineskip\z@skip \lineskip.25ex%
+ % \ialign{##\crcr#1\crcr}}} \def\o@lign{\lineskiplimit\z@ \oalign}
+% \def\ooalign{\lineskiplimit-\maxdimen \oalign} % chars over each other
+% {\catcode`p=12 \catcode`t=12 \gdef\\#1pt{#1}} \let\getf@ctor=\\
+% \def\sh@ft#1{\dimen@#1\kern\expandafter\getf@ctor\the\fontdimen1\font
+ % \dimen@} % kern by #1 times the current slant
+% \def\d#1{{\o@lign{\relax#1\crcr\hidewidth\sh@ft{-1ex}.\hidewidth}}}
+% \def\b#1{{\o@lign{\relax#1\crcr\hidewidth\sh@ft{-3ex}%
+ % \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}}}
+% \def\c#1{{\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1%
+ % \else\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}\fi}}
+% \def\copyright{{\ooalign{\hfil\raise.07ex\hbox{c}\hfil\crcr\Orb}}}
+
+% \def\dots{\relax\ifmmode\ldots\else$\m@th\ldots\,$\fi}
+% \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX}
+
+% \def\hrulefill{\leaders\hrule\hfill}
+% \def\dotfill{\cleaders\hbox{$\m@th \mkern1.5mu.\mkern1.5mu$}\hfill}
+% \def\rightarrowfill{$\m@th\smash-\mkern-7mu%
+ % \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
+ % \mkern-7mu\mathord\rightarrow$}
+% \def\leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu%
+ % \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
+ % \mkern-7mu\smash-$}
+% \mathchardef\braceld="37A \mathchardef\bracerd="37B
+% \mathchardef\bracelu="37C \mathchardef\braceru="37D
+% \def\downbracefill{$\m@th \setbox\z@\hbox{$\braceld$}%
+ % \braceld\leaders\vrule height\ht\z@ depth\z@\hfill\braceru
+ % \bracelu\leaders\vrule height\ht\z@ depth\z@\hfill\bracerd$}
+% \def\upbracefill{$\m@th \setbox\z@\hbox{$\braceld$}%
+ % \bracelu\leaders\vrule height\ht\z@ depth\z@\hfill\bracerd
+ % \braceld\leaders\vrule height\ht\z@ depth\z@\hfill\braceru$}
+
+% \outer\def\bye{\par\vfill\supereject\end}