home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / tex / texsrc2 / Src / README < prev   
Encoding:
Text File  |  1993-02-14  |  15.8 KB  |  411 lines

  1. This file describes web2c, a system which converts TeX, Metafont, and
  2. other WEB programs to C.  It is not a general-purpose Pascal-to-C
  3. translator.
  4.  
  5. The file ./INSTALL contains basic installation instructions.
  6.  
  7. The file ./MACHINES contains a list of known configurations that
  8. have passed the trip and trap test.  If your configuration is not on
  9. this list, you should build triptex and trapmf (instructions below), and
  10. then send mail to karl@cs.umb.edu with the vital statistics, and, of
  11. course, any changes you made, preferably in the form of context diffs,
  12. with ChangeLog entries.
  13.  
  14. The file ./ChangeLog records changes to web2c.  The current version
  15. number of web2c can be found at the beginning of that file (and also in
  16. the Makefile).
  17.  
  18. The file ./PROJECTS describes some improvements to the current setup
  19. that would be nice to have.
  20.  
  21. The file ./PROBLEMS describes various difficulties people have
  22. encountered.  If you have trouble getting the distribution up, look here
  23. first.  You should also look in ./MACHINES.
  24.  
  25. The files ./COPYING* describe copying conditions for some parts of
  26. this distribution.
  27.  
  28. If you know enough about TeX to be reading this, then you (or perhaps
  29. your institution) should consider joining the TeX Users Group.  TUG
  30. produces a quarterly journal (TUGboat), sponsors an annual meeting (the
  31. proceedings of which are published as an issue of TUGboat), and arranges
  32. courses on TeX for all levels of users.  Given sufficient funding (which
  33. your joining will help), TUG could sponsor more projects that will
  34. benefit the TeX community (such as a successor to TeX $\pi$).  Here is
  35. the address:
  36.  
  37. TeX Users Group
  38. P.O. Box 869
  39. Santa Barbara, CA 93102
  40. USA
  41. phone: (805) 899-4673
  42. email: tug@math.ams.org
  43.  
  44.  
  45. Here is a table of contents for the rest of this file:
  46.    Changing constants
  47.    Format files and preloading
  48.    Directory hierarchies
  49.    Online output from Metafont
  50.    Porting and portability
  51.  
  52. Changing constants
  53. %%%%%%%%%%%%%%%%%%
  54.  
  55. The files tex/small.sed and mf/small.sed contain changes to the TeX and
  56. Metafont change files to produce programs using less memory, pool space,
  57. etc. than the defaults.  These patches are applied automatically by
  58. `configure' when you define `SMALLTeX' resp. `SMALLMF' in c-auto.h.in.
  59. The TeX that results (all of this goes for Metafont, too) will have a
  60. larger text segment and run slower, because it has to convert frequently
  61. between 16-bit and 32-bit integers.  On the other hand, the binary will
  62. need much less swap space.
  63.  
  64. Similarly, the file bibtex/small.sed changes some of the constants in
  65. the default BibTeX to smaller values.  The default values are necessary
  66. for some databases (see math.utah.edu:pub/tex/bib), but are rather large.
  67.  
  68. If configure fails to apply the patches, you can do yourself with, e.g.:
  69. % cd tex; sed -f small.sed < tex.ch > ctex.ch
  70.  
  71. You can obtain the patch program, written by Larry Wall
  72. <lwall@jpl-devvax.jpl.nasa.gov> from a comp.sources.unix archive, or by
  73. ftp from his machine (among many other places).  The GNU project has
  74. made some extensions to patch; you can get the GNU version from
  75. prep.ai.mit.edu.
  76.  
  77. If you want to have more than 256 fonts, you might try this patch.  I
  78. haven't installed it in the main change file because it requires
  79. changing max_quarterword.
  80.  
  81. From: Bernd Raichle <raichle@azu.informatik.uni-stuttgart.de>
  82. Date: Mon, 18 May 92 13:27:13 +0200
  83.  
  84. I have applied these diffs to web2c 5.851b with a corrected
  85. WORDS_BIGENDIAN configuration file and *no* changes to `texmfmem.h'.
  86. (Changes are only needed for little-endian machines.)
  87.  
  88. The changed bigTeX is able to load more than 284 fonts before the
  89. font_mem of 100.000 words overflows (it's a good idea to increment
  90. `font_mem_size' when using more than 256 fonts).  `xdvi' and `dvips'
  91. can print the resulted dvi file without problem.
  92.  
  93. The new constant `max_font_max' is necessary, if you want different
  94. values of `font_max' in initex and virtex. (`max_font_max' is the
  95. space reserved in eqtb[] for the font identifiers; in the original
  96. source there is space for 256 font identifier.)
  97.  
  98. -bernd
  99.  
  100.  
  101. *** ctex.ch.ORIG    Fri May 15 12:50:08 1992
  102. --- ctex.ch-32fonts    Fri May 15 15:20:28 1992
  103. ***************
  104. *** 192,195 ****
  105.     can be going on simultaneously}
  106. ! @!font_max=255; {maximum internal font number; must not exceed |max_quarterword|
  107. !   and must be at most |font_base+256|}
  108.   @!font_mem_size=100000; {number of words of |font_info| for all fonts}
  109. --- 192,195 ----
  110.     can be going on simultaneously}
  111. ! @!font_max=450; {maximum internal font number; must not exceed |max_quarterword|
  112. !   and must be at most |font_base+max_font_max|}
  113.   @!font_mem_size=100000; {number of words of |font_info| for all fonts}
  114. ***************
  115. *** 250,251 ****
  116. --- 250,252 ----
  117.   @d hyph_size=607 {another prime; the number of \.{\\hyphenation} exceptions}
  118. + @d max_font_max=512 {maximum number of internal fonts}
  119.   @z
  120. ***************
  121. *** 721,723 ****
  122.   @d min_quarterword=0 {smallest allowable value in a |quarterword|}
  123. ! @d max_quarterword=255 {largest allowable value in a |quarterword|}
  124.   @d min_halfword==0 {smallest allowable value in a |halfword|}
  125. --- 722,724 ----
  126.   @d min_quarterword=0 {smallest allowable value in a |quarterword|}
  127. ! @d max_quarterword==65535 {largest allowable value in a |quarterword|}
  128.   @d min_halfword==0 {smallest allowable value in a |halfword|}
  129. ***************
  130. *** 726,727 ****
  131. --- 727,737 ----
  132.   
  133. + % [8.111]
  134. + @x
  135. + if font_max>font_base+256 then bad:=16;
  136. + @y
  137. + if (max_font_max<min_quarterword)or(max_font_max>max_quarterword) then bad:=15;
  138. + if font_max>font_base+max_font_max then bad:=16;
  139. + @z
  140.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  141. ***************
  142. *** 870,871 ****
  143. --- 880,888 ----
  144.   
  145. + % [x.222]
  146. + @x
  147. + @d undefined_control_sequence=frozen_null_font+257 {dummy location}
  148. + @y
  149. + @d undefined_control_sequence=frozen_null_font+max_font_max+1 {dummy location}
  150. + @z
  151.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  152. ***************
  153. *** 1203,1204 ****
  154. --- 1220,1256 ----
  155.   bytes at a time.
  156. + @z
  157. + % [x.602]
  158. + @x
  159. + @p procedure dvi_font_def(@!f:internal_font_number);
  160. + var k:pool_pointer; {index into |str_pool|}
  161. + begin dvi_out(fnt_def1);
  162. + dvi_out(f-font_base-1);@/
  163. + @y
  164. + @p procedure dvi_font_def(@!f:internal_font_number);
  165. + var k:pool_pointer; {index into |str_pool|}
  166. + begin if f<=256+font_base then
  167. +   begin dvi_out(fnt_def1);
  168. +   dvi_out(f-font_base-1);
  169. +   end
  170. + else begin dvi_out(fnt_def1+1);
  171. +   dvi_out((f-font_base-1) div @'400);
  172. +   dvi_out((f-font_base-1) mod @'400);
  173. +   end;
  174. + @z
  175. + % [x.622]
  176. + @x
  177. + if f<=64+font_base then dvi_out(f-font_base-1+fnt_num_0)
  178. + else  begin dvi_out(fnt1); dvi_out(f-font_base-1);
  179. +   end;
  180. + @y
  181. + if f<=64+font_base then dvi_out(f-font_base-1+fnt_num_0)
  182. + else if f<=256+font_base then
  183. +   begin dvi_out(fnt1); dvi_out(f-font_base-1);
  184. +   end
  185. + else begin dvi_out(fnt1+1);
  186. +   dvi_out((f-font_base-1) div @'400);
  187. +   dvi_out((f-font_base-1) mod @'400);
  188. +   end;
  189.   @z
  190.  
  191.  
  192.  
  193. Format files and preloading
  194. %%%%%%%%%%%%%%%%%%%%%%%%%%%
  195.  
  196. TeX (and Metafont; I'll talk about TeX, but MF is completely analogous)
  197. can write its memory to a file; such a file is called a ``format file''.
  198. Why is this interesting?  Because TeX can read a format file much faster
  199. than the source file that gave rise to it.
  200.  
  201. To create a format file, you give the command `\dump' to initex after
  202. reading the source file.  (This is more or less the raison d'etre for
  203. initex.)  For example:
  204. initex
  205. This is TeX, C Version 3.0
  206. **plain \dump
  207. <blurbs>
  208. Starting to dump on file plain.fmt
  209. <more blurbs>
  210.  
  211. Voila, you have a plain.fmt you can install somewhere with `make
  212. install-formats' (or cp, or whatever).
  213.  
  214. The `formats' target in ./Makefile and tex/Makefile does the above for the
  215. formats defined by the make variable $(formats).
  216.  
  217. Unlike all the other files in the TeX world, format files are not
  218. perfectly portable.  web2c itself always writes the format files in
  219. BigEndian order; for formats which do not dump any floating-point (e.g.,
  220. |glue_ratio|) information, this suffices to make them portable across
  221. architectures.  Most formats (including plain) do not do this.  But you
  222. should always check.  (If you do compare format files dumped on
  223. different architectures, don't be alarmed by a couple of bytes'
  224. difference -- the date is also in the .fmt file.)
  225.  
  226. Well, I said Metafont is completely analogous, but you actually need to
  227. do a little more: create a file that defines your local output devices
  228. (i.e., ``mode_defs'').  A collection of most existing Metafont modes is
  229. available by ftp from ftp.cs.umb.edu:pub/tex/modes.mf, or by email from
  230. me, karl@cs.umb.edu (if you have modes which are not in this file,
  231. please send me mail).  Using modes.mf for your local modes wastes a
  232. little bit of Metafont's memory (because it defines modes which you will
  233. almost certainly never use), but it has several advantages: you can be
  234. sure that your fonts will be identical to others'; you get extra
  235. information added to your fonts; you don't have to experiment to find
  236. your own settings.  modes.mf also explains what goes into a mode_def,
  237. and how to use Metafont with different devices.
  238.  
  239. Once you have such a file, you say something like the following:
  240. inimf
  241. This is METAFONT, C Version 2.0
  242. **plain
  243. <blurbs>
  244. *input modes
  245. <blurbs>
  246. *dump
  247. <final blurbs>
  248.  
  249. and you should have a file `plain.base', analogous to TeX's `plain.fmt'.
  250.  
  251. The target `bases' in ./Makefile and mf/Makefile does the above for the
  252. bases defined by the make variable $(bases).
  253.  
  254. TeX uses the name it was invoked with to figure out what format file to
  255. read.  Therefore, for each format file, you should create a link to the
  256. virtex executable named the name of the format file.  For example:
  257.     cd $(bindir)
  258.     ln virtex tex
  259.     ln virtex latex
  260.     ln virtex texinfo
  261.  
  262. Then, when you run, say,
  263. texinfo
  264. TeX looks for a format file named `texinfo.fmt'.
  265. All of this goes for Metafont, too.
  266. ./Makefile tries to install these links automatically.
  267.  
  268. One more thing about format (and base) files: It is possible to
  269. ``preload'' TeX, i.e., avoid reading the .fmt file at runtime.  However,
  270. on most modern machines, you don't gain a lot of startup time, and you
  271. lose a lot of disk space.  Furthermore, different flavors of TeX will
  272. not have their code segments shared.  Therefore, it is probably best not
  273. to preload unless, of course, it takes your machine eons to load a
  274. format file.
  275.  
  276. You may be wondering what the formats listed in ./Makefile are.  Here is
  277. a brief description:
  278.  
  279. tex:
  280.         from plain.tex; described in the TeXbook.  The Makefile also
  281.         installs tex.fmt as plain.fmt, so that the constructions
  282.         described in the TeXbook will work.  Canonical source is
  283.         labrea.stanford.edu.
  284. latex:
  285.     from lplain.tex and latex.tex; described in the LaTeX manual,
  286.         by Leslie Lamport, published by Addison-Wesley.  Best
  287.         source is rusmv1.rus.uni-stuttgart.de.
  288. slitex:
  289.     LaTeX for making slides; also described in the LaTeX manual.
  290. texinfo:
  291.     from texinfo.tex; almost-completely logical markup (much more so
  292.         than LaTeX); can be translated into an Info document, which is
  293.         readable online.  Described in documentation that comes with the
  294.         macros.  Canonical source is prep.ai.mit.edu.
  295. amstex:
  296.         from amstex.tex; especially for mathematical papers; described
  297.         in the Joy of TeX, by Michael Spivak, published by the American
  298.         Mathematical Society.  Canonical source is e-math.ams.com.
  299. amslatex:
  300.     a combination of AMSTeX and LaTeX; incompatible with the
  301.         original LaTeX, because it uses Mittelbach and Schoepf's ``new
  302.         font selection scheme''.  Described in documentation that comes
  303.         with the macros.  Canonical source is e-math.ams.com.
  304. etex:
  305.         from eplain.tex; macros for common facilities that plain does
  306.         not have, e.g., symbolic cross-referencing.  Described in
  307.         documentation that comes with the macros.  Canonical source is
  308.         ftp.cs.umb.edu.
  309. inrstex:
  310.     from inrstex.tex; an alternative to LaTeX, with excellent
  311.         support for non-English supports.  Described in documentation
  312.         that comes with the macros.  Canonical source is
  313.         aldebaran.ee.mcgill.ca.
  314. picplus:
  315.         from picplus.tex; helps to make pictures; described in the
  316.         PiCTeX manual, by Michael Wichura, published by the TeX Users
  317.         Group.
  318.  
  319. You can get more information about these packages and order the manuals
  320. from tug@math.ams.org.
  321.  
  322.  
  323.  
  324. Directory hierarchies
  325. %%%%%%%%%%%%%%%%%%%%%
  326.  
  327. TeX and its friends use many different sorts of files: fonts, macros,
  328. format dumps, pool files, etc.  When you install TeX, you have to decide
  329. how everything should be organized.
  330.  
  331. The most painful thing to organize is the fonts.  There are both the
  332. .tfm files, which TeX and some DVI-readers need, and the PXL/GF/PK
  333. files, one for each point size and resolution, which only the
  334. DVI-readers look at.  Here are some of the common approaches:
  335.  
  336. 1) Put everything in one directory, say /usr/local/lib/tex/fonts. 
  337. Advantages: it's simple; everything is together; it's easy to tell if a
  338. particular file exists.  Disadvantage: the directory is huge.
  339.  
  340. 2) Put each set of pixel files at a given resolution (i.e.,
  341. magnification) in a different directory, and put the TFM files in
  342. another directory.  Advantage: the directories are smaller. 
  343. Disadvantage: the files for any given typeface are not together.
  344.  
  345. 3) Put each typeface family in a different subdirectory; e.g., have
  346. subdirectories `cm' (Computer Modern), `pandora', `euler', etc.
  347. Advantage: the files for a given typeface are together.  Disadvantage:
  348. many DVI-readers will not automatically look in subdirectories of
  349. TEXFONTS.  However, dvips (perhaps the most widely used
  350. dvi-to-PostScript translator), and xdvi (a previewer running under X11)
  351. both know how to search subdirectories, and I've modified them to use
  352. the same algorithm as TeX and friends; my modified versions are on
  353. ftp.cs.umb.edu:pub/tex.
  354.  
  355. See tex.man for more details on path searching.
  356.  
  357.  
  358.  
  359. Online output from Metafont
  360. %%%%%%%%%%%%%%%%%%%%%%%%%%%
  361.  
  362. Metafont in C can be compiled to support multiple window systems.  You
  363. say which you want via definitions in `c-auto.h.in'.
  364.  
  365. There are two versions of the X11 support in mf/MFwindow.  One is based
  366. on Xt, one on Xlib.  The Xt version is faster and has more
  367. functionality, so if it works on your system, you should use it.  It is
  368. the default.  But if it fails, you can try the Xlib version.
  369.  
  370. There are also two versions of the Sun support in mf/MFwindow.  One is
  371. based on Sunview, the other on Suntools (i.e., the gfx_hs structure).
  372. The former has more functionality, and it works on recent versions of
  373. SunOS, so it is the default.
  374.  
  375. Defining more devices is fairly straightforward.  A file should be put
  376. in mf/MFwindow to support the actual interface routines, all of which
  377. are described in the Metafont source.  Then you need to add another
  378. entry to the tables in `mf/extra.c'; that should be it.
  379.  
  380.  
  381.  
  382. Porting and portability
  383. %%%%%%%%%%%
  384.  
  385. The C code generated by the web2c translator is intended to be as
  386. portable as possible.  If you find bugs or portability problems with the
  387. generated code, report them to karl@cs.umb.edu.
  388.  
  389. The generated code assumes that the type `short' has at least the range
  390. -32768..32767, and that `unsigned short' has at least the range
  391. 0..65535.  If this isn't the case, the translator will have to be modified.
  392.  
  393. Since the code is generated automatically, it is foolish to edit it by
  394. hand.  Instead, you should fix the `web2c' program, or perhaps add
  395. commands to the `convert' scripts.  (And you should also send your
  396. changes to karl@cs.umb.edu.)
  397.  
  398. On another front, the `convert' scripts assume some basic Unix
  399. utilities: basename, cat, cp, diff, ln, make, mv, rm, sed, and touch.
  400. The Bourne shell is also assumed.  If your system versions are broken,
  401. you can try the GNU versions, available by anonymous ftp from
  402. prep.ai.mit.edu in pub/gnu, among many other places.  The GNU C compiler
  403. is also better (more reliable, faster, and produces better code) than
  404. many other C compilers, so you might want to get that.  For more
  405. information about the GNU project, write to gnu@prep.ai.mit.edu.
  406.