1TEX(1)                      General Commands Manual                     TEX(1)
2
3
4

NAME

6       tex, virtex, initex - text formatting and typesetting
7

SYNOPSIS

9       tex [options] [& format ] [ file | \ commands ]
10

DESCRIPTION

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

OPTIONS

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              directory instead of the current directory.  Look up input files
145              in directory first, the along the normal search path.
146
147       -parse-first-line
148              If the first line of the main input file begins with %& parse it
149              to look for a dump name or a -translate-file option.
150
151       -no-parse-first-line
152              Disable parsing of the first line of the main input file.
153
154       -progname name
155              Pretend to be program name.  This affects both the  format  used
156              and the search paths.
157
158       -recorder
159              Enable  the filename recorder.  This leaves a trace of the files
160              opened for input and output in a file with extension .fls.
161
162       -shell-escape
163              Enable the \write18{command} construct.  The command can be  any
164              shell  command.  This construct is normally disallowed for secu‐
165              rity reasons.
166
167       -no-shell-escape
168              Disable the \write18{command} construct, even if it  is  enabled
169              in the texmf.cnf file.
170
171       -src-specials
172              Insert source specials into the DVI file.
173
174       -src-specials where
175              Insert source specials in certain places of the DVI file.  where
176              is a comma-separated value list: cr, display, hbox,  math,  par,
177              parent, or vbox.
178
179       -translate-file tcxname
180              Use  the  tcxname  translation table to set the mapping of input
181              characters and re-mapping of output characters.
182
183       -default-translate-file tcxname
184              Like -translate-file except that a %&  line  can  overrule  this
185              setting.
186
187       -version
188              Print version information and exit.
189

ENVIRONMENT

191       See  the  Kpathsearch  library documentation (the `Path specifications'
192       node) for precise details of how the environment  variables  are  used.
193       The kpsewhich utility can be used to query the values of the variables.
194
195       One  caveat:  In  most  TeX formats, you cannot use ~ in a filename you
196       give directly to TeX, because ~ is an active character,  and  hence  is
197       expanded,  not  taken as part of the filename.  Other programs, such as
198       Metafont, do not have this problem.
199
200       TEXMFOUTPUT
201              Normally, TeX puts its output files in  the  current  directory.
202              If  any  output file cannot be opened there, it tries to open it
203              in the directory specified in the environment variable TEXMFOUT‐
204              PUT.  There is no default value for that variable.  For example,
205              if you say tex paper and the current directory is not  writable,
206              if  TEXMFOUTPUT  has  the  value  /tmp,  TeX  attempts to create
207              /tmp/paper.log (and /tmp/paper.dvi, if any output is produced.)
208
209       TEXINPUTS
210              Search path for \input and \openin files.  This should  probably
211              start  with  ``.'',  so  that user files are found before system
212              files.  An empty path component will be replaced with the  paths
213              defined  in  the  texmf.cnf file.  For example, set TEXINPUTS to
214              ".:/home/usr/tex:"  to  prepend   the   current   direcory   and
215              ``/home/user/tex'' to the standard search path.
216
217       TEXFORMATS
218              Search path for format files.
219
220       TEXPOOL
221              search path for tex internal strings.
222
223       TEXEDIT
224              Command  template for switching to editor.  The default, usually
225              vi, is set when TeX is compiled.
226
227       TFMFONTS
228              Search path for font metric (.tfm) files.
229

FILES

231       The location of the files mentioned below varies from system to system.
232       Use the kpsewhich utility to find their locations.
233
234       texmf.cnf
235              Configuration  file.   This contains definitions of search paths
236              as well as other configuration parameters like parse_first_line.
237
238       tex.pool
239              Text file containing TeX's internal strings.
240
241       texfonts.map
242              Filename mapping definitions.
243
244       *.tfm  Metric files for TeX's fonts.
245
246       *.fmt  Predigested TeX format (.fmt) files.
247
248       $TEXMFMAIN/tex/plain/base/plain.tex
249              The basic macro package described in the TeX for nroffbook.
250

NOTES

252       This manual page is not meant to be exhaustive.  The complete  documen‐
253       tation for this version of TeX can be found in the info manual Web2C: A
254       TeX implementation.
255

BUGS

257       This version of TeX implements a number  of  optional  extensions.   In
258       fact,  many  of these extensions conflict to a greater or lesser extent
259       with the definition of TeX.  When such extensions are enabled, the ban‐
260       ner printed when TeX starts is changed to print TeXk instead of TeX.
261
262       This  version  of TeX fails to trap arithmetic overflow when dimensions
263       are added or subtracted.  Cases where this occurs are rare, but when it
264       does the generated DVI file will be invalid.
265

SEE ALSO

267       mf(1),
268       Donald  E.  Knuth,  The  TeX  for nroffbook, Addison-Wesley, 1986, ISBN
269       0-201-13447-0.
270       Leslie Lamport, LaTeX - A Document Preparation System,  Addison-Wesley,
271       1985, ISBN 0-201-15790-X.
272       K.        Berry,        Eplain:        Expanded        plain       TeX,
273       ftp://ftp.cs.umb.edu/pub/tex/eplain/doc.
274       Michael Spivak, The Joy of TeX for nroff, 2nd edition,  Addison-Wesley,
275       1990, ISBN 0-8218-2997-1.
276       TUGboat (the journal of the TeX Users Group).
277

TRIVIA

279       TeX,  pronounced properly, rhymes with ``blecchhh.''  The proper spell‐
280       ing in typewriter-like fonts is ``TeX'' and not ``TEX'' or ``tex.''
281

AUTHORS

283       TeX was designed by Donald E. Knuth, who implemented it using  his  Web
284       system  for  Pascal  programs.   It  was  ported to Unix at Stanford by
285       Howard Trickey, and at  Cornell  by  Pavel  Curtis.   The  version  now
286       offered  with the Unix TeX distribution is that generated by the Web to
287       C system (web2c), originally written by Tomas Rokicki and Tim Morgan.
288
289       The encTeX extensions were written by Petr Olsak.
290
291
292
293Web2C 7.5.4                     21 August 2004                          TEX(1)
Impressum