Advance native LaTeX execution and preview

This commit is contained in:
gloamxun committed 2026-11-18 22:17:21 +08:00
1 parent 91f9d76b16
commit 2741546ca8
414 files changed
+99872 -933

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
% Text-extraction gate for accents with unambiguous reference Unicode metadata.
\defaulthyphenchar=45 \defaultskewchar=127
\input math-fonts
\hsize=300pt
\def\hat{\mathaccent"705E }
\noindent Native accents: $\hat a+\hat x_i^2=\hat{a+b}$.\par
\noindent Nested accents: $\hat{\hat x}$ and $x^{\hat y}_{\hat z}$.\par
\noindent Actual script masters: $\hat x+\scriptstyle\hat x+\scriptscriptstyle\hat x$.\par
\noindent Fractions: ${\hat x\over\hat y_i}$ and $\hat{{a\over b}}$.\par
\skewchar\teni=-1
\noindent Disabled skew: $\hat x$.\par
{\skewchar\teni=127}
\noindent Persistent font state: $\hat x$.\par
\tracinglostchars=2
\noindent Missing accent: $\mathaccent"00C8 x_i^2$ retains its base and scripts.\par
\end
+19
View File
@@ -0,0 +1,19 @@
% Actual font integer defaults, scoped selectors and native mathaccent geometry.
\defaulthyphenchar=45 \defaultskewchar=127
\input math-fonts
\hsize=300pt
\def\hat{\mathaccent"705E }
\def\widehat{\mathaccent"0362 }
\def\vec{\mathaccent"017E }
\noindent Native accents: $\hat a+\hat x_i^2=\hat{a+b}$ and $\widehat{a+b+c}$.\par
\noindent Nested accents: $\hat{\hat x}$ and $x^{\hat y}_{\hat z}$.\par
\noindent Actual script masters: $\hat x+\scriptstyle\hat x+\scriptscriptstyle\hat x$.\par
\noindent Fractions: ${\hat x\over\hat y_i}$ and $\hat{{a\over b}}$.\par
\noindent Vector: $\vec x$ uses the actual OML slot.\par
\skewchar\teni=-1
\noindent Disabled skew: $\hat x$.
{\skewchar\teni=127}\noindent Restored resource state: $\hat x$.\par
\tracinglostchars=2
\noindent Missing accent: $\mathaccent"00C8 x_i^2$ retains its base and scripts.\par
\message{Actual font integers: \the\skewchar\teni/\the\hyphenchar\tenrm.}
\end
+5
View File
@@ -0,0 +1,5 @@
% This file is executed by the Route-D token/state core, not rewritten.
\countdef\counter=0
\counter=4
\def\greet#1{Hello, #1.}
\endinput
+19
View File
@@ -0,0 +1,19 @@
% Owned native hbox/vbox/vtop, box registers, glue setting and depth.
\catcode123=1 \catcode125=2 \catcode35=6
\font\body=cmr10 \body
\hsize=240pt \baselineskip=12pt \parfillskip=0pt plus1fil
\boxmaxdepth=100pt \hbadness=10000 \vbadness=10000
\setbox0=\vbox to45pt{\hbox{Vertical top}\vskip2pt plus1fil\hbox{Vertical bottom}}
\copy0
\kern8pt
\hbox{Left \vtop{\hbox{First row}\hbox{Second row}} Right}
\kern8pt
\vbox to40pt{\hbox{Finite stretch}\vskip4pt plus8pt\hbox{Finite end}}
\kern8pt
\vbox to20pt{\hbox{Finite shrink}\vskip10pt minus8pt\hbox{Tight end}}
\kern8pt
\vbox{\hbox{Nested native box}\hrule height.4pt\hbox to150pt{Left\hskip0pt plus1fil Right}}
\kern8pt
\noindent Inline \copy0 beside native text.\par
\message{Native box packing completed. Width=\the\wd0, height=\the\ht0, depth=\the\dp0.}
\end
@@ -0,0 +1,10 @@
% Real delimiter fields, as configured by a format over native primitives.
\delimiterfactor=901 \delimitershortfall=5pt
\delcode`\(="028300 \delcode`\)="029301
\delcode`\[="05B302 \delcode`\]="05D303
\delcode`\<="26830A \delcode`\>="26930B
\delcode`\/="02F30E \delcode`\|="26A30C
\def\lbrace{\delimiter"4266308 } \def\rbrace{\delimiter"5267309 }
\def\lceil{\delimiter"4264306 } \def\rfloor{\delimiter"5263305 }
\def\uparrow{\delimiter"3222378 } \def\downarrow{\delimiter"3223379 }
\def\updownarrow{\delimiter"326C33F }
@@ -0,0 +1,13 @@
% Matching-Unicode word-box gate for real normal-size paired delimiters.
\defaulthyphenchar=45
\input math-fonts
\input delimiter-codes
\hsize=300pt
\noindent Native pairs: $a+\left(b=c\right)d$ and $\left[a+b\right]=c$.\par
\noindent Nested pairs: $\left(\left[a+b\right]=c\right)$ retain their own lists.\par
\noindent Script pairs: $x^{\left(a+b\right)}$ use real optical masters.\par
\noindent Null pairs: $\left.a+b\right)$ and $\left(a+b\right.$.\par
\noindent Display pairs preserve baseline and depth.\par
$$\left(a+b=c\right)$$
Continuation after the display uses measured depth.\par
\end
+17
View File
@@ -0,0 +1,17 @@
% Full native delimiter outline/position gate, including extensible pieces.
\defaulthyphenchar=45 \defaultskewchar=127
\input math-fonts
\input delimiter-codes
\hsize=300pt
\noindent Native pairs: $a+\left(b=c\right)d$ and $\left[a+b\right]$.\par
\noindent Nested fractions: $\left( {a\over{b\over c}}\right)$.\par
\noindent Original style: $\left(\scriptscriptstyle a+b\right)$; script pairs: $x^{\left(a+b\right)}$.\par
{\delimiterfactor=5000
\noindent Actual brace pieces: $\left\lbrace a\over b\right\rbrace$.\par
\noindent Arrow pieces: $\left\uparrow a\over b\right\downarrow$ and $\left\updownarrow a\over b\right|$.\par
}
\noindent Mixed fields: $\left\lceil a\over b\right\rfloor$ and $\left<a\over b\right>$.\par
\noindent Null pairs: $\left.a\over b\right)$ and $\left(\right.$.\par
$$\left\lbrace {a\over{b\over c}}\right\rbrace$$
Continuation after display keeps the actual delimiter depth.\par
\end
+27
View File
@@ -0,0 +1,27 @@
% Actual mag/true and per-shipout device changes, including automatic paper.
\input math-fonts
\mag=1200
\pdfpagewidth=320truebp \pdfpageheight=240truebp
\pdfhorigin=12truebp \pdfvorigin=18truebp
\hoffset=2pt \voffset=3pt
\immediate\openout1=device.aux
\count0=1
\setbox0=\vbox{\hsize=200pt \baselineskip=14pt
\noindent Native device state follows this actual box and its original fonts.
Both text and mathematics $x_i^j+y$ share the same physical magnification.\par
\kern3truept \hrule height1pt
\hbox{Origin and offsets move together.}
\write1{SHIP=\number\count0;MAG=\number\mag}}
\shipout\copy0
{\pdfpagewidth=280truebp \pdfpageheight=210truebp
\pdfhorigin=20truebp \pdfvorigin=24truebp
\hoffset=-2pt \voffset=1pt
\count0=2 \shipout\copy0}
\pdfpagewidth=0pt \pdfpageheight=0pt
\pdfhorigin=8truebp \pdfvorigin=10truebp
\hoffset=0pt \voffset=0pt
\count0=3 \shipout\box0
\pdfpagewidth=999pt \pdfpageheight=888pt
\pdfhorigin=100pt \pdfvorigin=100pt
\immediate\closeout1
\end
+17
View File
@@ -0,0 +1,17 @@
% Actual showbox diagnostics, with continued execution and TeX diagnostic status.
\defaulthyphenchar=45
\input math-fonts
\hsize=240pt \showboxbreadth=3 \showboxdepth=2
\setbox0=\hbox{Actual native box.}
\message{BEFORE_SHOWS}
\tracingonline=0 \showbox0
\tracingonline=1 \showbox0
\setbox1=\vbox{\hbox{Nested material.}\vskip2pt plus1fil\hbox{Real depth.}}
\showboxbreadth=20 \showboxdepth=4 \showbox1
\setbox2=\vbox{\noindent Raw paragraph glue survives diagnostic inspection.\par}
\showbox2
\showbox3
\message{AFTER_SHOWS}
\copy0 \copy1 \copy2
\noindent Continued after diagnostics with measured material.\par
\end
@@ -0,0 +1,21 @@
% Real primitive lists and actual pattern/exception reconstitution.
\input math-fonts.tex
\hsize=110pt \parindent=0pt \baselineskip=17pt \parskip=7pt
\pretolerance=-1 \tolerance=10000 \hbadness=10000
\lefthyphenmin=1 \righthyphenmin=1
\hyphenation{of-fi-ce dif-fi-cult af-fine af-fix fluf-fy ef-fi-cient}
X office difficult affine affix fluffy efficient office.\par
X ``office'' (difficult) office affine.\par
\hyphenpenalty=-10000 \exhyphenpenalty=-10000
AA\discretionary{f-}{fi}{ffi}VV words after the branch.\par
\hyphenpenalty=50 \exhyphenpenalty=50
\font\small=cmr7 at9pt
\hyphenpenalty=-10000
AA\discretionary{\small PRE}{\small POST}{replacement}VV more words.\par
\hyphenpenalty=-10000
AA $a\discretionary{f-}{fi}{}b$ VV\par
\hyphenpenalty=50
\font\body=cmr10 at12pt \body
X office difficult affine office.\par
\message{DISCRETIONARIES-DONE}
\end
+22
View File
@@ -0,0 +1,22 @@
% Native display mode, real pre/post penalties, skips and continuation state.
\input math-fonts
\hsize=240pt \parskip=4pt
\displaywidowpenalty=50 \widowpenalty=150
\predisplaypenalty=10000 \postdisplaypenalty=0
\abovedisplayskip=12pt plus3pt minus9pt
\belowdisplayskip=12pt plus3pt minus9pt
\abovedisplayshortskip=0pt plus3pt
\belowdisplayshortskip=7pt plus3pt minus4pt
\noindent Native display formulas keep actual mathematical font masters.\par
\noindent Short prefix.$$x_i^2+y_j$$Continuation shares the paragraph state.\par
\noindent This longer prefix selects the ordinary display skips by its measured extent.
$${a+b\over c+d}=x$$The fraction keeps its measured baseline and depth.\par
\noindent Inline $y$ precedes a display.$$x+y=z$$Its italic kern stays separate from the visible edge.\par
\predisplaypenalty=-10000 \postdisplaypenalty=0
\noindent Before forced page.$$a+b=c$$After forced page.\par
\predisplaypenalty=10000 \postdisplaypenalty=-10000
\noindent Final formula prefix.$$x_2^3$$After formula starts another page.\par
\postdisplaypenalty=0
\vbox{\hsize=180pt\noindent Boxed display.$$a+b$$Resumed boxed text.\par}
\message{Native display execution completed.}
\end
@@ -0,0 +1,28 @@
% Explicit font requests, actual resources and arbitrary sizes; no format macros.
\catcode123=1 \catcode125=2 \catcode35=6
\defaulthyphenchar=45
\font\body=cmr10 at12pt
\font\small=cmr7 at9pt
\font\bold=cmbx10 at13pt
\font\italic=cmti10 scaled1201
\font\mono=cmtt10 at11pt
\font\sans=cmss10 scaled1150
\hsize=330pt \parindent=0pt \baselineskip=20pt \parskip=7pt
\parfillskip=0pt plus1fil \pretolerance=10000 \tolerance=10000
\body Real native fonts retain the requested resource and size. Roman text,
{\bold bold text}, {\italic italic text}, {\mono mono text}, {\sans sans text},
and {\small a smaller optical master scaled to nine points} share this paragraph.\par
\body office affine ff fi fl ffi ffl -- --- ``quotes'' !` ?`\par
\bold office affine ff fi fl ffi ffl -- --- ``quotes''\par
\italic office affine ff fi fl ffi ffl -- --- ``quotes''\par
\mono office affine ff fi fl ffi ffl -- --- ``quotes''\par
\small CMR7 is used at nine points without replacement.\par
\body
\setbox0=\hbox{A V}
{\fontdimen2\body=5pt}
\copy0\par
A V\par
\fontdimen6\body=18pt \fontdimen5\body=7pt
\setbox1=\hbox{A\hskip1em V\hskip1ex Z}\copy1\par
\message{DYNAMIC-FONTS-DONE}
\end
+16
View File
@@ -0,0 +1,16 @@
% No format, class or package is preloaded. Run native --initex --etex.
\catcode123=1 \catcode125=2 \catcode35=6
\defaulthyphenchar=45 \font\nativefont=cmr10 \nativefont \hsize=468pt \baselineskip=12pt \parfillskip=0pt plus1fil
\protected\def\nativeword{Native e-TeX expansion is active.}
\edef\saved{\nativeword}
\saved\par
\toksdef\stored=300
\stored={\saved}
\the\stored\par
\count32767=\numexpr(1+2)*5/2\relax
\unless\ifnum\count32767=8
\errmessage{Expression evaluation failed}
\fi
Expression result: \the\count32767.\par
\message{Native e-TeX bootstrap: semantic checks passed}
\end
+18
View File
@@ -0,0 +1,18 @@
% Fixed glue enters real horizontal, vertical, mathematical and output lists.
\input math-fonts.tex
\pdfpagewidth=360bp \pdfpageheight=300bp
\pdfhorigin=24bp \pdfvorigin=24bp
\hsize=300bp \vsize=220bp \parindent=0pt
\immediate\openout0=pages.aux
\output={\shipout\vbox{\unvbox255\hbox to\hsize{Left\hfil Footer\hfill Right}}}
\hbox to\hsize{A\hfil B\hfil C}
\hbox to\hsize{A\hss B\hfilneg C\hfill D}
\hbox to10pt{A\hss B}
\hbox spread1sp{A\hskip0pt plus-1fil B\hskip0pt plus3fil C}
\hbox spread6pt{A\hfilneg B\hfilneg C}
\vbox to40pt{\hbox{Top}\vfil\vfilneg\vfill\hbox{Bottom}}
\noindent Native math uses actual normal-unit glue: $x_i\hskip4pt+x^2$.
\hbox to\hsize{$a\hfil b\hfill c$}
\write0{fixed-glue-page=\the\count0}
\par
\end
+16
View File
@@ -0,0 +1,16 @@
% Actual CMR10 OT1 slots. The acceptance grid is 16 cells x 8 rows.
\catcode123=1 \catcode125=2 \catcode35=6
\defaulthyphenchar=-1 \font\p=cmr10 \p
\hsize=320pt \baselineskip=18pt \boxmaxdepth=100pt
\hbadness=10000 \vbadness=10000 \tracinglostchars=2
\def\cell#1{\hbox to20pt{\char#1\hskip0pt plus1fil}}
\vbox{
\hbox{\cell{0}\cell{1}\cell{2}\cell{3}\cell{4}\cell{5}\cell{6}\cell{7}\cell{8}\cell{9}\cell{10}\cell{11}\cell{12}\cell{13}\cell{14}\cell{15}}
\hbox{\cell{16}\cell{17}\cell{18}\cell{19}\cell{20}\cell{21}\cell{22}\cell{23}\cell{24}\cell{25}\cell{26}\cell{27}\cell{28}\cell{29}\cell{30}\cell{31}}
\hbox{\cell{32}\cell{33}\cell{34}\cell{35}\cell{36}\cell{37}\cell{38}\cell{39}\cell{40}\cell{41}\cell{42}\cell{43}\cell{44}\cell{45}\cell{46}\cell{47}}
\hbox{\cell{48}\cell{49}\cell{50}\cell{51}\cell{52}\cell{53}\cell{54}\cell{55}\cell{56}\cell{57}\cell{58}\cell{59}\cell{60}\cell{61}\cell{62}\cell{63}}
\hbox{\cell{64}\cell{65}\cell{66}\cell{67}\cell{68}\cell{69}\cell{70}\cell{71}\cell{72}\cell{73}\cell{74}\cell{75}\cell{76}\cell{77}\cell{78}\cell{79}}
\hbox{\cell{80}\cell{81}\cell{82}\cell{83}\cell{84}\cell{85}\cell{86}\cell{87}\cell{88}\cell{89}\cell{90}\cell{91}\cell{92}\cell{93}\cell{94}\cell{95}}
\hbox{\cell{96}\cell{97}\cell{98}\cell{99}\cell{100}\cell{101}\cell{102}\cell{103}\cell{104}\cell{105}\cell{106}\cell{107}\cell{108}\cell{109}\cell{110}\cell{111}}
\hbox{\cell{112}\cell{113}\cell{114}\cell{115}\cell{116}\cell{117}\cell{118}\cell{119}\cell{120}\cell{121}\cell{122}\cell{123}\cell{124}\cell{125}\cell{126}\cell{127}}
}\message{Native OT1 slot grid completed.}\end
+14
View File
@@ -0,0 +1,14 @@
% Actual font slots and missing characters, with genuine diagnostic channels.
\defaulthyphenchar=45
\input math-fonts
\hsize=240pt
\tracingonline=0 \tracinglostchars=1
\noindent Before a missing slot \char200 after it.\par
\tracinglostchars=2
\nullfont\char65\tenrm
\noindent Real OT1 slots: \char0{} \char11{} \char92{} \char123{} \char127{}.\par
\noindent Missing math nucleus $a+\mathchar"01C8^2+b$ retains the script.\par
\iffontchar\font65 \message{Actual current font contains slot 65.}\fi
\iffontchar\textfont1 200 \errmessage{Bad TFM presence}\fi
\message{Native font diagnostics completed.}
\end
+22
View File
@@ -0,0 +1,22 @@
% Actual font-tail italic corrections and glue quantities reach the same PDF.
\input math-fonts.tex
\font\italic=cmti10
\font\roman=cmr10
\pdfpagewidth=360bp \pdfpageheight=240bp
\pdfhorigin=24bp \pdfvorigin=24bp
\hsize=300bp \vsize=180bp \parindent=0pt
\output={\shipout\box255}
\immediate\openout0=pages.aux
\skip0=7pt plus2.5fill minus3.25fil
\noindent Native italic correction: {\italic f\/A fi\/A A\/A}.
Tail-font lookup: {\italic f}\roman\/A.
\par
\hbox{A\kern\gluestretch\skip0 B\kern\glueshrink\skip0 C}
\noindent Stretch: \the\gluestretch\skip0;
shrink: \the\glueshrink\skip0;
orders: \the\gluestretchorder\skip0, \the\glueshrinkorder\skip0.
Math zero correction: $a\/b+a\/^2+x_i$.
\write0{components=\the\gluestretch\skip0,\the\glueshrink\skip0;
orders=\the\gluestretchorder\skip0,\the\glueshrinkorder\skip0}
\par
\end
+17
View File
@@ -0,0 +1,17 @@
% Real paragraph-to-vlist penalties, consumed by the native page builder.
\catcode123=1 \catcode125=2 \catcode35=6
\defaulthyphenchar=45 \font\p=cmr10 \p
\hsize=200pt \baselineskip=12pt \parfillskip=0pt plus1fil
\hbadness=10000 \vbadness=10000 \boxmaxdepth=100pt
\interlinepenalty=0 \clubpenalty=-10000 \widowpenalty=0 \brokenpenalty=0
\noindent First\penalty-10000 Second\penalty-10000 Third\par
\clubpenalty=0 \widowpenalty=-10000
\noindent Fourth\penalty-10000 Fifth\penalty-10000 Sixth\par
\widowpenalty=0 \interlinepenalty=-10000
\noindent Seventh\penalty-10000 Eighth\penalty-10000 Ninth\par
\interlinepenalty=0 \brokenpenalty=-10000 \hyphenpenalty=-10000 \hsize=40pt
\noindent con\-struction\par
\hsize=200pt \interlinepenalty=10000 \clubpenalty=150 \widowpenalty=150
\noindent Kept\penalty-10000 Together\penalty-10000 Here\par
\message{Native interline page execution completed.}
\end
+14
View File
@@ -0,0 +1,14 @@
% Run in a scratch working directory: native --initex --etex /path/to/job.tex job.pdf
\catcode123=1 \catcode125=2 \catcode35=6
\defaulthyphenchar=45 \font\nativefont=cmr10 \nativefont \hsize=468pt \baselineskip=12pt \parfillskip=0pt plus1fil
\immediate\openout0=job-time.aux
\immediate\write0{\the\year/\the\month/\the\day, minutes=\the\time}
\immediate\closeout0
\openin1=job-time.aux
\ifeof1\errmessage{The written job file was not found}\fi
\endlinechar=-1
\read1 to\captured
\closein1
Captured job time: \captured.\par
\message{Native job file was written and read back successfully.}
\end
+30
View File
@@ -0,0 +1,30 @@
\catcode123=1 \catcode125=2 \catcode35=6 \catcode94=7
\defaulthyphenchar=45 \font\rm=cmr10 \rm
\hsize=108pt \parindent=0pt \baselineskip=12pt
\parfillskip=0pt plus1fil \parskip=5pt
\pretolerance=-1 \tolerance=10000 \hbadness=10000 \vbadness=10000
\linepenalty=10 \hyphenpenalty=50 \exhyphenpenalty=50
\adjdemerits=10000 \doublehyphendemerits=10000 \finalhyphendemerits=5000
\lefthyphenmin=2 \righthyphenmin=3 \uchyph=1
\language=1
\patterns{hy1phen phen1a a1tion para1graph con1struc struc1tion de1mon mon1stra stra1tion}
\language=2
\patterns{hyphen1ation para1graph construc1tion demon1stration}
\language=0
\uppercase{\def\heading{native language tables}}
\heading\par
\language=1
Language one: hyphenation paragraph construction demonstration
hyphenation paragraph construction demonstration.\par
\language=2
Language two: hyphenation paragraph construction demonstration
hyphenation paragraph construction demonstration.\par
\language=1
Within one paragraph: hyphenation paragraph
\language=2 construction demonstration
\language=1 hyphenation paragraph construction demonstration.\par
\lccode64=97 \hyphenation{p@r@-graph}
Mapped exceptions: paragraph paragraph paragraph paragraph.\par
\lowercase{\def\converted{CASE TOKENS RETAIN THEIR CATEGORIES.}}
\converted\par
\end
+16
View File
@@ -0,0 +1,16 @@
% Exercise deletion in the same lists consumed by page construction and PDF.
\input math-fonts.tex
\pdfpagewidth=320bp \pdfpageheight=240bp
\pdfhorigin=24bp \pdfvorigin=24bp
\hsize=270bp \vsize=180bp \parindent=0pt
\output={\shipout\box255}
\immediate\openout0=pages.aux
\noindent Native list tails: \hskip30pt\unskip text remains adjacent.
\hbox{A\kern20pt\unkern B\penalty99\unpenalty C}
and math $x_a\mskip18mu\unskip+ y_a\mkern12mu\unkern$.
\write0{list-tail-page=\the\count0}
\par
\setbox0=\vbox{\hbox{Internal vertical tail.}\vskip30pt\unskip
\kern12pt\unkern\penalty23\unpenalty}
\box0
\end
+24
View File
@@ -0,0 +1,24 @@
% Actual rules, moved boxes, original list transfer and paragraph line boxes.
\input math-fonts
\hsize=270pt \baselineskip=15pt \parskip=4pt
\pretolerance=10000 \tolerance=10000
\overfullrule=3pt \hfuzz=0pt
\noindent Native rules inherit their actual containing box dimensions.\par
\hbox{A\vrule width1pt B\raise3pt\hbox{Raised}\lower2pt\hbox{lowered}C}
\vbox{\hbox{A running horizontal rule follows this measured text.}
\hrule height.5pt
\hbox{Its width comes from this box rather than the paragraph.}}
\setbox1=\hbox to8pt{gj}
\noindent A real overfull box has a marker: \copy1.\par
\noindent Its original list can be transferred: \unhcopy1.\par
\setbox2=\hbox to160pt{A\hskip0pt plus1fil B}
\noindent Packed material: \copy2.\par
\noindent Original unpacked material: \unhcopy2.\par
\vbox{\moveright10pt\hbox{Horizontal movement lives on the vertical list.}
\moveleft3pt\hbox{The next box retains its own baseline.}}
\setbox3=\vbox{\hsize=120pt\noindent Paragraph line boxes retain their actual original glue and glyph nodes.\par
\global\setbox4=\lastbox}
\noindent Extracted line material: \unhcopy4.\par
\noindent Mathematics can contain actual text boxes:
$x+\raise2pt\hbox{Text}_i^j+\hbox{A\vrule B}$.\par
\end
+12
View File
@@ -0,0 +1,12 @@
\input bootstrap
\message{Native bootstrap ready: counter=\the\counter}
\greet{Route-D}
\par
{\counter=9 \greet{local state}}
\par
\ifnum\counter=4
The outer register value was restored.
\else
Incorrect register state.
\fi
\end
+21
View File
@@ -0,0 +1,21 @@
% Explicit native CM family setup. No plain/LaTeX format or macro replacements.
\catcode123=1 \catcode125=2 \catcode35=6
\catcode36=3 \catcode94=7 \catcode95=8
\font\tenrm=cmr10 \font\sevenrm=cmr7 \font\fiverm=cmr5
\font\teni=cmmi10 \font\seveni=cmmi7 \font\fivei=cmmi5
\font\tensy=cmsy10 \font\sevensy=cmsy7 \font\fivesy=cmsy5
\font\tenex=cmex10
\textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
\textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
\textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
\textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
\tenrm
\mathcode`\+="202B \mathcode`\-="2200 \mathcode`\*="2203
\mathcode`\=="303D \mathcode`\<="313C \mathcode`\>="313E
\mathcode`\(="4028 \mathcode`\)="5029
\mathcode`\,="613B \mathcode`\;="603B
\thinmuskip=3mu \medmuskip=4mu plus2mu minus4mu \thickmuskip=5mu plus5mu
\scriptspace=.5pt \nulldelimiterspace=1.2pt
\binoppenalty=700 \relpenalty=500
\hsize=100pt \baselineskip=12pt \parfillskip=0pt plus1fil
\hbadness=10000 \vbadness=10000 \boxmaxdepth=100pt
@@ -0,0 +1,20 @@
% Native noad ligatures, actual operator variants and limits through PDF output.
\input math-fonts
\hsize=270pt \baselineskip=15pt \parskip=4pt
\abovedisplayskip=12pt \belowdisplayskip=12pt
\abovedisplayshortskip=3pt \belowdisplayshortskip=7pt
\mathchardef\Sum="1350 \mathchardef\Product="1351 \mathchardef\Integral="1352
Native text families retain their ligatures inside math: $\fam0 ffi+AV$.
Scripts keep the right nucleus: $\fam0 ff_i^j+fi^2$.\par
Inline operators use side scripts $\Sum_i^n+\Integral\nolimits_0^1$.
Forced limits also work inline $\Product\limits_i^n$.\par
\noindent Display operators use their actual font list successors.
$$\Sum_{i=1}^n x_i+\Product_{j=1}^m y_j$$
Continuation keeps the same baseline state.\par
\noindent Explicit side limits retain the display variant.
$$\Integral\nolimits_0^1 x^2+\mathop{fi}\limits_i^n$$
The native paragraph continues after the formula.\par
\noindent A limit can contain real stretchable material.
$$\Sum\limits^{a\mskip0mu plus1fil b}_j$$
Final text uses the same font resources.\par
\end
+16
View File
@@ -0,0 +1,16 @@
% Native math modes/noads/families and actual paragraph penalties.
\input math-fonts
\hsize=240pt \parskip=5pt
Inline $a+b=c$ uses real binary and relation classes. Scripts $x_i^2+y^{jk}$
retain their measured optical font masters.\par
Grouped ${a+b}=c$ suppresses inner automatic penalties. Fractions
${a+b\over c+d}=x$ use the same measured geometry for layout and painting.\par
\mathchardef\alpha="010B \mathchardef\beta="010C
Math character definitions $\alpha+\beta=1$ use real family slots.\par
\hbox{Restricted $a+b=c$ inserts no automatic penalties.}
\hsize=85pt \binoppenalty=-10000 \relpenalty=-10000
\noindent$a+b+c=d+e+f=g+h+i$\par
\hsize=240pt \binoppenalty=10000 \relpenalty=10000
Prohibited internal breaks keep $a+b=c+d$ together.\par
\message{Native math noad execution completed.}
\end
+31
View File
@@ -0,0 +1,31 @@
% Real online page/output/shipout execution; no format or document emulation.
\input math-fonts
\pdfpagewidth=612bp \pdfpageheight=792bp
\hsize=270pt \vsize=100pt \topskip=10pt \maxdepth=4pt
\baselineskip=15pt \parskip=4pt
\pretolerance=10000 \tolerance=10000
\count0=0
\immediate\openout1=pages.aux
\output={\global\advance\count0 by1
\shipout\vbox{\hbox{Native page \number\count0}
\unvbox255\hbox{Footer \number\count0}}}
\noindent Original paragraph lines feed the online native page builder.
The output routine executes while the job is running and can inspect its actual page box.
Its header and footer are constructed from the same native box primitives.\par
\noindent Marks\mark{FIRST} and deferred writes\write1{FIRST-PAGE=\number\count0}
remain attached to their original material.
Copying a box preserves its contents and dropping one does not execute its writes.\par
\hbox{A\vrule width1pt B\raise2pt\hbox{Raised}\lower1pt\hbox{lowered}}
\hrule height.5pt
\noindent Mathematics $x_i^j+y$ keeps actual font slots and sizes inside the page.
A displayed formula also participates in real vertical breaking.
$$x+y$$
The following paragraph resumes after the display with its correct baseline and depth.\par
\penalty-10000
\noindent An explicit penalty can finish a page without simulating a document command.
The remaining text continues through the same contribution list and output group.\par
\noindent The final\mark{LAST} page carries a late write\write1{LAST-PAGE=\number\count0}
whose page number is expanded at actual shipout.
All original glyphs and rule positions can be compared with an independent TeX job.\par
\closeout1
\end
+22
View File
@@ -0,0 +1,22 @@
% Run: native --initex --etex paragraphs.tex paragraphs.pdf
\catcode123=1 \catcode125=2 \catcode35=6
\defaulthyphenchar=45 \font\body=cmr10 \body
\hsize=210pt \parindent=12pt \baselineskip=12pt
\parfillskip=0pt plus1fil \parskip=6pt
\pretolerance=100 \tolerance=200 \emergencystretch=2pt
\linepenalty=10 \hyphenpenalty=50 \adjdemerits=10000
\lefthyphenmin=2 \righthyphenmin=3
Native paragraphs are built from tokens and measured font glyphs. The line
breaks and spaces in this paragraph are retained when the document is exported.\par
{\hsize=140pt \hangindent=12pt \hangafter=1
A local measure and hanging indent apply to this paragraph. Leaving the group
restores the previous measure without changing these measured lines.\par}
\noindent The restored measure is \the\hsize. Each paragraph uses its own state,
and line spacing carries the previous line depth across paragraph boundaries.\par
\pretolerance=-1 \tolerance=10000
\hyphenation{para-graph hy-phen-a-tion con-struc-tion}
\hsize=100pt
Paragraph construction uses real hyphenation exceptions when a later pass
requires them. No language patterns are silently injected.\par
\message{Native paragraph construction completed.}
\end
+17
View File
@@ -0,0 +1,17 @@
% Real PDF configuration and late per-stream changes over the same native box.
\input math-fonts
\pdfoutput=1 \pdfmajorversion=1 \pdfminorversion=7
\pdfobjcompresslevel=3 \pdfcompresslevel=9 \pdfdecimaldigits=4
\pdfpagewidth=260bp \pdfpageheight=180bp
\pdfhorigin=12pt \pdfvorigin=16pt
\count0=1 \immediate\openout1=config.aux
\setbox0=\vbox{\hsize=200pt \baselineskip=14pt
\noindent Native compressed pages retain actual text, fonts and mathematics $x_i^j+y$.\par
\kern.37pt \hrule height.4pt
\hbox{Actual fine rules and \raise.3pt\hbox{raised} text.}
\write1{PAGE=\number\count0;ZIP=\number\pdfcompresslevel}}
\shipout\copy0
\pdfcompresslevel=0 \pdfdecimaldigits=0 \pdfobjcompresslevel=0
\count0=2 \shipout\box0
\immediate\closeout1
\end
+13
View File
@@ -0,0 +1,13 @@
\catcode123=1\catcode125=2
\pdfminorversion=7\pdfobjcompresslevel=3\pdfcompresslevel=0
\pdfdecimaldigits=3\pdfpkresolution=300
\pdfpagewidth=420bp\pdfpageheight=160bp
\pdfhorigin=20pt\pdfvorigin=20pt
\font\R=cmr10 at20pt\font\I=cmmi10 at20pt\font\E=cmex10 at20pt
\immediate\openout1=bitmap.aux\count0=1
\setbox0=\vbox{\hbox{\R Native bitmap AV office -- ffi}
\kern3pt\hbox{\I ABC\kern2pt\E\char80}
\write1{PAGE=\number\count0;DPI=\number\pdfpkresolution}}
\shipout\copy0
\pdfpkresolution=1200\pdfcompresslevel=9\count0=2
\shipout\box0\immediate\closeout1\end
+22
View File
@@ -0,0 +1,22 @@
% Strict native demo, with INITEX categories and no preloaded format.
\catcode123=1 \catcode125=2 \catcode35=6
\defaulthyphenchar=45 \font\nativefont=cmr10 \nativefont \hsize=468pt \baselineskip=12pt \parfillskip=0pt plus1fil
\dimendef\width=300
\skipdef\flex=301
\muskipdef\mathspace=302
\width=2.5pt
\advance\width by1.25pt
\flex=1pt plus2fil minus.5pt
\mathspace=3mu plus1fil
\mathchardef\symbol=4660
Native width: \the\width.\par
Glue value: \the\flex.\par
Math glue value: \the\mathspace.\par
Math character code: \number\symbol.\par
Current input line: \the\inputlineno.\par
\ifdim\width>3pt
\message{Native quantity checks passed.}
\else
\errmessage{Native quantity comparison failed}
\fi
\end
+21
View File
@@ -0,0 +1,21 @@
% Native sfcode is consumed by real character and inter-word glue construction.
\catcode123=1 \catcode125=2 \catcode35=6
\font\body=cmr10 \body
\hsize=240pt \parindent=0pt \baselineskip=12pt
\parfillskip=0pt plus1fil \parskip=6pt
\hbadness=10000 \vbadness=10000
\sfcode`\.=3000 \sfcode`\!=3000 \sfcode`\?=3000
\sfcode`\)=0 \sfcode`\]=0
Sentence spacing follows native character codes. Next sentence uses extra
space. An abbreviation A. keeps ordinary spacing. An end.) Next sentence
retains the previous factor through its closing parenthesis.\par
{\sfcode`\.=1000
Local codes use ordinary spacing. Next sentence stays in this local group.
The measured paragraph keeps these spaces after the group closes.\par}
Restored codes produce sentence spacing. Next sentence uses the restored
table without changing the preceding paragraph.\par
\xspaceskip=9pt plus1pt minus1pt
Explicit sentence glue is consumed here. Next sentence uses xspaceskip.
An abbreviation A. still uses the normal font space.\par
\message{Native sfcode construction completed.}
\end
+25
View File
@@ -0,0 +1,25 @@
% Actual vertical breaking, remaining-list pruning and migrating marks.
\input math-fonts
\hsize=270pt \baselineskip=15pt \parskip=4pt
\pretolerance=10000 \tolerance=10000
\splitmaxdepth=2pt \splittopskip=10pt plus1fil
\noindent Native splitting consumes original paragraph lines and rules.\par
\setbox1=\vbox{\hsize=135pt\baselineskip=14pt\parskip=0pt
\marks7{SEVEN}
\noindent Alpha\mark{FIRST} beta gamma delta epsilon zeta eta theta iota kappa.
Original glyph nodes keep their fonts and positions.\mark{MIDDLE}\par
\noindent Symbols $x_i^j$ remain in their actual line boxes.\par
\hbox{A\vrule width1pt B\raise2pt\hbox{Raised}\mark{BOXMARK}}
\hrule height.5pt
\hbox{The final material has depth: gj.}\mark{LAST}}
\setbox0=\vsplit1 to38pt\relax
\message{SPLIT-FIRST=\splitfirstmark/\splitbotmark/\splitfirstmarks7}
\hbox{First fragment:\hskip8pt\box0}
\noindent First mark: \splitfirstmark. Class seven: \splitfirstmarks7.\par
\setbox0=\vsplit1 to38pt\relax
\message{SPLIT-REST=\splitfirstmark/\splitbotmark/\splitfirstmarks7}
\hbox{Second fragment:\hskip8pt\box0}
\noindent The remaining box is repacked from its original nodes.\par
\box1
\noindent Split marks are scoped by splitting rather than ordinary groups.\par
\end
+12
View File
@@ -0,0 +1,12 @@
\catcode123=1\catcode125=2
\pdfminorversion=7\pdfobjcompresslevel=3\pdfcompresslevel=0\pdfpkresolution=600
\pdfpagewidth=300bp\pdfpageheight=160bp\pdfhorigin=20pt\pdfvorigin=20pt
\tracingstats=2\tracingonline=0
\font\F=cmr10\F
\immediate\openout1=statistics.aux\count0=1
\def\payload{Native resource statistics AV office}
\setbox0=\vbox{\hbox{\payload}\kern2pt\hbox{Second actual line}
\write1{PAGE=\number\count0}}
\shipout\copy0
\pdfcompresslevel=9\count0=2\shipout\box0
\immediate\closeout1\end