more on what s new in luat ex 0 43
play

More on. . . Whats new in LuaT EX 0.43 Hartmut Henkel, Oftersheim, - PowerPoint PPT Presentation

More on. . . Whats new in LuaT EX 0.43 Hartmut Henkel, Oftersheim, Germany N 49 22 . 275 E 008 35 . 553 EuroT EX 2009, NDC, The Hague, The Netherlands N 52 1 . 762 E 004 21 . 897 Thursday, 3 September 2009,


  1. More on. . . What’s new in LuaT EX 0.43 Hartmut Henkel, Oftersheim, Germany N 49 ◦ 22 . 275 ′ E 008 ◦ 35 . 553 ′ EuroT EX 2009, NDC, The Hague, The Netherlands N 52 ◦ 1 . 762 ′ E 004 ◦ 21 . 897 ′ Thursday, 3 September 2009, 09:45

  2. Overview ◮ What means TRT? — the aleph direction model in LuaT EX ◮ Global leaders — by LuaT EX ◮ Using \latelua within \leaders

  3. Multidirectional Positioning Lua T EX knows many writing directions (inherited from Omega/aleph) # Dir Box dir Glyph dir ---------------------------------------------- 0 TLT = 010 dir_TL_ = 0 dir__LT = 0 1 TLL = 011 dir_TL_ = 0 dir__LL = 1 2 TLB = 012 dir_TL_ = 0 dir__LB = 2 3 TLR = 013 dir_TL_ = 0 dir__LR = 3 4 TRT = 030 dir_TR_ = 1 dir__RT = 4 5 TRL = 031 dir_TR_ = 1 dir__RL = 5 6 TRB = 032 dir_TR_ = 1 dir__RB = 6 7 TRR = 033 dir_TR_ = 1 dir__RR = 7 . LTT, LTL, LTB, LTR, LBT, LBL, LBB, LBR, . BLT, BLL, BLB, BLR, BRT, BRL, BRB, BRR, . RTT, RTL, RTB, RTR, RBT, RBL, 30 RBB = 322 dir_RB_ = 7 dir__BB = 14 31 RBR = 323 dir_RB_ = 7 dir__BR = 15

  4. Multidirectional Positioning What TLT means. . . T L T d g h \pardir TLT \textdir TLT Line of text Next line pos−tlt1.fig

  5. Multidirectional Positioning What means TRT, anyway? TLT − →

  6. Multidirectional Positioning What means TRT, anyway? TLT − → − TRT ←

  7. Multidirectional Positioning There are in principle also many glyph directions. . . *LT *RT *LL *RR *LB *RB *LR *RL *TL *BL *BR *TR *TT *TB *BT *BB fontdir.fig . . . but most available fonts are just *LT. LuaT EX uses standard *LT fonts also e. g. for TRT typesetting.

  8. Multidirectional Positioning Page offsets in Lua T EX depend on \pagedir — There are new offset parameters \pagetopoffset \pagetopoffset Page border \voffset + 1in \voffset + 1in \pageleftoffset \pagerightoffset \hoffset + 1in TL* TR* LT* RT* \pageheight BL* BR* \pageleftoffset LB* RB* \hoffset + 1in \pagerightoffset \pagebottomoffset \pagebottomoffset offsets−luatex1.fig Pos. origin = page origin \pagewidth For most directions \pagewidth and \pageheight are needed as well.

  9. Multidirectional Positioning Why \bodydir should match \pagedir . . . \pagetopoffset Page border \voffset + 1in \pageleftoffset \hoffset + 1in ...txeT emoS \bodydir TRT \pagedir TLT Off−Page! offsets−luatex2.fig Pos. origin = page origin

  10. Multidirectional Positioning Available direction setting commands ◮ \pagedir *** ◮ \bodydir *** ◮ \pardir *** ◮ \textdir *** ◮ \mathdir *** ◮ \hbox dir *** {...} ◮ \vbox dir *** {...} There are also commands for querying directions.

  11. Multidirectional Positioning What the output routine sees (simplified) — Node lists. . . Box dimensions (width, height, depth) Width info + Box direction taken from font H e l l o 72 101 108 108 111 0 Glue spec. (line distance) "glue" Node T e X i e s ! 84 101 88 105 101 115 33 0 "hlist" Node "character" Node nodes1.fig

  12. Multidirectional Positioning Positioning in Original T EX Two pairs of global position variables (TLT coordinates only): ◮ cur_h , cur_v — where the output routine is ◮ dvi_h , dvi_v — what goes into the DVI file Page border 1 in DVI Origin 1 in cur_v Some Text cur_h pos−tex1.fig Before typesetting some item, dvi_h / v is synchronized to cur_h / v .

  13. Multidirectional Positioning New: Local box coordinates, global page coordiates cur coordinates are local to box, in box coordinate system. \bodydir RTR Page border \pagetopoffset \pagedir RTR refpos \pagerightoffset cur.h RTR page box refpos refpos cur.v RTR box cur.h RTR box Pos. origin pos.h pos.v pos−luatex1.fig = Page origin pos coordinates are in output page coordinate system. The output routine keeps track of refpos and calculates pos from ( cur.h , cur.v ) and local box direction.

  14. Multidirectional Positioning News from the Lua T EX back-end ◮ New scaledpos structure (e. g., cur.h , cur.v ). ◮ PDF page positioning calculations re-written (new design). ◮ Combined dvi_ship_out() and pdf_ship_out() into one. ◮ Combined dvi_*list_out() and pdf_*list_out() in one. ◮ Switching between DVI and PDF now by function pointers for back-end (node/whatsit) output functions. → Multidir positioning in the back-end is same for PDF & DVI. − ◮ PDF and DVI positioning behaves identical. ◮ Less code to manage. ◮ Possibility to add other back-ends (e. g., Lua), while keeping multidir functionality consistent.

  15. Global Leaders What are \leaders ? Leaders are . . . . . . . . . . . . . . . . . . . . . this. Leaders are\leaders\hbox to 1em{\hfil.\hfil}\hfil this.

  16. Global Leaders What are \leaders ? Leaders are . . . . . . . . . . . . . . . . . . . . . this. Leaders are\leaders\hbox to 1em{\hfil.\hfil}\hfil this. \hbox origin enclosing \hbox Leaders are . . . . . . . . . . this. ... ... . . . . . . . . . . . . . . . . . \leaders anchor \leaders box 1 em leaders1.fig

  17. Global Leaders What are \leaders ? Leaders are . . . . . . . . . . . . . . . . . . . . . this. Leaders are\leaders\hbox to 1em{\hfil.\hfil}\hfil this. \hbox origin enclosing \hbox Leaders are . . . . . . . . . . this. ... ... . . . . . . . . . . . . . . . . . \leaders anchor \leaders box 1 em leaders1.fig In tex82.bug , DEK, 1983: 152. \leaders to align by the smallest enclosing box. (April 1)

  18. Global Leaders Where \leaders get difficult. . . (Contrived) Example: a . . . . bc . . . . abcde . . fghijklmnop Some table: Two cols . . . . . . more text . . . . . . Another line . . . . . . . . . . . . . . . . . with leaders → \leaders don’t align (different enclosing boxes). −

  19. Global Leaders Experimental Lua T EX primitive \gleaders — Leaders anchored at the page box Same example, just replace \leaders by \gleaders : a . . . bc . . . abcde . fghijklmnop Some table: Two cols . . . . . . more text . . . . . . Another line . . . . . . . . . . . . . . . . . with leaders

  20. Global Leaders Experimental Lua T EX primitive \gleaders — Leaders anchored at the page box Same example, just replace \leaders by \gleaders : a . . . bc . . . abcde . fghijklmnop Some table: Two cols . . . . . . more text . . . . . . Another line . . . . . . . . . . . . . . . . . with leaders Page box \hbox origin enclosing \hbox Leaders are . . . . . . . . . this. ... . ... . . . . . . . . . . . . . . . . . . . . . \gleaders anchor = Page box origin \gleaders box 1 em gleaders1.fig \gleaders align by the largest enclosing box.

  21. Global Leaders Discussion ◮ \gleaders are an experimental primitive in LuaT EX. ◮ They don’t use any LuaT EX-exclusive functions. ◮ The \gleaders mechanism could have been in T EX already. ◮ In LuaT EX \gleaders work multidir (hopefully). ◮ Useful? Drawbacks? Bugs?

  22. Leaders and \latelua Lua T EX opens \latelua to \leaders Example: \directlua{ rgbrand = function() pdf.print(" " .. math.random() .. " " .. math.random() .. " " .. math.random() .. " " .. " rg " ) end } Colored leaders\leaders \hbox to 2pt{\latelua{rgbrand()}\hfil.\hfil}\hfill \latelua{pdf.print(" 0 g ")}like this. Colored leaders........................................................................................like this.

  23. Thank you for your attention!

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend