1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
<html>
<head>
<title>Input to LaTeX</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#000099" vlink="#cc0000" alink="#cc0000">
<h1><font size="-2">Hypertext Help with LaTeX</font><br><font color="#cc0000">Input to LaTeX</font></h1>
Input to LaTeX is plain text (ascii) which includes both the text of the
document and also formatting commands. It is possible to
<a href="ltx-165.html">split the input</a> into several files using:
<ul>
<li><a href="ltx-245.html"><tt>\include</tt></a>
<li><a href="ltx-248.html"><tt>\input</tt></a>
</ul>
<p>
Space characters separate words. Two space characters in a row are
equivalent to a single space character. The end of line is also
equivalent to a space character. (However, a percent sign,
<a href="ltx-434.html"><tt>%</tt></a>, can end a line without
generating a space character.) Generally, space characters at the beginning
of a line are ignored.
<p>
An empty or blank line between two lines of text defines
<a href="ltx-111.html">a new paragraph</a>.
Two blank lines are equivalent to one.
<h2>Special Characters</h2>
The following ten characters are <a href="ltx-164.html">Special LaTeX
Characters</a>:
<pre><tt> $ & % # _ { } ~ ^ \ </tt>
</pre>
If entered directly in the input they cause LaTeX to do something special.
You can get the following seven of them into your document by simply
preceding them with a backslash (<tt>\</tt>):
<pre><tt> $ & % # _ { } </tt>
</pre>
To get the other three (<tt> ~ ^ \ </tt>) in
your output requires <a href="ltx-164.html">more work</a>.
<h2>LaTex Commands</h2>
Commands take one of two forms
<ul><li>a backslash (<tt>\</tt>) followed by a single special character
<li>a bacslash (<tt>\</tt>) followed by a string of letters
</ul>
The second case is case-sensitive;
<a href="ltx-405.html"><tt>\Gamma</tt></a> is different from
<a href="ltx-405.html"><tt>\gamma</tt></a>.
These commands are terminated by a nonletter, i.e., a blank, a number,
a punctuation mark or special character.
<p>
Commands may have mandatory arguments, which are input in braces
(<tt>{}</tt>).
They may also have optional arguments, which are input in square brackets
(<tt>[]</tt>).
<p>
For commands which produce text a trailing blank may be interpreted as the
end of the command, which does not automatically create a space, so
you may have to do something to create an
<a href="ltx-431.html">interword space</a> after this text.
<h2><a name="structure">Structure of Input</a></h2>
LaTeX input normally begins with a
<a href="ltx-22.html"><tt>\documentstyle</tt></a> command. (In LaTeX2e
this is replaced with a <a href="versions.html"><tt>\documentclass</tt></a>
command.)
<p>
The beginning of the document text follows a <tt>\begin{document}</tt>
command.
<p>
Input between the <tt>\documentstyle</tt> and <tt>\begin{document}</tt>
is called the <em>preamble</em> and typically contains <a href="ltx-17.html">new
command definitions</a>, information for the
<a href="ltx-263.html">title</a>, <a href="declarations.html">declarations</a>
which affect things like <a href="ltx-176.html">Typefaces</a>, etc.
<p>
The document text (and generally also the LaTeX input) is terminated by a
<tt>\end{document}</tt> command.
<p>
It is possible to obtain some of the input from <a href="ltx-165.html">external
files</a>, i.e., those which are not the main file input to the LaTeX program.
<hr>
See also
<ul>
<li><a href="ltx-165.html">Splitting the input</a>
<li><a href="ltx-164.html">Special Characters</a>
<li><a href="ltx-99.html">Line and Page Breaking</a>
<li><a href="ltx-111.html">Making Paragraphs</a>
<li><a href="ltx-143.html">Spaces and Boxes</a>
</ul>
Back to the <a href="ltx-2.html">Table of Contents</a>
<hr>
<address>
Revised: Sheldon Green, 30 Oct 1995.
</address>
</body>
</html>
|