|
Introduction
This example shows how referents and line breaking interact.
With no input, this program produces the following output:
first line with no ; 1 referents, breakable ; 2 spaces. ; 3 second line with |referent 1| a referent. ; 4 third line, also ; 5 with |referent 2| referents. ; 6
The first line is correctly broken, giving output lines 1 through 3. The second line is not broken because the parts both before the referent and after are less than twenty characters long. The final line is broken before the referent, giving line 5, but the part after is not broken. No errors were reported here because no maximum width was specified.
cross-translate break-width 20 replacement-break '%_' '%n' find-start local stream s output "first%/ line%/ with%/ no%/ referents,%/ breakable%/ spaces.%n" output "second%/ line%/ with%/ " output referent "1" output "%/ a referent.%n" output "third%/ line,%/ also%/ with%/ " output referent "2" output "%/ referents.%n" open s as referent "1" put s "|referent 1|" close s open s as referent "2" put s "|referent 2|" close s
Related Concepts
Referents and line-breaking |
---- |