1TEX(1) General Commands Manual TEX(1)
2
3
4
6 tex, virtex, initex - text formatting and typesetting
7
9 tex [options] [& format ] [ file | \ commands ]
10
12 Run the TeX typesetter on file, usually creating file.dvi. If the file
13 argument has no extension, ".tex" will be appended to it. Instead of a
14 filename, a set of TeX commands can be given, the first of which must
15 start with a backslash. With a &format argument TeX uses a different
16 set of precompiled commands, contained in format.fmt; it is usually
17 better to use the -fmt format option instead.
18
19 TeX formats the interspersed text and commands contained in the named
20 files and outputs a typesetter independent file (called DVI, which is
21 short for DeVice Independent). TeX's capabilities and language are
22 described in The TeX for nroffbook. TeX is normally used with a large
23 body of precompiled macros, and there are several specific formatting
24 systems, such as LaTeX, which require the support of several macro
25 files.
26
27 This version of TeX looks at its command line to see what name it was
28 called under. If they exist, then both initex and virtex are symbolic
29 links to the tex executable. When called as initex (or when the -ini
30 option is given) it can be used to precompile macros into a .fmt file.
31 When called as virtex it will use the plain format. When called under
32 any other name, TeX will use that name as the name of the format to
33 use. For example, when called as tex the tex format is used, which is
34 identical to the plain format. The commands defined by the plain for‐
35 mat are documented in The TeX for nroffbook. Other formats that are
36 often available include latex and amstex.
37
38 The non-option command line arguments to the TeX program are passed to
39 it as the first input line. (But it is often easier to type extended
40 arguments as the first input line, since UNIX shells tend to gobble up
41 or misinterpret TeX's favorite symbols, like backslashes, unless you
42 quote them.) As described in The TeX for nroffbook, that first line
43 should begin with a filename, a \controlsequence, or a &formatname.
44
45 The normal usage is to say
46 tex paper
47 to start processing paper.tex. The name paper will be the ``jobname'',
48 and is used in forming output filenames. If TeX doesn't get a filename
49 in the first line, the jobname is texput. When looking for a file, TeX
50 looks for the name with and without the default extension (.tex)
51 appended, unless the name already contains that extension. If paper is
52 the ``jobname'', a log of error messages, with rather more detail than
53 normally appears on the screen, will appear in paper.log, and the out‐
54 put file will be in paper.dvi.
55
56 This version of TeX can look in the first line of the file paper.tex to
57 see if it begins with the magic sequence %&. If the first line begins
58 with %&format -translate-file tcxname then TeX will use the named for‐
59 mat and transation table tcxname to process the source file. Either
60 the format name or the -translate-file specification may be omitted,
61 but not both. This overrides the format selection based on the name by
62 which the program is invoked. The -parse-first-line option or the
63 parse_first_line configuration variable controls whether this behaviour
64 is enabled.
65
66 The e response to TeX's error prompt causes the system default editor
67 to start up at the current line of the current file. The environment
68 variable TEXEDIT can be used to change the editor used. It may contain
69 a string with "%s" indicating where the filename goes and "%d" indicat‐
70 ing where the decimal line number (if any) goes. For example, a
71 TEXEDIT string for emacs can be set with the sh command
72 TEXEDIT="emacs +%d %s"; export TEXEDIT
73
74 A convenient file in the library is null.tex, containing nothing. When
75 TeX can't find a file it thinks you want to input, it keeps asking you
76 for another filename; responding `null' gets you out of the loop if you
77 don't want to input anything. You can also type your EOF character
78 (usually control-D).
79
81 This version of TeX understands the following command line options.
82
83 -enc Enable the encTeX extensions. This option is only effective in
84 combination with -ini. For documentation of the encTeX exten‐
85 sions see http://www.olsak.net/enctex.html.
86
87 -file-line-error
88 Print error messages in the form file:line:error which is simi‐
89 lar to the way many compilers format them.
90
91 -no-file-line-error
92 Disable printing error messages in the file:line:error style.
93
94 -file-line-error-style
95 This is the old name of the -file-line-error option.
96
97 -fmt format
98 Use format as the name of the format to be used, instead of the
99 name by which TeX was called or a %& line.
100
101 -halt-on-error
102 Exit with an error code when an error is encountered during pro‐
103 cessing.
104
105 -help Print help message and exit.
106
107 -ini Start in INI mode, which is used to dump formats. The INI mode
108 can be used for typesetting, but no format is preloaded, and
109 basic initializations like setting catcodes may be required.
110
111 -interaction mode
112 Sets the interaction mode. The mode can be either batchmode,
113 nonstopmode, scrollmode, and errorstopmode. The meaning of
114 these modes is the same as that of the corresponding \commands.
115
116 -ipc Send DVI output to a socket as well as the usual output file.
117 Whether this option is available is the choice of the installer.
118
119 -ipc-start
120 As -ipc, and starts the server at the other end as well.
121 Whether this option is available is the choice of the installer.
122
123 -jobname name
124 Use name for the job name, instead of deriving it from the name
125 of the input file.
126
127 -kpathsea-debug bitmask
128 Sets path searching debugging flags according to the bitmask.
129 See the Kpathsea manual for details.
130
131 -mktex fmt
132 Enable mktexfmt, where fmt must be either tex or tfm.
133
134 -mltex Enable MLTeX extensions. Only effective in combination with
135 -ini.
136
137 -no-mktex fmt
138 Disable mktexfmt, where fmt must be either tex or tfm.
139
140 -output-comment string
141 Use string for the DVI file comment instead of the date.
142
143 -output-directory directory
144 Write output files in directory instead of the current direc‐
145 tory. Look up input files in directory first, then along the
146 normal search path. See also description of the TEXMFOUTPUT
147 environment variable.
148
149 -parse-first-line
150 If the first line of the main input file begins with %& parse it
151 to look for a dump name or a -translate-file option.
152
153 -no-parse-first-line
154 Disable parsing of the first line of the main input file.
155
156 -progname name
157 Pretend to be program name. This affects both the format used
158 and the search paths.
159
160 -recorder
161 Enable the filename recorder. This leaves a trace of the files
162 opened for input and output in a file with extension .fls.
163
164 -shell-escape
165 Enable the \write18{command} construct. The command can be any
166 shell command. This construct is normally disallowed for secu‐
167 rity reasons.
168
169 -no-shell-escape
170 Disable the \write18{command} construct, even if it is enabled
171 in the texmf.cnf file.
172
173 -src-specials
174 Insert source specials into the DVI file.
175
176 -src-specials where
177 Insert source specials in certain places of the DVI file. where
178 is a comma-separated value list: cr, display, hbox, math, par,
179 parent, or vbox.
180
181 -translate-file tcxname
182 Use the tcxname translation table to set the mapping of input
183 characters and re-mapping of output characters.
184
185 -default-translate-file tcxname
186 Like -translate-file except that a %& line can overrule this
187 setting.
188
189 -version
190 Print version information and exit.
191
193 See the Kpathsearch library documentation (the `Path specifications'
194 node) for precise details of how the environment variables are used.
195 The kpsewhich utility can be used to query the values of the variables.
196
197 One caveat: In most TeX formats, you cannot use ~ in a filename you
198 give directly to TeX, because ~ is an active character, and hence is
199 expanded, not taken as part of the filename. Other programs, such as
200 Metafont, do not have this problem.
201
202 TEXMFOUTPUT
203 Normally, TeX puts its output files in the current directory.
204 If any output file cannot be opened there, it tries to open it
205 in the directory specified in the environment variable TEXMFOUT‐
206 PUT. There is no default value for that variable. For example,
207 if you say tex paper and the current directory is not writable,
208 if TEXMFOUTPUT has the value /tmp, TeX attempts to create
209 /tmp/paper.log (and /tmp/paper.dvi, if any output is produced.)
210
211 TEXINPUTS
212 Search path for \input and \openin files. This should probably
213 start with ``.'', so that user files are found before system
214 files. An empty path component will be replaced with the paths
215 defined in the texmf.cnf file. For example, set TEXINPUTS to
216 ".:/home/usr/tex:" to prepend the current direcory and
217 ``/home/user/tex'' to the standard search path.
218
219 TEXFORMATS
220 Search path for format files.
221
222 TEXPOOL
223 search path for tex internal strings.
224
225 TEXEDIT
226 Command template for switching to editor. The default, usually
227 vi, is set when TeX is compiled.
228
229 TFMFONTS
230 Search path for font metric (.tfm) files.
231
233 The location of the files mentioned below varies from system to system.
234 Use the kpsewhich utility to find their locations.
235
236 texmf.cnf
237 Configuration file. This contains definitions of search paths
238 as well as other configuration parameters like parse_first_line.
239
240 tex.pool
241 Text file containing TeX's internal strings.
242
243 texfonts.map
244 Filename mapping definitions.
245
246 *.tfm Metric files for TeX's fonts.
247
248 *.fmt Predigested TeX format (.fmt) files.
249
250 $TEXMFMAIN/tex/plain/base/plain.tex
251 The basic macro package described in the TeX for nroffbook.
252
254 This manual page is not meant to be exhaustive. The complete documen‐
255 tation for this version of TeX can be found in the info manual Web2C: A
256 TeX implementation.
257
259 This version of TeX implements a number of optional extensions. In
260 fact, many of these extensions conflict to a greater or lesser extent
261 with the definition of TeX. When such extensions are enabled, the ban‐
262 ner printed when TeX starts is changed to print TeXk instead of TeX.
263
264 This version of TeX fails to trap arithmetic overflow when dimensions
265 are added or subtracted. Cases where this occurs are rare, but when it
266 does the generated DVI file will be invalid.
267
269 mf(1),
270 Donald E. Knuth, The TeX for nroffbook, Addison-Wesley, 1986, ISBN
271 0-201-13447-0.
272 Leslie Lamport, LaTeX - A Document Preparation System, Addison-Wesley,
273 1985, ISBN 0-201-15790-X.
274 K. Berry, Eplain: Expanded plain TeX,
275 ftp://ftp.cs.umb.edu/pub/tex/eplain/doc.
276 Michael Spivak, The Joy of TeX for nroff, 2nd edition, Addison-Wesley,
277 1990, ISBN 0-8218-2997-1.
278 TUGboat (the journal of the TeX Users Group).
279
281 TeX, pronounced properly, rhymes with ``blecchhh.'' The proper spell‐
282 ing in typewriter-like fonts is ``TeX'' and not ``TEX'' or ``tex.''
283
285 TeX was designed by Donald E. Knuth, who implemented it using his Web
286 system for Pascal programs. It was ported to Unix at Stanford by
287 Howard Trickey, and at Cornell by Pavel Curtis. The version now
288 offered with the Unix TeX distribution is that generated by the Web to
289 C system (web2c), originally written by Tomas Rokicki and Tim Morgan.
290
291 The encTeX extensions were written by Petr Olsak.
292
293
294
295Web2C 7.5.6 6 December 2006 TEX(1)