home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / tr2latex / testfile < prev    next >
Encoding:
Text File  |  1987-06-30  |  2.6 KB  |  117 lines

  1. .LP
  2. .EQ
  3. delim $$
  4. gsize 11
  5. define dC "delta C"
  6. define xx 'x sup x'
  7. define B 'bold B'
  8. define (( 'left ('
  9. define )) 'right )'
  10. define ov 'over'
  11. .EN
  12. .ds CF %
  13. .ds LH Al-Yahya
  14. .ds RH troff to TeX translator
  15. .TL      
  16. Testing the troff-to-tex translator
  17. .AU          
  18. Kamal Al-Yahya
  19. .AI
  20. Stanford University
  21. .AB
  22. This file demonstrates the use of \fB tr2tex\fR which translates
  23. documents written in troff to a LaTeX style.
  24. Examples are given to show what the translator can do.
  25. .AE
  26. .PP
  27. First let's test some equation written for the
  28. .B eqn
  29. preprocessor:
  30. .EQ (1)
  31. 2 left ( 1 ~+~ sqrt{omega sub i+1 + zeta -{x+1} over {THETA +1} y + 1} right )
  32. ~~~=~~~ 1
  33. .EN
  34. .EQ
  35. left [
  36. matrix {
  37.    ccol { e sub 1 above . above . above e sub i above . above . above e sub N }
  38. }
  39. right ] sub n+1 ~~=~~ y + 1
  40. .EN
  41. .EQ
  42. bold X + roman a ~>=~
  43. a under hat fwd 20 sum from i to N lim from {x -> k} dC
  44. .EN
  45. .EQ
  46. (( "speed" times "time" = "distance travelled" ))
  47. .EN
  48. .EQ
  49. beta tilde i >= zeta dC
  50. .EN
  51. .IP
  52. In-line math like $beta +1$ which is surrounded by math delimiters, as
  53. defined by
  54. .I delim
  55. is also translated.
  56. .R
  57. .PP
  58. Only simple tables are translated. Translation of more complicated tables
  59. is painful and I won't do it now. Here is an example:
  60. .TS
  61. tab(&);
  62. l rc n.
  63. name    & type        & color    & value
  64. $alpha$    & real        & red    & 2.3
  65. $x$    & imaginary    & green    & -1.2
  66. $a + 2$    & real        & white    & 0.0
  67. .TE
  68. \" this is a commented text
  69. .PP
  70. Now we start a figure.
  71. .Is
  72. .sp 3i
  73. .Ic 1
  74. This is the caption of the figure.
  75. .Ie
  76. .PP
  77. Try some floating objects.
  78. .br
  79. .KS
  80. This text should be kept in one page. i.e. a page break is discouraged here.
  81. .KE
  82. .br
  83. Now a floating text.
  84. .KF
  85. This text should be kept in one page even if we had to move it around,
  86. since it is a
  87. .I floating
  88. object. This is a boxed
  89. .BX word.
  90. .KE
  91. .br
  92. These characters are special in TeX, so they need to be escaped
  93. in the translation % & # _, while these characters have to be
  94. printed in math mode < > |. 
  95. .FS
  96. This is a footnote
  97. .FE
  98. .PP
  99. .Ac
  100. Thanks to all of those who contributed by reporting bugs and suggesting
  101. some improvements. Special thanks go to Nelson Beebe for all of his valuable
  102. contributions and suggestions. He is responsible for making the translator
  103. portable to other computers. He also made significant improvements to
  104. the translation of manuals.
  105. .Re
  106. Knuth, D.E., 1984, The TeXBook, Addison-Wesley Publishing Company.
  107. .Re
  108. Lamprt, L., 1986, LaTeX: user's guide & reference manual, Addison-Wesley
  109. Publishing Company.
  110. .Re
  111. Lesk, M.E., 1978, Typing documents on the UNIX
  112. system: using the -ms macros
  113. with troff and nroff, UNIX programmer's manual, v. 2B, sec. 3.
  114. .Re
  115. McGilton, H. and Morgan, R., 1983, Introducing the UNIX system, McGraw-Hill
  116. Book Company.
  117.