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 translation 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              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

ENVIRONMENT

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              TEXMFOUTPUT is also checked for input files, as TeX often gener‐
211              ates files that need to be subsequently read; for input, no suf‐
212              fixes (such as ``.tex'') are added by default, the input name is
213              simply checked as given.
214
215       TEXINPUTS
216              Search path for \input and \openin files.  This  probably  start
217              with  ``.'',  so  that user files are found before system files.
218              An empty path component will be replaced with the paths  defined
219              in   the   texmf.cnf   file.   For  example,  set  TEXINPUTS  to
220              ".:/home/user/tex:"  to  prepend  the  current   directory   and
221              ``/home/user/tex'' to the standard search path.
222
223       TEXFORMATS
224              Search path for format files.
225
226       TEXPOOL
227              search path for tex internal strings.
228
229       TEXEDIT
230              Command  template for switching to editor.  The default, usually
231              vi, is set when TeX is compiled.
232
233       TFMFONTS
234              Search path for font metric (.tfm) files.
235

FILES

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

NOTES

258       This manual page is not meant to be exhaustive.  The complete  documen‐
259       tation for this version of TeX can be found in the info manual Web2C: A
260       TeX implementation.
261

BUGS

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

SEE ALSO

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

TRIVIA

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

AUTHORS

289       TeX was designed by Donald E. Knuth, who implemented it using  his  Web
290       system  for  Pascal  programs.   It  was  ported to Unix at Stanford by
291       Howard Trickey, and at  Cornell  by  Pavel  Curtis.   The  version  now
292       offered  with the Unix TeX distribution is that generated by the Web to
293       C system (web2c), originally written by Tomas Rokicki and Tim Morgan.
294
295       The encTeX extensions were written by Petr Olsak.
296
297
298
299Web2C 2012                       1 March 2011                           TEX(1)
Impressum