home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / lout2.lzh / LOUT2 / DOC / TR.OVER / s6 < prev    next >
Text File  |  1994-01-25  |  3KB  |  60 lines

  1. @Section
  2.    @Title { Cross references }
  3. @Begin
  4. @PP
  5. The terms @Code "@TextPlace&&preceding" and @Code "@FootPlace&&following"
  6. used above can be thought of as arrows in the final printed document,
  7. pointing from themselves to the place they name.  Expressed in this way,
  8. free of any reference to the internal action of the document formatter,
  9. they are easy to comprehend and work with.  These arrows are called
  10. cross references in Lout.
  11. @PP
  12. A galley is transported forwards along its arrow, but it turns out that
  13. a reverse flow of information can also be very useful.  For example,
  14. large documents often have cross references such as `see Table 6 on page
  15. 57.'  If the numbers are replaced by arrows pointing to the table in
  16. question, it should be possible to have their values filled in
  17. automatically (an idea introduced by Scribe [{@Ref reid80}]).  An arrow
  18. pointing outside the docu&-ment could retrieve an entry from a database of
  19. references, Roman numerals, etc.  And a running page header like
  20. `Chapter 8:  Sorting' might obtain its value from an arrow pointing from
  21. the page header line down into the body text of the page, where the
  22. current chapter is known.
  23. @PP
  24. All these ideas are realized in Lout, but here we will just sketch a
  25. simplified version of the running page header definitions found in the
  26. BookLayout package [{@Ref kingston92begin}].  A symbol called
  27. @Code "@Runner" is first defined:
  28. @ID @Code {
  29. "def @Runner"
  30. "    right @Val"
  31. "{}"
  32. }
  33. @Code "@Runner" produces nothing at all, which means that we may place
  34. the invocation
  35. @ID @Code {
  36. "@Runner { Chapter"
  37. "8:  Sorting }"
  38. }
  39. at the end of a chapter without harm.  This invisible invocation will be
  40. carried along with the chapter and will end up on some page of the final
  41. printed document.
  42. @PP
  43. By modifying the definition of {@Code "@PageList"}, we can add to each
  44. page a header line containing the expression
  45. @ID @Code {
  46. "@Runner&&following"
  47. "@Open { @Val }"
  48. }
  49. This means `find the nearest following invocation of @Code "@Runner" in the
  50. final printed document and retrieve its @Code "@Val" parameter.' Every page
  51. of Chapter 8 will find the correct running header, since @Code "@Runner"
  52. was placed at the end of the chapter.  The invocation @Code "@Runner {}"
  53. placed at the beginning of the chapter will suppress the header on the
  54. first page of the chapter, as it is conventional to do.
  55. @PP
  56. These invocations of @Code "@Runner" are hidden from the non-expert user
  57. within the definition of the @Code "@Chapter" operator.  The result is a
  58. reliable implementation of a notoriously difficult feature.
  59. @End @Section
  60.