r3tex

custom LuaTeX format
git clone git://git.rr3.xyz/r3tex
Log | Files | Refs | README | LICENSE

commit ffd3b9ad8e6c895cb41cfcd8f57ed59e1ce0fb3d
parent 7f69e630cddbb54764c45278c6291f6590e5bfb1
Author: Robert Russell <robertrussell.72001@gmail.com>
Date:   Thu, 13 Apr 2023 21:02:14 -0700

Accumulated changes

Diffstat:
Mlist.tex | 22+++++++++++-----------
Mmath.tex | 25++++++++++++++++---------
Mmathenc.tex | 12++++++++----
Mr3tex.tex | 6+++---
Mutil.tex | 4+++-
5 files changed, 41 insertions(+), 28 deletions(-)

diff --git a/list.tex b/list.tex @@ -7,7 +7,7 @@ % overlapped in to the ident of the first paragraph in the item. The geometry % of a list is mostly controlled by the following parameters. -\newtoks\Lfmt % label format, generally depends on \Llvl and \Lcnt +\newtoks\Lfmt % label format; typically depends on \Llvl and \Lcnt \newdimen\Lindent % indent of first paragraph in item \newdimen\Lmaxprotrusion % max protrusion of item label into left margin \newdimen\Llmargin % bring left margin in by this amount @@ -22,7 +22,7 @@ \newcount\Llvl \Llvl=0 % list nesting level \newcount\Lcnt % item number within current list -\def\@Lbeg{% +\def\Lbeg{% \par \beggroup \Lcnt=0 @@ -34,7 +34,7 @@ \vskip\Ltopskip } -\def\@Lend{% +\def\Lend{% \par \endgroup \penalty\Lbotpenalty @@ -48,18 +48,18 @@ \par \ifnum\Lcnt>0 \penalty\Lmidpenalty \vskip\Lmidskip \fi \incr\Lcnt - \setbox0=\hbox{#1}% - \dimen1=\dimexpr\wd0-\Lmaxprotrusion\relax - \dimen0=\ifdim\Lindent<\dimen1 \dimen1 \else \Lindent \fi - \noindent\hbox to\dimen0{\hss\box0}% + \setbox\boxA=\hbox{#1}% + \dimenB=\dimexpr\wd\boxA-\Lmaxprotrusion\relax + \dimenA=\ifdim\Lindent<\dimenB \dimenB \else \Lindent \fi + \noindent\hbox to\dimenA{\hss\box\boxA}% } % Common list types % TODO: some of these belong in style \newdimen\@Lpwd -\def\begxlist#{\@Lbeg\Lfmt=} +\def\begxlist#{\Lbeg\Lfmt=} \def\begplist#1#2#3{% - \@Lbeg + \Lbeg \def\csA{#3}% \ifx\csA\empty \Lfmt={\rm(#1\/)#2}% TODO: use robust italic correction @@ -74,8 +74,8 @@ \def\begblist{\begxlist{$\m@th\bullet$\enspace}} % bullets \def\begol{\begnlist} -\def\endol{\@Lend} +\def\endol{\Lend} \def\begul{\begblist} -\def\endul{\@Lend} +\def\endul{\Lend} \endinput diff --git a/math.tex b/math.tex @@ -107,7 +107,7 @@ \mathop{\vtop{\m@th\ialign{% ##\crcr $\hfil\displaystyle{#1}\hfil$\crcr - \noalign{\kern3pt\nointerlineskip}% + \noalign{\kern1pt\nointerlineskip}% \upbracefill\crcr \noalign{\kern1pt}% }}}\limits @@ -231,8 +231,8 @@ \def\@penup{\advance\lineskip\dimenA \advance\baselineskip\dimenA \advance\lineskiplimit\dimenA} -\let\dsty\displaystyle -\def\@malign{\hfil\strut$\dsty{##}$\tabskip=0pt&$\dsty{{}##}$\hfil} +\def\@dsty{\displaystyle\displaymath} +\def\@malign{\hfil\strut$\@dsty{##}$\tabskip=0pt&$\@dsty{{}##}$\hfil} \def\eqalignskip{\qquad} \def\eqalign#1{\null\,\vcenter{\openup1\jot \m@th \ialign{\cspan\@malign&&\eqalignskip\cspan\@malign\crcr #1\crcr}}\,} @@ -244,20 +244,27 @@ \def\@lign{\tabskip0pt \everycr={}} % restore inside \displ@y \def\exalignno#1{\displ@y \tabskip=\centering \halign to\displaywidth{% - \hfil$\@lign\dsty{##}$\tabskip=0pt&$\@lign\dsty{{}##}$\hfil& + \hfil$\@lign\@dsty{##}$\tabskip=0pt&$\@lign\@dsty{{}##}$\hfil& \qquad\hbox{\rm##}\hfil\tabskip=\centering& \llap{$\@lign##$}\tabskip=0pt\crcr #1\crcr}} \def\eqalignno#1{\displ@y \tabskip\centering - \halign to\displaywidth{\hfil$\@lign\displaystyle{##}$\tabskip0pt - &$\@lign\displaystyle{{}##}$\hfil\tabskip\centering + \halign to\displaywidth{\hfil$\@lign\@dsty{##}$\tabskip0pt + &$\@lign\@dsty{{}##}$\hfil\tabskip\centering &\llap{$\@lign##$}\tabskip0pt\crcr #1\crcr}} \def\displaylines#1{\displ@y \tabskip0pt - \halign{\hbox to\displaywidth{$\@lign\hfil\displaystyle##\hfil$}\crcr + \halign{\hbox to\displaywidth{$\@lign\hfil\@dsty##\hfil$}\crcr #1\crcr}} -% \def\bmod{\nonscript\mskip-\medmuskip\mkern5mu - % \mathbin{\rm mod}\penalty900\mkern5mu\nonscript\mskip-\medmuskip} +\def\bmod{% + \nonscript\mskip-\medmuskip + \mkern5mu + \mathbin{\rm mod}% + \penalty900 + \mkern5mu + \nonscript\mskip-\medmuskip +} + \def\mod#1{\allowbreak\ifinner\ \else\mkern18mu\fi({\rm mod}\,\,#1)} \def\cases#1{\left\{\,\vcenter{\normalbaselines\m@th % XXX: \m@th here is wrong; should be inside leftmost column diff --git a/mathenc.tex b/mathenc.tex @@ -4,8 +4,10 @@ \mathcode`\ ="8000 % \space \mathcode`\!="5021 \mathcode`\'="8000 % ^\prime -\mathcode`\(="4028 -\mathcode`\)="5029 +%\mathcode`\(="4028 +%\mathcode`\)="5029 +\mathcode`\(="42B9 +\mathcode`\)="52BA \mathcode`\*="2203 % \ast \mathcode`\+="202B \mathcode`\,="613B @@ -18,9 +20,11 @@ \mathcode`\=="303D \mathcode`\>="313E \mathcode`\?="503F -\mathcode`\[="405B +%\mathcode`\[="405B +\mathcode`\[="42BB \mathcode`\\="026E % \backslash -\mathcode`\]="505D +%\mathcode`\]="505D +\mathcode`\]="52BC \mathcode`\_="8000 \mathcode`\{="4266 \mathcode`\|="026A diff --git a/r3tex.tex b/r3tex.tex @@ -9,13 +9,13 @@ \input text \input math \input page -% \input font +\input font % \input section \input list -% \input verbatim +\input verbatim % \input graphics \input color -\input tmpfont % TODO tmp +%\input tmpfont % TODO tmp \input hyphen % Libraries: diff --git a/util.tex b/util.tex @@ -25,6 +25,7 @@ \chardef\&=`\& \chardef\#=`\# \chardef\$=`\$ +\chardef\~=`\~ % Misc, mostly from plain \let\bgroup={ @@ -122,7 +123,8 @@ {\obeytabs\glet^^I=\tab} % See The TeXBook, page 254. { \obeytabs % These lines can not have tab indents. -\gdef\@expandtabs{% XXX \toksA not initialized +\gdef\@expandtabs{% +\toksA={}% \loop\ifnum\countA>0 \toksA\ea{\the\toksA\ }\decr\countA\repeat \obeytabs \edef^^I{\the\toksA}% }