\documentstyle[a4]{article} \setlength{\parindent}{0pt} \let\latex=\LaTeX % makes it easier to type... \title{How to work with \latex} \author{Armin Loerwald\\Kurze Straße 42\\33613 Bielefeld \and Sibylle Dürbaum\\Dieselstraße 23\\33613 Bielefeld} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \pagestyle{headings} \maketitle \newpage \tableofcontents \newpage \pagestyle{headings} \sloppy \addtolength\topmargin{-27pt} \addtolength\textheight{68pt} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%% These are a definition for the juxtapostion of LaTeX %%%%%% %%% Layout and and LaTeX-markup commands %%% \newcommand\exa{\nopagebreak \begin{flushleft}\smallskip \nopagebreak \begin{minipage}[t]{6cm}\sloppy} \newcommand\exb{\end{minipage}\kern 1cm\begin{minipage}[t]{8cm}\sloppy } \newcommand\exc{\end{minipage}\kern -3cm \smallskip\end{flushleft}} \newcommand\oben[1]{\begin{center}\begin{minipage}{#1}\hrule\medskip} \newcommand\unten {\hrule \end{minipage}\end{center}} \section{Introduction} The document preparation system {\latex}, which contains about 900 commands, is based on the original {\TeX} or {\sl plain-\TeX} by Donald E.Knuth. This programm is especially helpful for the production of mathematical texts. Since {\TeX} is very difficult to deal with, {\latex} adds to this version a collection of commands that simplify typesetting and individual design of articles, books, letters or whatever.\\ Your primary concern in working with {\latex} should be to concentrate on the description of the {\sl logical structure} of your text. While other text design programms mainly focus on the visual effect of the text, {\latex} approach to typesetting can be characterized as being mainly logical, not visual. Thus in {\latex} you must think first of how your text should be structured: you have to type in commands {\LaTeX} needs to format the text. On your input screen you don't see the final layout of your text.\\ {\latex} encourages you to think of the logical structure:\\ \hspace{2cm} You can put an equation like this...\\ For all {\it x}:\\ \centerline{$f(x)= g(x+1)$} ...or like this\\ \centerline{For all x: $f(x)= g(x+1)$} \smallskip \section{The structure of a {\LaTeX}-file} Each {\latex} document consists of a {\it preamble} and a {\it body}. The {\bf preamble} contains information about {\it papersize, textheight, design of the text output, type of text} and all other sorts of commands which are valid for the whole document. The {\bf body} contains your text in which you can use commands that are locally valid. Thus the common syntax of a {\latex}-file looks like this: \begin{verse} \verb|\documentstyle[options]{style}|\\ {\it commands and definitions that are valid for the whole document}\\ \bigskip \verb|\begin{document}|\\ {\it your text and further commands which are valid only locally}\\ \verb|\end{document}| \end{verse} \vspace{1cm} \verb|[options]|: you can use options like: {\bf 11pt,12pt...}{\it standard textheight is 11pt or 12pt instead of 10pt}; {\bf twoside...}{\it the output is on two sides}; {\bf twocolumn...}{\it output is in two columns}; {\bf german...}{\it you can use german umlaut like ö, ü, ä}. \medskip \verb|{style}:| depending on what your text is all about there's several text styles available: {\bf book, report, article} or {\bf letter}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Commands} \subsection{General structure of {\LaTeX}-commands} In {\latex} can appear in an environment of $\backslash${\it command}, $\{\backslash${\it command \hspace{1cm}}$\}$ or as well $\backslash${\it command}$\{${\it specified command}$\}$ $\{${\it numeric addition}$\}$. \\ %another way of doing it If you use more complex structured commands, the structure appears like this: \begin{verse} \verb|\begin{|{\it command}\}\\ \smallskip further commands or text\\ \smallskip \verb|\end{|{\it command}\} \end{verse} \subsection {Page style and frontpage} The layout of the paper {\em can\/} begin with the command \begin{verse} \verb|\pagestyle{|{\it style\/}\verb|}| \end{verse} With {\tt plain} (or simply by leaving \verb|\pagestyle| out) the pagenumber is at the bottom of the paper. With using {\tt headings} the headline of the chapter and the pagenumber appear at the top of the paper. {\tt Empty} of course keeps top and bottom of the page {\it empty}. \smallskip \verb|\maketitle| creates the frontpage and depends on your document style. It can contain \verb|\title{text}|, \verb|\author{names}|, \verb|\thanks{text}| to whomever you want -- and \verb|\date{text}|, of course, creates the date. If you leave it out, the computer puts the relevant time automatically. \subsection{Headlines and table of contents} There's many commands available to format your text. The structure looks like this:\\ \verb|\part, \chapter, \section, \subsection, \subsubsection, \paragraph and \subparagraph|; \verb| \part and \chapter| are not available in the {\it article} style. The command \verb|\tableofcontents| automatically makes the table of contents. The headlines for the different levels must be in brackets after the command, e.g. \begin{verse} \verb|\section{Two Roman fortresses in Gallia}|\\ \verb|\subsection{Laudanum}|\\ \verb|\subsection{Aquarium}|\\ \end{verse} \subsection{Font size and font type} \LaTeX\ actually chooses the right font and textheight itself due to the surrounding commands and the logical structure of the document. Tables ~\ref{fonts} and~\ref{sizes} show the commands for different types and sizes. \exa {\small Die kleinen {\bf fetten} R"omer beherrschten }{\large das ganze gro"se {\it Italien\/}.} \\[6pt] le $2^{\mbox{\scriptsize\`eme}}$ r\'egime \exb \begin{verbatim} {\small Die kleinen {\bf fetten} R"omer beherrschten }{\large das ganze gro"se {\it Italien\/}.} \\ le $2^{\mbox{\scriptsize\`eme}}$ r\'egime \end{verbatim} \exc \begin{table}[bp] \caption{Font types} \label{fonts} \oben{10cm} \begin{tabbing} {\tt xboldmathxx}\= und dann der Text \kill \verb|\rm| \> \rm normale Schrift (roman) \\ \verb|\bf| \> \bf fette Schrift (boldface) \\ \verb|\it| \> \it kursive Schrift (italic) \\ \verb|\sl| \> \sl schr"age Schrift (slanted) \\ \verb|\sf| \> \sf "`sans serif"' Schrift \\ \verb|\sc| \> \sc "`Caps and Small Caps"' Schrift \\ \verb|\tt| \> \tt Schreibmaschinenschrift (typewriter) \\ \verb|\boldmath| \> Fettdruck in mathematischen Formeln \end{tabbing} \unten \end{table} \begin{table} \caption{font size} \label{sizes} \oben{10cm} \begin{tabbing} {\tt xfootnotesizexx}\= und dann der Text \kill \verb|\tiny| \> \tiny winzig kleine Schrift \\ \verb|\scriptsize| \> \scriptsize sehr kleine Schrift (wie Indizes)\\ \verb|\footnotesize| \> \footnotesize kleine Schrift (wie Fu"snoten)\\ \verb|\small| \> \small kleine Schrift \\ \verb|\normalsize| \> \normalsize normale Schrift \\ \verb|\large| \> \large gro"se Schrift \\ \verb|\Large| \> \Large gr"o"sere Schrift \\ \verb|\LARGE| \> \LARGE sehr gro"se Schrift \\[3pt] \verb|\huge| \> \huge riesig gro"s \\[3pt] \verb|\Huge| \> \Huge riesig gro"s \end{tabbing} \unten \end{table} If you want to have a {\it large} and {\it bold} typeface you have to put it into the right order: i.e.\ {\em not\/} with \verb|\bf\large| but {\em only\/} with \verb|\large\bf|.\\ Remember: the more different font types you use in your document, the more confusing it looks like! \vspace{0pt plus 3cm}\pagebreak[2] % manual editing, may need changes! \subsection{Line spacing} If you want to change the line spacing of your document, i.e. from single space to doublespace you have to increase the value of the command \verb|\baselinestretch| \begin{quote} for "`line spacing 1.5"' output:\\* \verb|\renewcommand{\baselinestretch}{1.3}| for "`doublespace"' output:\\* \verb|\renewcommand{\baselinestretch}{1.6}| \end{quote} \subsection{Enumerations} There's two helpful commands which allow you to create lists very easily. \verb|\enumerate| creates a numbered list and \verb|\itemize| a list with dots instead of numbers. These commands are an example for a \verb|\begin{| {\it command} \verb|}| \hspace{0.5cm} \verb|\end{| {\it command} \verb|}| environment. The listed items have to begin with \verb|\item|. \exa \begin{enumerate} \item Troubadix {\bf is} a marvellous musician! \item Obelix is {\bf not} fat! \end{enumerate} \begin{itemize} \item Verleihnix \item Raffnix \item Idefix \end{itemize} \exb \begin{verbatim} \begin{enumerate} \item Troubadix {\bf is} a marvellous musician! \item Obelix is {\bf not} fat! \end{enumerate} \begin{itemize} \item Verleihnix \item Raffnix \item Idefix \end{itemize} \end{verbatim} \exc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{How to use the mathematical style} \subsection{General structure} Mathematical terms have to be put either between \verb|\(| and \verb|\)| or between \verb|$| and \verb|$| or between \verb|\begin{math}| and \verb|\end{math}| . {\it Mathematical terms} are complete mathematical formula as well as single variables correlated to formulas, Greek letters or special symbols. Since {\LaTeX} is mainly created for mathematical texts, the following examples gives an impression of how {\LaTeX} can look like when it's used in the right way. \exa Seien $a$ und $b$ die Katheten und $c$ die Hypotenuse, dann gilt $c^{2}=a^{2}+b^{2}$ (Pythagor"aischer Lehrsatz). \exb \begin{verbatim} Seien $a$ und $b$ die Katheten und $c$ die Hypotenuse, dann gilt $c^{2}=a^{2}+b^{2}$ (Pythagor"aischer Lehrsatz). \end{verbatim} \exc \exa \TeX\ spricht man wie $\tau\epsilon\chi$ aus.\\[6pt] 100~m$^{2}$ Nutzfl"ache \\[6pt] Mit $\heartsuit$-lichen Gr"u"sen \exb \begin{verbatim} \TeX\ spricht man wie $\tau\epsilon\chi$ aus.\\ 100~m$^{2}$ Nutzfl"ache \\ Mit $\heartsuit$-lichen Gr"u"sen \end{verbatim} \exc Longer mathematical formulas or equations should be but in a separate line. For this purpose one should pose them between \verb|\[| und \verb|\]| or between \verb|\begin{displaymath}| and \verb|\end{displaymath}| or between \verb|\begin{equation}| and \verb|\end{equation}|, if you want the equations to be enumerated. \exa Seien $a$ und $b$ die Katheten und $c$ die Hypotenuse, dann gilt \begin{equation} c = \sqrt{ a^{2}+b^{2} } \end{equation} (Pythagor"aischer Lehrsatz). \exb \begin{verbatim} Seien $a$ und $b$ die Katheten und $c$ die Hypotenuse, dann gilt \begin{equation} c = \sqrt{ a^{2}+b^{2} } \end{equation} (Pythagor"aischer Lehrsatz). \end{verbatim} \exc \subsection{Mathematical syntax} \bigskip Small {\bf Greek letters} are created like this: \verb|\alpha|, \verb|\beta|, \verb|\gamma|...\ if you want to use capitals you have to put it like this: \verb|{\rm A}|, \verb|{\rm B}|, \verb|\Gamma|, \verb|\Delta|... \exa $\lambda, \xi, \pi, \mu, \Phi, \Omega $ \exb \begin{verbatim} $\lambda, \xi, \pi, \mu, \Phi, \Omega $ \end{verbatim} \exc There's a great deal of {\bf mathematical symbols}: like $\in$ or $\Rightarrow$ or $\infty$... \bigskip {\bf Exponents and indices} can be put high or low with help of \verb|^| and \verb|_| \exa $a_{1}$ \qquad $x^{2}$ \qquad $e^{-\alpha t}$ \qquad $a^{3}_{ij}$ \exb \begin{verbatim} $a_{1}$ \qquad $x^{2}$ \qquad $e^{-\alpha t}$ \qquad $a^{3}_{ij}$ \end{verbatim} \exc {\bf Squareroots} are created like this: \verb|\sqrt| , {\it n\/}-th squareroot with \verb|\sqrt[|{\it n\/}\verb|]|. The size of the squareroot is processed by \LaTeX\ automatically. \exa $\sqrt{x}$ \qquad $\sqrt{ x^{2}+\sqrt{y} }$ \qquad $\sqrt[3]{2}$ \exb \begin{verbatim} $\sqrt{x}$ \qquad $\sqrt{ x^{2}+\sqrt{y} }$ \qquad $\sqrt[3]{2}$ \end{verbatim} \exc \end{document}