<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
                   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % entities.ent SYSTEM "entities.ent">
%entities.ent;
]>

<refentry id="miktex-tex">

<?dbhh topicname="MIKTEXHELP_TEX" topicid="0"?>

<refmeta>
<refentrytitle>miktex-tex</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="source">&PACKAGE_NAME;</refmiscinfo>
<refmiscinfo class="version">&miktexrev;</refmiscinfo>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>

<refnamediv>
<refname>miktex-tex</refname>
<refpurpose>text formatting and typesetting</refpurpose>
</refnamediv>

<refsynopsisdiv>

<cmdsynopsis>
&miktextex;
<arg choice="opt" rep="repeat"><replaceable>option</replaceable></arg>
<group>
<arg choice="opt"><replaceable>file</replaceable></arg>
<arg choice="opt" rep="repeat">\<replaceable>command</replaceable></arg>
</group></cmdsynopsis>

</refsynopsisdiv>

<refsect1>

<title>Description</title>

<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="_tlack.xml" />

<para>Run the &TeX; typesetter on <replaceable>file</replaceable>,
usually creating
<filename><replaceable>file</replaceable>.dvi</filename>.  If the file
argument has no extension, <filename>.tex</filename> will be appended
to it.  Instead of a filename, a set of &TeX; commands can be given,
the first of which must start with a backslash.  With a
<option>&amp;format</option> argument &TeX; uses a different set of
precompiled commands, contained in
<filename><replaceable>format</replaceable>.fmt</filename>; it is
usually better to use the
<option>-undump=<replaceable>format</replaceable></option> option
instead.</para>

<para>&TeX; formats the interspersed text and commands contained in
the named files and outputs a typesetter independent file (called
&DVI;, which is short for DeVice Independent).  &TeX;'s capabilities
and language are described in <citetitle>The &TeX;book</citetitle>.
&TeX; is normally used with a large body of precompiled macros, and
there are several specific formatting systems, such as &LaTeX;, which
require the support of several macro files.</para>

<para>This version of &TeX; looks at its command-line to see what name
it was called under.  Both &initex; and &virtex; are links to the
&miktextex; executable.  When called as &initex; (or when the
<option>-initialize</option> option is given) it can be used to
precompile macros into a <filename>.fmt</filename> file.  When called
as &virtex; it will use the plain format.  When called under any other
name, &TeX; will use that name as the name of the format to use.  For
example, when called as &miktextex; the <emphasis>tex</emphasis>
format is used, which is identical to the plain format.  The commands
defined by the plain format are documented in <citetitle>The
&TeX;book</citetitle>.  Other formats that are often available include
<emphasis>latex</emphasis> and <emphasis>amstex</emphasis>.</para>

<para>The non-option command line argiments to the &TeX; program are
passed to it as the first input line.  (But it is often easier to type
extended arguments as the first input line, since shells tend to
gobble up or misinterpret &TeX;'s favorite symbols, like backslashes,
unless you quote them.)  As described in <citetitle>The
&TeX;book</citetitle>, that first line should begin with a file name,
a <markup role="tex">\controlsequence</markup>, or a
&amp;<replaceable>formatname</replaceable>.</para>

<para>The normal usage is to say <userinput>&miktextex;
paper</userinput> to start processing <filename>paper.tex</filename>.
The name <emphasis>paper</emphasis> will be the
<quote>jobname</quote>, and is used in forming output file names.  If
&TeX; doesn't get a file name in the first line, the job name is
<filename>texput</filename>.  When looking for a file, &TeX; looks for
the name with and without the default extension
(<filename>.tex</filename>) appended, unless the name already contains
that extension.  If paper is the <quote>jobname</quote>, a log of
error messages, with rather more detail than normally appears on the
screen, will appear in <filename>paper.log</filename>, and the output
file will be in <filename>paper.dvi</filename>.</para>

<para>This version of &TeX; will look in the first line of the file
<filename>paper.tex</filename> to see if it begins with the magic
sequence <userinput>%&amp;</userinput>.  If the first line begins with
<userinput>%&amp;format --translate-file tcxname</userinput>, then
&TeX; will use the named format and transation table
<replaceable>tcxname</replaceable> to process the source file.  Either
the format name or the <option>--translate-file</option> specification
may be omitted, but not both. This overrides the format selection
based on the name by which the program is invoked. The
<option>-parse-first-line</option> option or the <parameter
class="option">parse_first_line</parameter> configuration value
controls whether this behaviour is enabled.</para>

<para>The <userinput>e</userinput> response to &TeX;'s error-recovery
prompt causes the default editor to start up at the current line of
the current file.  The configuration value <parameter
class="option">[Core]Editor</parameter> can be used to change the
editor used.  It may contain a string with <literal>%f</literal>
indicating where the file name goes and <literal>%l</literal>
indicating where the decimal line number (if any) goes. For example,
an <parameter class="option">[Core]Editor</parameter> string for
<command>emacs</command> can be set with the command
<screen><prompt>&prompt;</prompt><userinput>initexmf --set-config-value="[Core]Editor=emacs +%l %f"</userinput></screen>
</para>

<para>A convenient file is <filename>null.tex</filename>, containing
nothing.  When &TeX; can't find a file it thinks you want to input, it
keeps asking you for another file name; responding
<userinput>null</userinput> gets you out of the loop if you don't want
to input anything.  You can also type your <acronym>EOF</acronym>
character (usually <keycombo>
<keysym>Control</keysym>
<keysym>Z</keysym>
</keycombo>).</para>

</refsect1>

<refsect1>

<title>Options</title>

<variablelist>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/alias.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/auxdirectory.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/bufsize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/cstyleerrors.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/disable8bitchars.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/disableinstaller.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/disablepipes.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/disablewriteeighteen.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/dontparsefirstline.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/enable8bitchars.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/enableenctex.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/enableinstaller.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/enablemltex.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/enablepipes.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/enablewriteeighteen.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/errorline.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/extramembot.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/extramemtop.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/fontmax.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/fontmemsize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/halferrorline.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/haltonerror.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/hashextra.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/help.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/hhelp.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/includedirectory.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/initialize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/interaction.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/jobname.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/jobtime.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/mainmemory.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/maxinopen.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/maxprintline.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/maxstrings.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/nestsize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/nocstyleerrors.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/outputdirectory.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/paramsize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/parsefirstline.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/poolfree.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/poolsize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/quiet.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/recordpackageusages.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/recorder.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/restrictwriteeighteen.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/savesize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/srcspecials.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/stacksize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/stringvacancies.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/tcx.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/timestatistics.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/trace.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/triesize.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/undump.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../Options/version.xml" />
</variablelist>

</refsect1>

<refsect1>

<title>Environment</title>

<variablelist>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../EnvVars/MIKTEX_EDITOR.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../EnvVars/MIKTEX_TRACE.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../EnvVars/TEXINPUTS.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../EnvVars/TFMFONTS.xml" />
</variablelist>

</refsect1>

<refsect1>

<title>Bugs</title>

<para>This version of &TeX; implements a number of optional
extensions. In fact, many of these extensions conflict to a greater or
lesser extent with the definition of &TeX;. This version of &TeX;
fails to trap arithmetic overflow when dimensions are added or
subtracted.  Cases where this occurs are rare, but when it does the
generated &DVI; file will be invalid.</para>

</refsect1>

<refsect1>

<title>See Also</title>

<simplelist type="inline">
<member><citerefentry><refentrytitle>texify</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
</simplelist>

<bibliolist>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../BibEntries/texbook.xml" />
</bibliolist>

</refsect1>

</refentry>
