summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests/partoken-ok.tex
blob: 329505db804618ee7bba52a09ad9025071431ce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% $Id$
% Public domain. Originally written by Petr Olsak, 2021.
% Testing \partokenname and \partokencontext primitives: successful tests.
% 
% We want to test in iniTeX state, use "pdftex -ini partoken-test.tex" 
% Generating dvi output.
%
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
\hsize=4in \vsize=4in \baselineskip=12pt
\font\f=cmr10 \f % we want to typeset some text

% Seting different partoken name
\catcode`\_=11
\partokenname \_par
\let \_par = \par
\def\par{hello}
% This empty line emits \_par (i.e., no output), no "hello":

% Not-\long macro accepts \par in its argument, but does not accept \_par
% (emitted here from blank line):
\def\macro#1{}
\macro{long test: \par} % without error
% see partoken-xfail.tex for failing test.
%
\let \_endgraf=\_par
\def \_par{PAR-TOKEN\_endgraf}
% This empty line prints PAR-TOKEN (plus underfull \hbox
%   due to \parfillskip=0pt):

% This \vskip prints Test PAR-TOKEN (plus underfull \hbox warning):
Test \vskip1pt \relax
%
% This end-of-\vbox prints 0: Test text. (standard behavior):
\vbox{\the\partokencontext: Test text.}
%
\partokencontext=1
% This prints 1: Test text.PAR-TOKEN (\_par called at end of \vbox):
\vbox{\the\partokencontext: Test text.}
%
% This prints 1: no-align text (standard behavior):
\halign{#\cr \noalign{\the\partokencontext: no-align text}}
%
\partokencontext=2
% This prints: 2: no-align textPAR-TOKEN (\_par called at end of \noalign):
\halign{#\cr \noalign{\the\partokencontext: no-align text}}
%
% no blank line to elide final PAR-TOKEN.
\end