Skip to content

Commit 5a50fb1

Browse files
committed
Clarify and enhance \box tests
1 parent a46a577 commit 5a50fb1

File tree

3 files changed

+55
-31
lines changed

3 files changed

+55
-31
lines changed

t/digestion/box.pdf

3.59 KB
Binary file not shown.

t/digestion/box.tex

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
\documentclass{article}
22
\def\testbox#1{%
3-
\ifvoid#1 Box #1 is empty
4-
\else\ifhbox#1 Box #1 is horizontal
5-
\else\ifvbox#1 Box #1 is vertical
3+
\ifvoid#1 Box \string#1 is void
4+
\else\ifhbox#1 Box \string#1 is horizontal
5+
\else\ifvbox#1 Box \string#1 is vertical
66
\fi\fi\fi
77
\par}
88
\begin{document}
9-
\setbox100=\hbox{Goodbye}
10-
\testbox{100}
11-
\setbox101=\hbox{Hello}
12-
\testbox{101}
13-
\setbox102=\vbox{\box101,\box100}
14-
\testbox{102}
15-
16-
Using...
17-
\box102
18-
19-
\setbox103=\hbox{}
20-
\testbox{103}
21-
22-
\testbox{104}
9+
\newbox\myboxA
10+
\newbox\myboxB
11+
\newbox\myboxC
12+
Not yet set:\testbox{\myboxA}
13+
\setbox\myboxA=\hbox{}
14+
Set empty:\testbox{\myboxA}
15+
\setbox\myboxA=\hbox{Goodbye}
16+
\testbox{\myboxA}
17+
\setbox\myboxB=\hbox{Hello}
18+
\testbox{\myboxB}
19+
\setbox\myboxC=\vbox{\box\myboxB,\box\myboxA}
20+
\testbox{\myboxC}
21+
22+
Combined: \box\myboxC
23+
And now: \testbox{\myboxA}.
24+
25+
Curious unsetting behavior:
26+
\setbox\myboxA=\hbox{Once}
27+
Once? \box\myboxA \box\myboxA.
28+
29+
\setbox\myboxA=\hbox{Once}
30+
Once? {\box\myboxA\box\myboxA}\box\myboxA\box\myboxA.
31+
32+
\setbox\myboxA=\hbox{ and Again}
33+
Once? {\setbox\myboxA=\hbox{Once}\box\myboxA\box\myboxA}\box\myboxA\box\myboxA.
2334

2435
\[ a + \hbox{a}\]
2536
\[ a + \vbox{a}\]

t/digestion/box.xml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,41 @@
55
<resource src="LaTeXML.css" type="text/css"/>
66
<resource src="ltx-article.css" type="text/css"/>
77
<para xml:id="p1">
8-
<p>Box 100 is horizontal</p>
8+
<p>Not yet set: Box “myboxA is void</p>
99
</para>
1010
<para xml:id="p2">
11-
<p>Box 101 is horizontal</p>
11+
<p>Set empty: Box “myboxA is horizontal</p>
1212
</para>
1313
<para xml:id="p3">
14-
<p>Box 102 is vertical</p>
14+
<p>Box “myboxA is horizontal</p>
1515
</para>
1616
<para xml:id="p4">
17-
<p>Using…
18-
<inline-block vattach="bottom">
19-
<p>Hello</p>
20-
<p>,Goodbye</p>
21-
</inline-block></p>
17+
<p>Box “myboxB is horizontal</p>
2218
</para>
2319
<para xml:id="p5">
24-
<p>Box 103 is horizontal</p>
20+
<p>Box “myboxC is vertical</p>
2521
</para>
2622
<para xml:id="p6">
27-
<p>Box 104 is empty</p>
23+
<p>Combined: <inline-block vattach="bottom">
24+
<p>Hello</p>
25+
<p>,Goodbye</p>
26+
</inline-block>And now: Box “myboxA is void</p>
2827
</para>
2928
<para xml:id="p7">
29+
<p>.</p>
30+
</para>
31+
<para xml:id="p8">
32+
<p>Curious unsetting behavior:
33+
34+
Once? Once.</p>
35+
</para>
36+
<para xml:id="p9">
37+
<p>Once? Once.</p>
38+
</para>
39+
<para xml:id="p10">
40+
<p>Once? Once and Again.</p>
41+
</para>
42+
<para xml:id="p11">
3043
<equation xml:id="S0.Ex1">
3144
<Math mode="display" tex="a+\hbox{a}" text="a + [a]" xml:id="S0.Ex1.m1">
3245
<XMath>
@@ -50,7 +63,7 @@
5063
</Math>
5164
</equation>
5265
</para>
53-
<para xml:id="p8">
66+
<para xml:id="p12">
5467
<equation xml:id="S0.Ex3">
5568
<Math mode="display" tex="a+\vbox{\hbox{a}\hbox{a}}" text="a + [aa]" xml:id="S0.Ex3.m1">
5669
<XMath>
@@ -80,7 +93,7 @@
8093
</Math>
8194
</equation>
8295
</para>
83-
<para xml:id="p9">
96+
<para xml:id="p13">
8497
<equation xml:id="S0.Ex5">
8598
<Math mode="display" tex="a-\lower 4.30554pt\vtop{\hbox{a}}" text="a - [a]" xml:id="S0.Ex5.m1">
8699
<XMath>
@@ -104,7 +117,7 @@
104117
</Math>
105118
</equation>
106119
</para>
107-
<para xml:id="p10">
120+
<para xml:id="p14">
108121
<equation xml:id="S0.Ex7">
109122
<Math mode="display" tex="a-\lower 4.30554pt\hbox{a}" text="a - [a]" xml:id="S0.Ex7.m1">
110123
<XMath>
@@ -117,7 +130,7 @@
117130
</Math>
118131
</equation>
119132
</para>
120-
<para xml:id="p11">
133+
<para xml:id="p15">
121134
<equation xml:id="S0.Ex8">
122135
<Math mode="display" tex="a-\lower 4.30554pt\hbox{a}" text="a - [a]" xml:id="S0.Ex8.m1">
123136
<XMath>

0 commit comments

Comments
 (0)