.TH TEX 1 .SH NAME tex, latex, slitex, bibtex, dvips, dviselect, mf, mktexlsr \- text formatting and typesetting .SH SYNOPSIS .B tex [ .I first-line ] .PP .B latex .IR file [.tex] .PP .B slitex [ .I first-line ] .PP .B dvips [ .I option ... ] .I dvifile .PP .B dviselect [ .B -s ] [ .B -i .I infile ] [ .B -o .I outfile ] .I "list of pages" [ .I infile [ .I outfile ] ] .PP .B bibtex .I auxname .PP .B mf [ .I first-line ] .PP .B mktexlsr .SH DESCRIPTION .I Tex formats interspersed text and commands and outputs a .B .dvi (`device independent') file. .PP An argument given on the command line behaves as the first input line. That line should begin with a (possibly truncated) file name or a .IR \econtrolsequence . Thus .B tex paper processes the file .BR paper.tex . The base name of .B paper becomes the .IR jobname , and is used in forming output file names. If no file is named, the jobname is .BR texput . The default .B .tex extension can be overridden by specifying an extension explicitly. .PP The output is written on .IB jobname .dvi\f1, which can be printed using .IR lp (1). A log of error messages goes into .IB jobname .log\f1. .PP As well as the standard TeX fonts, many PostScript fonts can be used (see the contents of .BR /sys/lib/tex/fonts/psvf ). The file .B testfont.tex (in the standard macro directory) will print a table of any font. .PP The following environment variables adjust the behavior of .IR tex . Search paths are lists of directories separated by colons. The wildcard .B // may expand to any path, so .B /sys/lib/texmf// means the entire tree rooted at .BR /sys/lib/texmf , and .B /usr//lib includes any directories named .B lib that sit anywhere under .BR /usr . Finally, braces may be used to specify alternatives, so that .B /a/{b:c}/d means .B /a/b/d or .BR /a/c/d . .PP If a directory contains a file called .BR ls-R , that file is used as an index of the hierarchy rooted there. These files may be created with .B mktexlsr (see below) If a sought file is not found in an .B ls-R listing, it is searched for by walking the directory or directory hierarchy as specified. If the path begins with .BR !! , the search is constrained to only look in the .B ls-R and not walk the hierarchy. Thus .B !!/sys/lib/texmf// means the entire tree rooted at .BR /sys/lib/texmf , but only consulting .B /sys/lib/texmf/ls-R to search for files. .TF .TP .B TEXINPUTS Search path for .B \einput and .B \eopenin files. It should be colon-separated, and start with dot. Default: .B .:$home/lib/tex:!!/sys/lib/texmf/tex// .TP .B TFMFONTS Search path for font metric files. Default: .B .:!!/sys/lib/texmf/tex/fonts//tfm// .TP .B PKFONTS Search path for font bitmaps. Default: .B .:!!/sys/lib/texmf/fonts//pk// .TP .B TEXFORMATS Search path for program format files. Default: .B .:!!/sys/lib/texmf/web2c .TP .B TEXPOOL Search path for strings. Default: .B .:!!/sys/lib/texmf/web2c .TP .B TEXEDIT Template for the switch-to-editor-on-error option, with .B %s for the file name and .B %d for the line number. Default: .B /bin/ed %s .TP .B MFINPUTS Search path for Metafont input files. Default: .br .B .:!!/sys/lib/texmf/metafont//:!!/sys/lib/texmf/fonts//source// .TP .B MPINPUTS Search path for MetaPost input files. Default: .B .:!!/sys/lib/texmf/metapost// .PD .PP .I Slitex is a version of .I tex that is preloaded with a set of macros useful for creating viewgraphs. .PP .I Latex is a version of .I tex with a standard set of macros loaded. .I Latex produces .IB file .dvi and a cross-referencing file, .IB file .aux\f1. It might be necessary to run .I latex twice, to get all of the cross-referencing done properly. .PP .I Bibtex is a bibliography processing program, often used in conjunction with .IR latex . .I Bibtex reads the top-level auxiliary .RB ( .aux ) file output by .I latex and creates a bibliography .RB ( .bbl ) file to be included in the LaTeX source file. The .I auxname on the command line should be given without an extension. Each .B \ecite in the source file is looked up in bibliography files to gather together those used in the document. Then a bibliography style file is executed to write a .B \ethebibliography environment. .PP The source file should have defined the bibliography .RB ( .bib ) files to search with the .B \ebibliography command, and the bibliography style .RB ( .bst ) file to execute with the .B \ebibliographystyle command. .I Bibtex searches the .B TEXINPUTS path for .BR .bst files, and the .B BIBINPUTS path (default .BR .:!!/sys/lib/texmf/bibtex// ) for .B .bst files. The LaTeX manual describes how to make bibliography files. .PP .I Dvips converts .B .dvi files to PostScript, writing the result on standard output. It is normally invoked by .IR lp (1), but if invoked separately, the following options are useful: .TP "\w'\fL-P\fP \fIdev\fLXX'u" .B -r reverse pages. .B -r0 means don't reverse pages (if reversing is default). .TP .B -q0 Enable verbose chatter on standard error. .TP .BI -P dev output device: .I dev is one of .B ps (default for .IR dvips ), .BR psfonts , or .BR bitmapfonts . The .B ps device uses PostScript fonts wherever possible, quickly creating small documents that are not very portable (since most sites and printers don't have the necessary PostScript fonts installed). The .B psfonts device includes all necessary fonts in the files, and thus quickly creates large portable documents. These are especially good for distilling (see .IR distill (1)) into PDF. The .B bitmapfonts device behaves in the manner most common in other .I tex installations: it creates bitmap versions of each font and includes them in the document, resulting in portable yet medium sized documents that don't convert well to PDF. If the bitmap fonts needed do not exist, they will be created on the fly, which takes a fair bit of time. .TP .B -L print paper in landscape mode. .TP .B -Z compress the fonts before sending them. .TP .B -Z0 don't compress the fonts before sending them. .PP The following environment variables affect .IR dvips : .TF TEXVFONTS .TP .B PKFONTS Search path for font bitmaps (PK files). .TP .B VFFONTS Search path for virtual font descriptions. .PD .PP .I Dviselect selects pages from a .B .dvi file, creating a new .B .dvi file. A .I range is a string of the form .I first:last where both .I first and .I last are optional numeric strings, with negative numbers indicated by a leading underscore character .RB ( _ ). If both .I first and .I last are omitted, the colon may also be omitted, or may be replaced with an asterisk .RB ( * ). A .I TeX page selector is a list of pages separated by periods. A .I "list of pages" is described by a set of page TeX page selectors, separated by commas and/or white space. .I Dviselect actually looks at the ten .I count variables that TeX writes; the first of these (\e\fLcount0\fP) is the page number, with \e\fLcount1\fP through \e\fLcount9\fP having varied uses depending on which macro packages are in use. (Typically \e\fLcount1\fP is a chapter or section number.) A page is included in .IR dviselect 's output if all its \ecount values are within any one of the ranges listed on the command line. For example, the command .L "dviselect *.1,35:" might select everything in chapter 1, as well as pages 35 and up. .PP Instead of \e\fLcount\fP values, .I dviselect can also select by absolute page number, indicated by a leading equal sign .RB ( = ). Ranges of absolute pages are also allowed: .L "dviselect =3:7" will extract the third through seventh pages. .PP .I Dvips understands some extended graphics commands that can be output using .I "tpic specials" in the TeX source. Many of them work by building up a path of .I x,y pairs, and then doing something with the path. The tpic coordinate system has its origin at the current dvi position when a drawing special is emitted; all length arguments are in units of milli-inches, and the y-axis goes positive downward. .TP .BI "\especial{pa " "x y" } Add .I x,y to the current path. .TP .B "\especial{fp} Flush the current path: draw it as a polygonal line and reset the path to be empty. .TP .BI "\especial{da " dlen } Like .B fp but draw dashed line, with dashes .I dlen milli-inches long. .TP .BI "\especial{dt " slen } Like .B fp but draw a dotted line, with dots .I slen apart. .TP .B "\especial{sp}" Like .B fp but draw a quadratic spline. The spline goes through the midpoints of the segments of the path, and straight pieces extend it to the endpoints. .TP .BI "\especial{ar " "x y xr yr s e" } Draw a circular or elliptical arc with center at .I x,y and radii .IR xr " and " yr . The arc goes clockwise from angle .I s to angle .I e (angles measured clockwise from the positive x-axis). .TP .BI "\especial{pn " n } Set line width (pen diameter) to .IR n milli-inches. .TP .B "\especial{bk}" Set shading to black (will fill the next object drawn with black). .TP .B "\especial{sh}" Set shading to grey. .TP .B "\especial{wh}" Set shading to white. .TP .BI "\especial{psfile=" "file options" } Include .IR file , which should be a PostScript illustration, making its origin be the current dvi position. The default PostScript transformation matrix will be in effect, but it can be modified by the .IR options , a list of space-separated .IR key = value assignments. Allowed keys are: hoffset, voffset, hscale, vscale, angle, If supplied, these values are supplied to PostScript .IR translate , scale ", and " rotate" commands, in that order. Also, keys hsize and vsize may be supplied, to cause clipping to those sizes. Sizes and offsets should be specified in points, angles should be specified in degrees. .PP All of the specials leave TeX at the same position on the page that it started in. .PP .I Mf runs metafont, a program that produces fonts for TeX. It is used by .I dvips when bitmaps for a given font at a given size do not exist. .PP .I Mktexlsr is used to generate .B ls-R files for quick path searching. It simulates the Unix command .RB `` "ls -LAR ." ''. .SH FILES .TP /sys/lib/texmf/web2c Directory containing files directly supporting the runtime environment of .IR "tex et al." , such as .B .mem and .B .pool files. .TP .B /sys/lib/texmf/web2c/texmf.cnf Configuration file listing the default search paths mentioned above. .TP .B /sys/lib/texmf/tex .I Tex macros. .TP .B /sys/lib/texmf/tex/latex .I Latex macros. .TP .B /sys/lib/texmf/tex/latex/local Locally installed .I latex macros. .TP .B /sys/lib/texmf/fonts Fonts, fonts, and more fonts. .TP .B /sys/lib/texmf/dvips Miscellaneous configuration files and PostScript headers .TP .B /sys/lib/texmf/doc Various documentation organized in the same manner as .BR /sys/lib/texmf . .TP .B "/sys/lib/texmf/bin/$objtype, /sys/lib/texmf/bin/rc Auxiliary programs, such as .IR mktexlsr , used by .I tex and friends. .SH SOURCE .B /sys/src/cmd/tex .SH "SEE ALSO" .IR lp (1), .IR mp (1), .IR page (1), .IR pic (1), .IR proof (1), .IR troff (1), .I delatex in .IR deroff (1) .br D. E. Knuth, .IR The TEXbook , Addison-Wesley, 1984 .br L. Lamport, .I LaTeX, A Document Preparation System, Addison-Wesley, 1985 .br H. Trickey, ``Latex User Guide'', .I Unix Research System Programmer's Manual, Tenth Edition, Volume 2. .br Various documents in .BR /sys/lib/texmf/doc . .SH BUGS Should be spelled τεχ. .br The path notation is bizarre.