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

NAME

6       tex, 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  TeXbook.  TeX is normally used with a large body of
23       precompiled macros, and there are several specific formatting  systems,
24       such as LaTeX, which require the support of several macro files.
25
26       This  version  of TeX looks at its command line to see what name it was
27       called under.  If they exist, then both initex and virtex are  symbolic
28       links  to  the tex executable.  When called as initex (or when the -ini
29       option is given) it can be used to precompile macros into a .fmt  file.
30       When  called as virtex it will use the plain format.  When called under
31       any other name, TeX will use that name as the name  of  the  format  to
32       use.   For example, when called as tex the tex format is used, which is
33       identical to the plain format.  The commands defined by the plain  for‐
34       mat are documented in The TeXbook.  Other formats that are often avail‐
35       able include latex and amstex.
36
37       The non-option command line arguments to the TeX program are passed  to
38       it  as  the first input line.  (But it is often easier to type extended
39       arguments as the first input line, since UNIX shells tend to gobble  up
40       or  misinterpret  TeX's  favorite symbols, like backslashes, unless you
41       quote them.)  As described in The TeXbook, that first line should begin
42       with a filename, a \controlsequence, or a &formatname.
43
44       The normal usage is to say
45       tex paper
46       to start processing paper.tex.  The name paper will be the ``jobname'',
47       and is used in forming output filenames.  If TeX doesn't get a filename
48       in the first line, the jobname is texput.  When looking for a file, TeX
49       looks for the name  with  and  without  the  default  extension  (.tex)
50       appended, unless the name already contains that extension.  If paper is
51       the ``jobname'', a log of error messages, with rather more detail  than
52       normally  appears on the screen, will appear in paper.log, and the out‐
53       put file will be in paper.dvi.
54
55       This version of TeX can look in the first line of the file paper.tex to
56       see  if it begins with the magic sequence %&.  If the first line begins
57       with %&format -translate-file tcxname then TeX will use the named  for‐
58       mat  and  translation table tcxname to process the source file.  Either
59       the format name or the -translate-file specification  may  be  omitted,
60       but not both.  This overrides the format selection based on the name by
61       which the program is invoked.   The  -parse-first-line  option  or  the
62       parse_first_line configuration variable controls whether this behaviour
63       is enabled.
64
65       The e response to TeX's error prompt causes the system  default  editor
66       to  start  up at the current line of the current file.  The environment
67       variable TEXEDIT can be used to change the editor used.  It may contain
68       a string with "%s" indicating where the filename goes and "%d" indicat‐
69       ing where the decimal line  number  (if  any)  goes.   For  example,  a
70       TEXEDIT string for emacs can be set with the sh command
71       TEXEDIT="emacs +%d %s"; export TEXEDIT
72
73       A convenient file in the library is null.tex, containing nothing.  When
74       TeX can't find a file it thinks you want to input, it keeps asking  you
75       for another filename; responding `null' gets you out of the loop if you
76       don't want to input anything.  You can also  type  your  EOF  character
77       (usually control-D).
78

OPTIONS

80       This version of TeX understands the following command line options.
81
82       -enc   Enable  the encTeX extensions.  This option is only effective in
83              combination with -ini.  For documentation of the  encTeX  exten‐
84              sions see http://www.olsak.net/enctex.html.
85
86       -file-line-error
87              Print  error messages in the form file:line:error which is simi‐
88              lar to the way many compilers format them.
89
90       -no-file-line-error
91              Disable printing error messages in the file:line:error style.
92
93       -file-line-error-style
94              This is the old name of the -file-line-error option.
95
96       -fmt format
97              Use format as the name of the format to be used, instead of  the
98              name by which TeX was called or a %& line.
99
100       -halt-on-error
101              Exit with an error code when an error is encountered during pro‐
102              cessing.
103
104       -help  Print help message and exit.
105
106       -ini   Start in INI mode, which is used to dump formats.  The INI  mode
107              can  be  used  for  typesetting, but no format is preloaded, and
108              basic initializations like setting catcodes may be required.
109
110       -interaction mode
111              Sets the interaction mode.  The mode can  be  either  batchmode,
112              nonstopmode,  scrollmode,  and  errorstopmode.   The  meaning of
113              these modes is the same as that of the corresponding \commands.
114
115       -ipc   Send DVI output to a socket as well as the  usual  output  file.
116              Whether this option is available is the choice of the installer.
117
118       -ipc-start
119              As  -ipc,  and  starts  the  server  at  the  other end as well.
120              Whether this option is available is the choice of the installer.
121
122       -jobname name
123              Use name for the job name, instead of deriving it from the  name
124              of the input file.
125
126       -kpathsea-debug bitmask
127              Sets  path  searching  debugging flags according to the bitmask.
128              See the Kpathsea manual for details.
129
130       -mktex fmt
131              Enable mktexfmt, where fmt must be either tex or tfm.
132
133       -mltex Enable MLTeX extensions.  Only  effective  in  combination  with
134              -ini.
135
136       -no-mktex fmt
137              Disable mktexfmt, where fmt must be either tex or tfm.
138
139       -output-comment string
140              Use string for the DVI file comment instead of the date.
141
142       -output-directory directory
143              Write  output  files  in directory instead of the current direc‐
144              tory.  Look up input files in directory first,  then  along  the
145              normal  search  path.   See  also description of the TEXMFOUTPUT
146              environment variable.
147
148       -parse-first-line
149              If the first line of the main input file begins with %& parse it
150              to look for a dump name or a -translate-file option.
151
152       -no-parse-first-line
153              Disable parsing of the first line of the main input file.
154
155       -progname name
156              Pretend  to  be program name.  This affects both the format used
157              and the search paths.
158
159       -recorder
160              Enable the filename recorder.  This leaves a trace of the  files
161              opened for input and output in a file with extension .fls.
162
163       -shell-escape
164              Enable  the \write18{command} construct.  The command can be any
165              shell command.  This construct is normally disallowed for  secu‐
166              rity reasons.
167
168       -no-shell-escape
169              Disable  the  \write18{command} construct, even if it is enabled
170              in the texmf.cnf file.
171
172       -src-specials
173              Insert source specials into the DVI file.
174
175       -src-specials where
176              Insert source specials in certain places of the DVI file.  where
177              is  a  comma-separated value list: cr, display, hbox, math, par,
178              parent, or vbox.
179
180       -translate-file tcxname
181              Use the tcxname translation table to set the  mapping  of  input
182              characters and re-mapping of output characters.
183
184       -default-translate-file tcxname
185              Like  -translate-file  except  that  a %& line can overrule this
186              setting.
187
188       -version
189              Print version information and exit.
190

ENVIRONMENT

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

FILES

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

NOTES

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

BUGS

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

SEE ALSO

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

TRIVIA

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

AUTHORS

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