home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / TeXSystem.lzh / Usage.text (.txt) < prev   
LaTeX Document  |  1992-11-25  |  16KB  |  244 lines

  1.                   WHERE TO FIND MORE INFORMATION
  2.   This file explains how to use TeX, LaTeX, and MetaFont on a day-to-day
  3. basis.  By basing your work on one of the sample documents provided, and
  4. using the hints in this file, you should be able to produce simple
  5. documents with a minimum of fuss.  For more complicated work, you will
  6. definitely need one or more of the following as a reference.  I suggest
  7. that you start with LaTeX, and use "The TeXBook" as a reference when you
  8. find you need more detail.  Both of these books have excellent first
  9. chapters to help you get started and understand what's going on.  Those
  10. people interested in pursuing font design further  may be interested in
  11. the METAFONTBook, and the companion "Computer Modern Typefaces."
  12. Finally, it should be noted that TeX and MetaFont were written partly as
  13. educational examples of large, practical programs.  Towards this end,
  14. Knuth has published the complete source of both programs.
  15.   Leslie Lamport, "LaTeX: A Document Preparation System,"
  16.        Addison-Wesley, 1986.
  17.   Donald Knuth, "The TeXBook," Volume A of "Computers and Typesetting,"
  18.        Addison-Wesley, 1986.
  19.   Donald Knuth, "TeX: The Program," Volume B of "Computers and
  20.        Typesetting," Addison-Wesley, 1986.
  21.   Donald Knuth, "The METAFONTBook," Volume C of "Computers and
  22.        Typesetting," Addison-Wesley, 1986.
  23.   Donald Knuth, "METAFONT: The Program," Volume D of "Computers and
  24.        Typesetting," Addison-Wesley, 1986.
  25.   Donald Knuth, "Computer Modern Typefaces," Volume E of "Computers and
  26.        Typesetting," Addison-Wesley, 1986.
  27. ==============================================================================
  28.                            TeX USAGE NOTES
  29.    Typesetting a file with TeX or LaTeX is generally as easy as "tex
  30. file.tex" or "latex file.tex".  In both cases, the ".tex" can be omitted
  31. for ease of typing.  Since both TeX and LaTeX documents traditionally
  32. use the same extension, you will often have to look at the file to
  33. determine which to use.  To check whether a document is a LaTeX file,
  34. look for a "\documentstyle" command at the very beginning of the file
  35. (usually the very first line).   If this command is lacking, then it's
  36. definitely not a LaTeX document and so you should try using Plain TeX.
  37. (Although it may be for another dialect of TeX such as e-TeX or AMS-TeX,
  38. the most common possibilities are LaTeX and Plain TeX.)
  39.    Usually, when you run TeX (everything I'm going to say about TeX also
  40. applies to LaTeX), you'll see a few warning messages and then TeX will
  41. finish.  While it's running, TeX displays information on the screen so
  42. you know what's going on.  In particular, whenever it starts to read a
  43. file, it prints "(" followed by the file name, and then ")" when that
  44. file ends.  It also prints out the page numbers in square brackets
  45. whenever it writes a page of output.  When TeX is done, you'll have at
  46. least two (and sometimes more) new files. The ".log" file contains
  47. everything that TeX printed to the screen and sometimes a little bit
  48. more.  You can use this to review any errors when you're done.  The
  49. ".dvi" file specifies where each character in the printed output should
  50. go on the page.  You can run this through a "DVI translator" to generate
  51. the correct output for your printer. Note that if you're using LaTeX's
  52. features for handling cross-references or for building a table of
  53. contents or bibliography automatically, you may have to run latex two
  54. (or even three) times before everything comes out right.
  55.    Occasionally, TeX feels it must stop and ask for clarification.  When
  56. it does so, it will print a helpful message, including the text it was
  57. processing, and will put up a "?" prompt.  If you read the TeXBook,
  58. you'll find the full story about what you can do here, but for now, you
  59. should know that simply pressing <RETURN> will prompt TeX to try and
  60. keep going. You can also type "I\stop" and <RETURN> to tell TeX to try
  61. to wrap up what it's doing and quit. In particular, it will try to write
  62. the current page, which you can then print to help understand what the
  63. problem is.  If that doesn't stop TeX, typing "x" and <RETURN> will
  64. cause TeX to simply stop without cleaning up.
  65.    Occasionally, TeX will finish a file and display a "*" prompt. This
  66. simply means that TeX ran out of input before it saw a command telling
  67. it the input was finished, and TeX is now giving you the opportunity to
  68. type the rest of your document.  Usually, a simple "\end" will finish
  69. everything.
  70.    TeX is very particular about how it's results look, and so it's quite
  71. common for it to generate warnings when it decides that the output isn't
  72. quite good enough.  This usually results in "Underfull hbox" or
  73. "Overfull hbox" or similar error messages about "vboxes".  The simple
  74. explanation is that an "hbox" is a "horizontal box", usually a line in
  75. your document (which is made by stacking letters horizontally, hence the
  76. name).  Underfull or overfull hbox errors means that when TeX attempted
  77. to break a paragraph into lines, it couldn't find a good enough way to
  78. do so.  Usually, if you look at the output, you can find a hyphenation
  79. which TeX has overlooked, or rewrite the text slightly so that TeX can
  80. handle it more easily.  Similarly, a "vbox" is a "vertical box", usually
  81. a page of your document.  Vbox errors usually only occur when you have a
  82. large table or figure which can't be broken across pages.  Typically,
  83. you should just ignore these errors at first, since the process of
  84. editing your text to make it read better will cause many of these errors
  85. to go away (and, sadly, some new ones to appear). You should only worry
  86. about hbox and vbox errors in the very last stages of polishing your
  87. document, and even then, only if you think the output is as poor as TeX
  88. does.  (A note about "badness":  TeX thinks 10000 is "infinitely bad",
  89. which often indicates a problem that will stand out in the final
  90. product. Badnesses of less than about 5000 are often not noticable
  91. unless you look very closely.)
  92.    Missing fonts:  Occasionally, TeX will complain that it is missing a
  93. font.  TeX uses "tfm" files to tell it the sizes of the letters in a
  94. font.  If you are missing a TFM file, and can't find a copy of it, you
  95. can use MetaFont to create the TFM file (cmr10.tfm applies to the font
  96. cmr10 at any resolution or magnification, and MetaFont will generate
  97. this file when you create any version of cmr10), or you can try to
  98. change to a different font.  The fonts used by LaTeX are in the file
  99. lfonts.tex, and this can be edited to your preferences, although you
  100. must remember to recreate the lplain.fmt file afterwards.
  101. ==============================================================================
  102.                    USING THE DVI TRANSLATORS
  103.    TeX's DVI output only tells where each character belongs on the page;
  104. it says nothing about what the individual characters look like. A DVI
  105. translator program uses this information to create an output file for a
  106. particular printer.  Usually, TeX systems have used bitmap fonts created
  107. by MetaFont, although it is possible to use the fonts built-in to a
  108. particular printer.  The DVI translators that have been maintained by
  109. Nelson Beebe at the University of Utah, some of which are included in
  110. this package, work in two different ways, depending on the printer. 
  111. With printers that support downloadable fonts, including Postscript and
  112. most other laser printers, the translator builds a file which creates the
  113. downloaded fonts as bitmaps and then instructs the printer where to put each
  114. letter.  For other printers, the translator simply builds a bitmap image
  115. of each page and prints that.
  116.    The translators are often run by simply giving them the name of the
  117. DVI file, i.e. "dvilj2 about_latex.dvi" if you are using an HP LaserJet
  118. II.  When used in this fashion, the translator will create an output
  119. file with the extension ".dvi_lj2" (the extension depends upon the
  120. particular translator being used), and an error log with the extension
  121. ".dvi_err".  If there are no errors, you can use the OS9 "merge" utility
  122. to send the file to the printer. If you have a print spooler, be sure
  123. the spooler can handle binary graphics files correctly (unless you are
  124. using a Postscript printer, in which case it shouldn't matter).
  125.   Under Unix and OS9, the translators support I/O redirection.  If you
  126. redirect the input, the translator will send the result to the standard
  127. output path.  This allows you to skip a step and simply type "dvilj2
  128. <about_latex.dvi >/p".  Especially at first, you should probably avoid
  129. doing this, since this does not give you a chance to build any missing
  130. fonts.  Generally, you should use the first method, then create any
  131. fonts that were missing, then rerun the translator to recreate the
  132. output file using the new fonts.
  133.    If the translator cannot find a font it needs, it will attempt to
  134. find a close match.  Unfortunately, this is a slow process that usually
  135. does not work very well.  The translator will then generate a message
  136. along the lines of
  137.          Font file [cmr12 [247 dpi]] could not be opened, ...
  138. This means that the translator expected to find the font "cmr12.247pk",
  139. but couldn't.  This should be enough information for you to create the
  140. missing font using the "makefont" program and the instructions below.
  141. ==============================================================================
  142.                           USING METAFONT
  143.     MetaFont is a system for designing fonts and font families.  It is
  144. considerably more flexible than most outline font systems.  The MetaFont
  145. program reads MetaFont font descriptions and creates bitmapped fonts at
  146. any desired size and resolution.  If you want to know more about the
  147. MetaFont language for defining fonts, you should read the METAFONTBook.
  148. Here, I'll concentrate on explaining how to use MetaFont to create fonts
  149. at various sizes.
  150.     There are three different ways in which font sizes are specified,
  151. and all three interact.  Understanding this interaction is important
  152. to understanding how you use MetaFont to creating a font at a particular
  153. size.
  154.     The first way of specifying font size is the "design size" of the
  155. font. This is the size at which the font looks best on paper, and is
  156. usually expressed in units called "points," abbreviated "pt."  For
  157. reference, there are 72.27 points in one inch, and typical book fonts
  158. are 10 or 12 point fonts. The "point size" of a font doesn't necessarily
  159. refer to any specific feature of the font.  Often, it refers to height
  160. of a typical capital letter, but not always.  In MetaFont files, the
  161. design size is usually included in the font name, i.e., cmtt7 is a
  162. "seven point" font, although cmr17 is actually a 17.28 pt font.
  163.     There are times when a font should appear at some multiple of it's
  164. design size.  MetaFont (and TeX) refer to this as "magnification". A
  165. good example of how this is useful is the following.  If we make all of
  166. our fonts twice as big, print a file, then photographically reduce the
  167. result, then the fonts will appear at their design size, but with twice
  168. the resolution that our printer supported.  More often, magnification is
  169. used to produce a larger version of a font we already have.  If we only
  170. have a certain font in a 10 point design size, then a 1.2 magnification
  171. will produce a 12 point bitmap.  While the results are not quite as good
  172. as a font designed as a 12 point font, they are usually acceptable.  You
  173. should generally not use large magnifications, especially with small
  174. fonts (less than 10 pt).  Likewise, shrinking a font to a very small
  175. size isn't recommended, since smaller fonts are usually somewhat
  176. modified, with slightly simplified designs and thicker lines to make
  177. them easy to read at that particular size.  One particular magnification
  178. deserves special mention. A magnification of 1.2 (120%) is called one
  179. "magstep."  For example, cmr10 at "magstep 1" is 1.2 times as big, or 12
  180. pt.  Cmr10 at "magstep 2" is 1.2*1.2 times as big, 14.4 pt.  This
  181. explains why it is common in MetaFont for a "14 pt font" to really be
  182. 14.4 pts, and similarly "17 pt fonts" are usually 17.28 points, which is
  183. 10 pts at magstep 3.  There are also negative and fractional magsteps,
  184. especially magstep .5, which is the square root of 1.2.
  185.      The third factor is resolution.  Consider creating a 10 pt font for
  186. a 600 dot-per-inch (dpi) printer and printing it on a 300 dpi printer.
  187. You of course end up with a font that is twice as big.  Similarly,
  188. if you "render" (make a bitmap of) a font at 360 dpi and print it
  189. on a 300dpi printer, then the font will be 360/300 = 1.2 times as big.
  190. So, if you want a 12-point version of cmsl10, one way to do it
  191. is to render it at 1.2 times the resolution.
  192.      With all of that, let's tackle a typical MetaFont command line:
  193. virmf '&cmbase \mode:=EpsonMXFX; \batchmode; \mag:=magstep(3); \input cmcsc10; \end'
  194. The quotes simply keep the shell from attempting to interpret the
  195. ampersand and semicolons.  This runs the "virmf" program with the
  196. "cmbase" macro package loaded from it's pre-compiled form.  This macro
  197. package is needed by the Computer Modern font definitions. The rest of
  198. the line is a sequence of MetaFont commands:
  199.    \mode       Sets the printer-dependent variables, including the printer
  200.                resolution and various correction factors.
  201.    \batchmode  Tells MetaFont not to stop on errors, and to not display
  202.                progress information.  You can replace this with "\scrollmode"
  203.                if you'd prefer to see progress information (advisable on
  204.                slower computers).
  205.    \mag        The magnification to be used.  The expression "magstep(3)"
  206.                is a 1.728 magnification.  You can also use plain numbers
  207.                or other expressions (i.e., "\mag:=360/300;").
  208.    \input      Tells MetaFont to read the corresponding file.  This
  209.                particular file contains the instructions for creating
  210.                a 10 point "caps and small caps" font.
  211.    \end        When MetaFont finishes the \input, it will typically prompt
  212.                you for further commands.  The \end tells it to simply exit.
  213.    The output of this will be a ".tfm" file, which contains information
  214. used by TeX to place letters on the page (including the height and width
  215. of each character), a ".log" file which contains any errors that may
  216. have occurred, and a GF file with the actual font bitmap information. 
  217. The extension of the GF file tells the horizontal resolution of the
  218. font.  In this case, the mode specifies 240 dpi, so the extension will
  219. be ".415gf", where the 415 is 240 times magstep 3 rounded to the nearest
  220. integer.  When printed on a 240 dpi printer, the result will be a 17.28
  221. point version of cmcsc10.
  222.     The Basic "makefont" program attempts to do this automatically.  It
  223. has the printer mode and base resolution built in, and takes the design
  224. size from the font name.  It then attempts to compute the magnification
  225. based on the point size or desired resolution of the result.  This
  226. usually involves rounding, and so will usually not be as correct as
  227. specifying the magnification.  For best results, when trying to create a
  228. font at a specific resolution (for example, the resolution of the font
  229. that a DVI translator told you was missing), you should try to figure
  230. the magstep and use that whenever possible.  For example, if you have a
  231. 144 dpi printer, and are told that you need a 173 dpi font, then you
  232. should probably use magstep 1 instead.  If you are told you need a 158
  233. dpi font, then you should probably use magstep .5 (one-half magstep is
  234. the square root of 1.2, which is about 1.1).  Makefont then runs the
  235. program "PKtoGF", which coverts GF format into the more compact
  236. PK format (which has a similar naming convention), and deletes the log
  237. file and the GF file.
  238.      Building a few fonts at a time as you need them does save disk
  239. space, but can become rather tedious.  There are a couple of makefiles
  240. supplied with the system which can automatically make a large number of
  241. fonts.  These files are distributed "as-is," and you should edit them to
  242. reflect the fonts you actually want.  I don't gaurantee that these
  243. makefiles work with Microware's make program, either.
  244.