TeX in C
Explore TeX with modern c compiler.
PART 38: Breaking paragraphs into lines

[ #813. 更多...

宏定义

#define tightfit   3
 
#define loosefit   1
 
#define veryloosefit   0
 
#define decentfit   2
 
#define activenodesize   3
 
#define unhyphenated   0
 
#define hyphenated   1
 
#define lastactive   active
 
#define passivenodesize   2
 
#define deltanodesize   7
 
#define deltanode   2
 
#define deactivate   60
 
#define fitness   subtype /* |veryloosefit..tightfit| on final line for this break}*/
 [p304#819] 更多...
 
#define breaknode   rlink /* pointer to the corresponding passive node}*/
 
#define linenumber   llink /* line that begins at this breakpoint}*/
 
#define totaldemerits(x)   mem[x+2].int_ /* the quantity that \TeX\ minimizes}*/
 
#define curbreak   rlink /* in passive node, points to position of this breakpoint}*/
 [p304#821] 更多...
 
#define prevbreak   llink /* points to passive node that should precede this one}*/
 
#define serial   info /* serial number for symbolic identification}*/
 
#define checkshrinkage(x)    ((shrinkorder(x) != NORMAL) && (shrink(x) != 0) ? (x) = finiteshrink(x) : 0)
 [p306#825] 更多...
 
#define copytocuractive(x)   (curactivewidth[(x)-1] = activewidth[(x)-1])
 [p308#829] 更多...
 
#define updatewidth(x)   (curactivewidth[(x)-1] += mem[r + (x)].sc)
 [p309#832] 更多...
 
#define awfulbad   1073741823L
 [#833] 更多...
 
#define setbreakwidthtobackground(x)   (breakwidth[(x)-1] = background[(x)-1])
 [p310#837] 更多...
 
#define converttobreakwidth(x)    (mem[prevr + (x)].sc += -curactivewidth[(x)-1] + breakwidth[(x)-1])
 [p312#843] 更多...
 
#define storebreakwidth(x)   (activewidth[(x)-1] = breakwidth[(x)-1])
 
#define newdeltatobreakwidth(x)    (mem[q + (x)].sc = breakwidth[(x)-1] - curactivewidth[(x)-1])
 
#define newdeltafrombreakwidth(x)    (mem[q + (x)].sc = curactivewidth[(x)-1] - breakwidth[(x)-1])
 [p312#944] 更多...
 
#define combinetwodeltas(x)    (mem[prevr + (x)].sc = mem[prevr + (x)].sc + mem[r + (x)].sc)
 [p318#860] 更多...
 
#define downdatewidth(x)   (curactivewidth[(x)-1] -= mem[prevr + (x)].sc)
 
#define updateactive(x)   (activewidth[(x)-1] += mem[r + (x)].sc)
 [p318#861] 更多...
 

函数

void linebreak (long finalwidowpenalty)
 
HalfWord finiteshrink (HalfWord p)
 
void trybreak (long pi, SmallNumber breaktype)
 p308#829 更多...
 

变量

Pointer justbox
 
Pointer passive
 
Pointer printednode
 
HalfWord passnumber
 
Scaled activewidth [6]
 
Scaled curactivewidth [6]
 
Scaled background [6]
 
Scaled breakwidth [6]
 
Boolean noshrinkerroryet
 
Boolean secondpass
 
Boolean finalpass
 
Pointer curp
 
Integer threshold
 
Integer minimaldemerits [tightfit - veryloosefit+1]
 
Integer minimumdemerits
 
Pointer bestplace [tightfit - veryloosefit+1]
 
HalfWord bestplline [tightfit - veryloosefit+1]
 
Scaled discwidth
 
Scaled firstwidth
 
Scaled secondwidth
 
Scaled firstindent
 
Scaled secondindent
 
HalfWord easyline
 
HalfWord lastspecialline
 

详细描述

[ #813.

Breaking paragraphs into lines. ]

宏定义说明

◆ activenodesize

#define activenodesize   3

◆ awfulbad

#define awfulbad   1073741823L

[#833]

◆ breaknode

#define breaknode   rlink /* pointer to the corresponding passive node}*/

◆ checkshrinkage

#define checkshrinkage (   x)     ((shrinkorder(x) != NORMAL) && (shrink(x) != 0) ? (x) = finiteshrink(x) : 0)

[p306#825]

◆ combinetwodeltas

#define combinetwodeltas (   x)     (mem[prevr + (x)].sc = mem[prevr + (x)].sc + mem[r + (x)].sc)

[p318#860]

◆ converttobreakwidth

#define converttobreakwidth (   x)     (mem[prevr + (x)].sc += -curactivewidth[(x)-1] + breakwidth[(x)-1])

[p312#843]

◆ copytocuractive

#define copytocuractive (   x)    (curactivewidth[(x)-1] = activewidth[(x)-1])

[p308#829]

◆ curbreak

#define curbreak   rlink /* in passive node, points to position of this breakpoint}*/

[p304#821]

◆ deactivate

#define deactivate   60

◆ decentfit

#define decentfit   2

◆ deltanode

#define deltanode   2

◆ deltanodesize

#define deltanodesize   7

◆ downdatewidth

#define downdatewidth (   x)    (curactivewidth[(x)-1] -= mem[prevr + (x)].sc)

◆ fitness

#define fitness   subtype /* |veryloosefit..tightfit| on final line for this break}*/

[p304#819]

◆ hyphenated

#define hyphenated   1

◆ lastactive

#define lastactive   active

◆ linenumber

#define linenumber   llink /* line that begins at this breakpoint}*/

◆ loosefit

#define loosefit   1

◆ newdeltafrombreakwidth

#define newdeltafrombreakwidth (   x)     (mem[q + (x)].sc = curactivewidth[(x)-1] - breakwidth[(x)-1])

[p312#944]

◆ newdeltatobreakwidth

#define newdeltatobreakwidth (   x)     (mem[q + (x)].sc = breakwidth[(x)-1] - curactivewidth[(x)-1])

◆ passivenodesize

#define passivenodesize   2

◆ prevbreak

#define prevbreak   llink /* points to passive node that should precede this one}*/

◆ serial

#define serial   info /* serial number for symbolic identification}*/

◆ setbreakwidthtobackground

#define setbreakwidthtobackground (   x)    (breakwidth[(x)-1] = background[(x)-1])

[p310#837]

◆ storebreakwidth

#define storebreakwidth (   x)    (activewidth[(x)-1] = breakwidth[(x)-1])

◆ tightfit

#define tightfit   3

◆ totaldemerits

#define totaldemerits (   x)    mem[x+2].int_ /* the quantity that \TeX\ minimizes}*/

◆ unhyphenated

#define unhyphenated   0

◆ updateactive

#define updateactive (   x)    (activewidth[(x)-1] += mem[r + (x)].sc)

[p318#861]

◆ updatewidth

#define updatewidth (   x)    (curactivewidth[(x)-1] += mem[r + (x)].sc)

[p309#832]

◆ veryloosefit

#define veryloosefit   0

函数说明

◆ finiteshrink()

HalfWord finiteshrink ( HalfWord  p)

◆ linebreak()

void linebreak ( long  finalwidowpenalty)

◆ trybreak()

void trybreak ( long  pi,
SmallNumber  breaktype 
)

p308#829

p313#845: Insert a new active node from best place[fit class] to cur p

p317#858: Update the value of printed node for symbolic displays

变量说明

◆ activewidth

Scaled activewidth[6]

◆ background

Scaled background[6]

◆ bestplace

Pointer bestplace[tightfit - veryloosefit+1]

◆ bestplline

HalfWord bestplline[tightfit - veryloosefit+1]

◆ breakwidth

Scaled breakwidth[6]

◆ curactivewidth

Scaled curactivewidth[6]

◆ curp

Pointer curp

◆ discwidth

Scaled discwidth

◆ easyline

HalfWord easyline

◆ finalpass

Boolean finalpass

◆ firstindent

Scaled firstindent

◆ firstwidth

Scaled firstwidth

◆ justbox

Pointer justbox

◆ lastspecialline

HalfWord lastspecialline

◆ minimaldemerits

Integer minimaldemerits[tightfit - veryloosefit+1]

◆ minimumdemerits

Integer minimumdemerits

◆ noshrinkerroryet

Boolean noshrinkerroryet

◆ passive

Pointer passive

◆ passnumber

HalfWord passnumber

◆ printednode

Pointer printednode

◆ secondindent

Scaled secondindent

◆ secondpass

Boolean secondpass

◆ secondwidth

Scaled secondwidth

◆ threshold

Integer threshold