Context
Demonstration
Software Eng.
Experimentation
Future Work
Interactive and Real-Time Typesetting for
Demonstration and Experimentation
e TUG 2023 E
Didier Verna
EPITA / LRDE
didier@lrde.epita.fr
lrde/~didier
@didierverna didier.verna
in/didierverna
Context
Demonstration
Software Eng.
Experimentation
Future Work
Context
I
Digital Typesetting: a fascinating domain
I
Strong focus on beauty and aesthetics
I
Full of interesting technical challenges
I
Motivation (double)
I
General interest for the application domain
I
Need to strengthen an existing lecture on typesetting
I
Requirements (double): experimentation / demonstration platform
I
real-time
I
interactive
I
State of the Art: none
I
WYSIWYG tools are of varying quality
I
T
E
X is not really interactive
I
Neither have easily accessible internals (production systems)
I
Conclusion: DIY!
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 2/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Demonstration (video & coee breaks
😉
)
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 3/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Software Engineering
The benets of being multi-paradigm: concision
LoC
GUI 800
Hyphenation 150
Lineup 500
Algorithms 150 450
Knuth-Plass 700 (total for the 2 variants)
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 4/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Object-Orientation
Inheritance & polymorphism: code reuse
kp-mixin
pass-number
demerits
paragraph
width
disposition
lines
graph-par
layouts-number
kp-graph-par
kp-dyn-par
nodes-number
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 5/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Functional
Higher-order functions: parametrization
;; Duncan
(make-graph lineup width) ;; default behavior
;; Knuth-Plass graph variant
(make-graph lineup width
:next-boundaries #'kp-next-boundaries ;; KP-specific function...
:threshold pre-tolerance) ;; ... with specific arguments
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 6/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Dynamicity & Interaction
Real-time reexive access to the running program
ETAP
GUI
REPL
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 7/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Graph-based Example #1
How many solutions per paragraph width? (20 LoC)
0
50
100
150
200
250
300
350
400
150 200 250 300 350 400 450 500 550 600
Solutions number
Paragraph width (pt)
Strict
Strict/Hyphens
Regular
Regular/Hyphens
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 8/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Graph-based Example #2
What about the graph sizes? (20 LoC)
0
20
40
60
80
100
120
140
150 200 250 300 350 400 450 500 550 600
Graph size
Paragraph width (pt)
Fulls/None
Fulls/Fallback
Fulls/Preventive
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 9/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Comparative Example #1
How many fulls? (10 LoC)
0
1
2
3
4
5
6
160 180 200 220 240 260 280
Under/Overfulls number
Paragraph width (pt)
Best-Fit
Barnett
Duncan
Knuth-Plass/Graph
Knuth-Plass/Dynamic
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 10/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Comparative Example #2
How many hyphens? (6 LoC)
0
0.5
1
1.5
2
2.5
3
3.5
4
150 200 250 300 350 400 450 500
Hyphens number
Paragraph width (pt)
Best-Fit
Barnett
Duncan
Knuth-Plass/Graph
Knuth-Plass/Dynamic
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 11/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Comparative Example #3
What about the average scaling? (8 LoC)
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
150 200 250 300 350 400 450 500 550 600
Line scaling means
Paragraph width (pt)
Best-Fit
Barnett
Duncan
Knuth-Plass/Graph
Knuth-Plass/Dynamic
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 12/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Comparative Example #4
And the scaling variance? (14 LoC)
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1.1
150 200 250 300 350 400 450 500 550 600
Line scaling variance
Paragraph width (pt)
Best-Fit
Barnett
Duncan
Knuth-Plass/Graph
Knuth-Plass/Dynamic
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 13/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Comparative Example #5
T
E
X’s view on the competition? (14 LoC)
100
1000
10000
100000
1 × 10
6
1 × 10
7
1 × 10
8
150 200 250 300 350 400 450 500 550 600
TeX’s Demerits
Paragraph width (pt)
Best-Fit
Barnett
Duncan
Knuth-Plass/Graph
Knuth-Plass/Dynamic
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 14/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Comparative Example #6
With or without pre-tolerance (1 LoC)
100
1000
10000
100000
1 × 10
6
150 200 250 300 350 400 450 500 550 600
TeX’s Demerits
Paragraph width (pt)
1/2/3
2/3
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 15/16
Context
Demonstration
Software Eng.
Experimentation
Future Work
Future Work
I
Bibliography
I
Study more litterature
I
HELP! Barnett / Duncan original papers wanted!
I
Research
I
Rivers detection
I
Revisit Knuth-Plass
I
New algorithms
I
I
Development
I
Tighter GUI / Internals integration
I
I
Many other things!
Thank you!
Interactive and Real-Time Typesetting for Demonstration and Experimentation / TUG 2023 Didier Verna 16/16