home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / text / tex / 15339 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  9.1 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!mintaka.lcs.mit.edu!ai-lab!wheat-chex!bkph
  2. From: bkph@wheat-chex.ai.mit.edu (Berthold K.P. Horn)
  3. Newsgroups: comp.text.tex
  4. Subject: Re: HyperTeX
  5. Date: 23 Jan 1993 02:27:09 GMT
  6. Organization: MIT Artificial Intelligence Lab
  7. Lines: 207
  8. Message-ID: <1jqadtINN50f@life.ai.mit.edu>
  9. References: <16B569888.UPP201@rhrz.uni-bonn.de> <1j6g54INNcr8@life.ai.mit.edu> <ALIEN.93Jan18172626@vulcan.essex.ac.uk>
  10. NNTP-Posting-Host: wheat-chex.ai.mit.edu
  11. In-reply-to: alien@essex.ac.uk's message of 18 Jan 93 17:26:26 GMT
  12.  
  13.  
  14. In article <ALIEN.93Jan18172626@vulcan.essex.ac.uk> alien@essex.ac.uk ("Adrian F Clark") writes:
  15.  
  16.     ...
  17.  
  18.    BKH> Hyper text linkage is also supported by DVIWindo on the IBM PC.
  19.    BKH> Great way to add a glossary to a manual, for example.
  20.    BKH> Particularly since it is easy to highlight the words using
  21.    BKH> a different font, different color, or reverse video, or colored 
  22.    BKH> background box.  Hyper text buttons can be anywhere, even behind
  23.    BKH> inserted TIFF images.
  24.  
  25.    Maybe someone could post definitions for the \specials involved, so
  26.    that we can consider extending existing previewers in a compatible
  27.    way.
  28.  
  29.    --
  30.     Dr Adrian F. Clark                                   JANET: alien@uk.ac.essex
  31.     INTERNET: alien%uk.ac.essex@nsfnet-relay.ac.uk          FAX: (+44) 206-872900
  32.     BITNET: alien%uk.ac.essex@ac.uk              PHONE: (+44) 206-872432 (direct)
  33.     Dept ESE, University of Essex, Wivenhoe Park, Colchester, Essex, C04 3SQ, UK.
  34.  
  35. OK, here is a brief summary of some of the relevant \special's supported
  36. by DVIWindo - along with some hype about `electronic publishing' :-*
  37.  
  38. Some \specials for hyper-text linkage in DVI files:
  39. ===================================================
  40.  
  41. Electronic publishing is upon us.  Many files may rarely if ever be printed.
  42. `Pre'-viewers need to get better in terms of font rendering, faster, and more
  43. interactive --- since often they will be the only way a user interact with a
  44. document.  This attitude to `pre'-viewers leads to the requirement for new
  45. capabilities that would not be thought of if the previewer was in fact merely
  46. there to make sure that there aren't any problems with a document, and that it
  47. is worth wasting paper to print it.
  48.  
  49. At the minimum, a `pre'-viewer needs to support string search, and have
  50. the ability to display diagrams, figures and image of some sort.  
  51. But more can be done if the user is given some interactive capabilities.
  52. Hyper-text linkage provides such ability.  It makes it possible,
  53. for example, to high-light technical terms in order to alert the user to the
  54. fact that clicking on the word will show the corresponding glossary entry.
  55.  
  56. Here are some simple \specials for implementing such a capability.
  57. Note that the end user would typically NOT use the \specials `raw', but
  58. via some macro package, as usual.  So, for example, instead of explicitely 
  59. changing text color, there might be macros like
  60.  
  61. \def\lavender{\special{textcolor: 128 0 128}}
  62. \def\revert{\special{\textcolor: revert}}
  63.  
  64. which could then be used in text:
  65.  
  66. ... the {\lavender hyper-text \revert} button works by ...
  67.  
  68.  
  69. Summary of \specials:
  70. =====================
  71.  
  72. (*) Hyper-text buttons are set up using:
  73.  
  74. \special{button: <width> <height> <mark> [<file>]}
  75.  
  76. This creates a sensitive area of specified width and height, with the
  77. lower left corner at TeX's current point.  The semantics of this is
  78. that if the user clicks the left mouse button in the hypertext button 
  79. area, viewing is transferred to the corresponding labelled mark 
  80. (possibily in another DVI file).  
  81.  
  82. (*) Hyper-text marks are set using
  83.  
  84. \special{mark: <label> [<xoff> <yoff>]}
  85.  
  86. This is place to which control can be transferred.  The optional offsets
  87. specify where the cursor is to appear relative to TeX's current point.
  88.  
  89. Clicking the right mouse button returns control to the place where the left
  90. mouse button was last pushed.  A limited push down stack of DVI file
  91. positions is maintained.  The right mouse button push can come after the
  92. viewing scale, position or page has been changed.
  93.  
  94. The hypertext button can be any rectangular area.  Attention can be
  95. drawn to the button using rules, text or inserted TIFF images.  The
  96. ability to control the color of rules and text and bi-level images
  97. is particularly useful in this connection.
  98.  
  99. In some cases it makes sense for there to be just one (short) page per mark,
  100. particularly in the case of a glossary.
  101.  
  102. NOTE: all dimensions are in TeX's scaled points (65536 per printer's
  103. point, of which there are 72.27 per inch).  Hence they are easy to create
  104. using the usual dimension notations in TeX, including `pt', `cm', `in' etc.
  105.  
  106. NOTE: hyper-text `labels' are sequences of non-white space characters --- or
  107. strings delimited by double-quote marks.
  108.  
  109. There is no visible manifestation of the button itself (except in a mode
  110. designed for debugging hyper text linkage).  This allows the user 
  111. flexibility to show the button using words in some special font, 
  112. colored text, colored rules in the background, or inserted TIFF images.
  113.  
  114. (*) The color of text is controlled as follows:
  115.  
  116. \special{textcolor: <r> <g> <b>}   and   \special{textcolor: revert}
  117.  
  118. where <r> <g> and <b> are numbers in the 0 - 255 range specifying
  119. the amount red, green, and blue components of the color to be used for text.
  120.  
  121. `textcolor: revert' returns the color to that in force before the previous 
  122. textcolor change.  
  123.  
  124. Judicious use of a bit of colored text can be a useful adjunct to font
  125. changes in drawing attention.  A good way to mark technical words with
  126. hyper text buttone behind them that lead to a glossary, for example.
  127.  
  128.  
  129. (*) The color of rules is controlled as follows:
  130.  
  131. \special{rulecolor: <r> <g> <b>}  and   \special{rulecolor: revert}
  132.  
  133. where <r> <g> and <b> are numbers in the 0 - 255 range specifying
  134. the amount red, green, and blue components of the color to be used for rules.
  135.  
  136. `rulecolor: revert' returns the color to that in force before the previous 
  137. rulecolor change. 
  138.  
  139. Rules are useful for colored backgrounds behind text, and for delineating
  140. hyper-text buttons.
  141.  
  142.  
  143. (*) Text can be shown in reverse video using:
  144.  
  145. \special{reversevideo: on}  and     \special{reversevideo: off}
  146.  
  147. The size of the rectangular area with reversed color on which the 
  148. letter is placed depends on the ascent and descent of the font being used.
  149.  
  150.  
  151. (*) TIFF images (or EPSF images with TIFF preview) can be inserted using:
  152.  
  153. \special{insertimage: <file-name> <width> [<height> [<ifdn>]]}
  154.  
  155. The image is inserted with the lower left hand corner at TeX's current
  156. point.  The current point is not affected by the image insertion. Here 
  157. <ifdn>, if given, specifies the number of the image in the file.  
  158. If omitted, the first (and often the only) image in the file is shown. 
  159. <width> and <height> specify the space on the page to be used for the image.
  160. The image is scaled isotropically if height is omitted, otherwise it is
  161. stretched as needed. 
  162.  
  163.  
  164. (*) In the case of `monochrome'/`bi-level'/`one-bit' images, one can
  165. control the color of the `figure' (1 bits) and the color of the
  166. `background' (0 bits) using:
  167.  
  168. \special{figurecolor: <r-c> <g-c> <b-c> [<r-b> <g-b> <b-b>]}
  169.  
  170. where the first three numbers specify the color of the `figure'
  171. and the last three the color of the `background'.  The background
  172. is white (or rather the selected screen background color) if the
  173. background color is omitted.
  174.  
  175.  
  176. (*) TPIC specials can also be used to create device independent graphics,
  177. such as polygonal lines (solid, dashed, or dotted),  quadratic splines,
  178. circlular disks and arcs, ellipses, pie slices and so on.  The latter
  179. are particularly useful for drawing attention to hyper-text buttons.
  180.  
  181.  
  182. (*) The ten most popular schemes for insertion of EPS figures are also
  183. supported.  If the EPS figure has a preview in EPSF or EPSI format, it
  184. will be shown on screen.  On the IBM PC, most drawing applications create
  185. EPSF files with TIFF preview, for example.  On Unix/NeXT EPSI preview is
  186. more popular.
  187.  
  188.  
  189. Some Limitations:
  190. =================
  191.  
  192. One some display devices text colors will be `rounded' to the nearest 
  193. `solid' color --- for example, one of 20 `system colors' in the case of VGA.
  194. (The colors of rules will not be so `rounded' --- dithered colors will be 
  195. used if necessary).
  196.  
  197. The push down stacks for saving text color and rule colors is limited.
  198.  
  199. Positive kerning within a word can introduce gaps in reverse video.  
  200. Often the desired effect can be achieved with better control by first 
  201. using a rule to lay down a rectangular area behind the text in the 
  202. background color and then writing the text over it in the desired 
  203. foreground color. 
  204.  
  205. TIFF image files are binary and have a complex structure and so cannot be
  206. reliably read using TeX. So it is not possible to extract the number of rows 
  207. and columns (the way BBox'es are read from EPS files) using TeX macros.
  208. Since the aspect ratioof the figure will not be know to TeX, it is safest to
  209. specify only the width of the figure to avoid anistropic scaling.
  210.  
  211. For page independence, color of text and rules is NOT maintained
  212. across page breaks.  This makes it a challenge to reliably change
  213. the color of a long section of text which may be broken across pages.
  214.  
  215.  
  216. Disclaimer: respondent has connections with Y&Y :=]
  217.  
  218. Berthold K.P. Horn
  219. Cambridge, Massachusetts, USA
  220.