Author: Lori Pratt Last updated: September 23, 1993 Modified by Manavendra Misra, Sept. 15 1994 This is a quick set of instructions for using LaTeX, with previewing under X for the PPL environment. 1. latex is in /usr/local/bin, so this path should be in your path environment. 2. Add to your .cshrc file: setenv TEXFONTS .:/usr/local/lib/tex/fonts setenv TEXINPUTS .:/usr/local/lib/tex/inputs.local setenv TEXFORMATS .:/usr/local/lib/tex 3. Create a .tex file. Here is a simple sample to get you started (call it paper.tex): -------------------- % This is a sample .tex file. Call it paper.tex. Error messages will % then be stored in paper.log. % Comments in latex are preceded by a % (everything after a % is ignored till % the end of the line. \documentstyle[12pt,fullpage,epsf,titlepage,html]{report} % The documentstyle statement is the first statement of your % latex file. It tells latex about all the default "style files" you % want to include in your document. In this case, we are using the 12 % size font, the fullpage.sty file that automatically sets margins to % fill the page completely, epsf.sty for including encapsulated postscript % files in your document, titlepage.sty to create a separate title page, % and html.sty for using latex2html. % The report style of document is used when you want to have a report % with chapters etc. If you don't need to divide your document into % chapters, you can use the article style. %%%%%%%%%%%%%%%%%%%%%% % You can define your own commands, such as: \newcommand{\bi}{\begin{itemize}} \newcommand{\ei}{\end{itemize}} \newcommand{\UL}{\underline} \newcommand{\IN}{\indent} \newcommand{\NI}{\noindent} \newcommand{\be}{\begin{enumerate}} \newcommand{\ee}{\end{enumerate}} \newcommand{\bd}{\begin{description}} \newcommand{\ed}{\end{description}} \newcommand{\bc}{\begin{center}} \newcommand{\ec}{\end{center}} \newcommand{\bt}{\begin{tabbing}} \newcommand{\et}{\end{tabbing}} \newcommand{\bfig}{\begin{figure}} \newcommand{\efig}{\end{figure}} \newcommand{\beq}{\begin{equation}} \newcommand{\eeq}{\end{equation}} \newcommand{\beqa}{\begin{eqnarray}} \newcommand{\eeqa}{\end{eqnarray}} %%%%%%%%%%%% % The "preamble" of the document has ended, and the body % begins with the following statement: \begin{document} % Next, we go ahead and construct a title page using the \title % \author, and \date commands as shown below. % \\ is used to create a nnewline. \title{MACS 563/421c: Parallel Computing for Scientists and Engineers} \author{Manavendra Misra\\ Stratton 419\\ Dept.of Mathematical and Computer Sciences\\ Colorado School of Mines\\ Golden, CO 80401\\ Ph.\ (303)-273-3873\\ Fax: (303)-273-3875\\ email: mmisra@mines.colorado.edu} \date{} % This statement creates an empty date field \maketitle % This creates the title \tableofcontents % Use this statement to create a table of contents % You'll have to run the file through latex twice to % get the table of contents right. % Chapters are specified by \chapter commands: \chapter{The First Chapter} We begin with an example of a centered environment: \begin{center} Title of the paper\\ \today % This puts todays date in the document. \end{center} Also notice that \LaTeX differs from latex. \newpage % This is the page break command. % Sections are created by the \section command. Latex automatically % maintains counters for things like section numbers, page numbers, etc. % If you don't want a section to be numbered, you can use \section*{Name} \section{Sample lists} % Within sections, one can have subsections, and subsubsections. \subsection{Numberered list} % Latex provides many different kinds of formatting environments. For example: Here is a numbered list: \begin{enumerate} \item First item \item Second item \item Third item \end{enumerate} Given our new command definitions above, this can also be written as: \be \item First item \item Second item \item Third item \ee \subsection{Bulleted list} Here is a {\em bulleted} list: \begin{itemize} \item First item \item Second item \begin{itemize} \item Sub-item \end{itemize} \item Third item \end{itemize} \subsection{Descriptions} Here is the description environment: \begin{description} \item[Exposition] An exposition of the example which you are presenting. This could be done so as to be suitable for students as well as instructors. \item[Laboratories] If you have some ideas about laboratories which can be assigned on the basis of your module, you can have a separate section on these, as shown below. \item[Exercises] These could be given as part of the laboratories or as a section at the end of the exposition. \item[Guide to the instructor] You can do a separate section of the module on ideas about teaching using the material which you have presented. \item[References] A section citing references can be given at the end of the module. \end{description} % One can even create tables: \subsection{Tabular Environments} Here is a {\bf table}: \begin{tabular}{ccc} First & Second & Third \\ Item 1 & Item 2 & Item 3 \\ \end{tabular} If you want to create lines around the items, you can use the table environment around the tabular environment. \subsection {Paragraphs} When you type in your text, you can place a carriage return anywhere, and it will not affect the paragraph structure. However, you can start a new paragraph by using two returns. Like this. This will, of course leave a blank line in your raw text. % Discussion of math environments \subsection{Math expressions} You may want similar type or mathematical expressions embedded in your text as well. Here is a sample of how you can do that: Assuming $n = 6$, let us examine the communication for each iteration. Notice that we now show the inherent association of $a \sb{i}$ with $P \sb{i}$. % Notice that extra spaces and single carriage returns are ignored. In our final algorithm, $a \sb{i}$ will be replaced by a variable that is local to $P \sb{i}$. The general communication pattern, represented by arrows, is evident by examining processors $P \sb{1}$ through $P \sb{4}$. Alternatively, you can have a separate equation environment, such as (note that this uses the aliases that we created above): \beq {\cal F}(\vec{\omega}) = \int_{-\infty}^{+\infty} I(\vec{x}) e^{- j \vec{\omega} \vec{x}} d \vec{x} \label{Fourier} \eeq Also note that latex automatically numbers the equations created by the equation environment, and once we have created a label (as above), we can refer to that equation using that (See how Figure \ref{Fourier} gets printed out). This use of label and ref can be used for refering to sections/tables/figures too. \section{Figures} % Discussion of including figures in the document... Once you have created a figure using a software package like tgif (/usr/local/bin/tgif) or xfig (/usr/local/X11/bin/xfig), and saved them in {\em encapsulated} {\bf postscript} format, you can include them in latex documents using the following (note that you must have epsf in your documentstyle statement, and that we are using the aliases setup in the preamble): \bfig[t] % [t] asks for the figure on top, h=here,b=bottom,p=newpage \epsfverbosetrue % will tell you everything that happens along the way. \epsfysize=5in % You can specify the x or y size, and the figure gets scaled \begin{center} %\leavevmode\epsffile{GW.ps} % GW.ps is the file name--should be in the same directory: STATEMENT COMMENTED OUT FOR NOW. A figure should go here (comment this out later) \end{center} \caption{A 2-D Gabor-based Wavelet} % caption that appears in the document \label{wavelet-fig} % label to be used for later references. \efig Again, you can use refs to refer back to the figure (See Figure \ref{wavelet-fig}). % You don't have to have everything in the same file. You can make your % latex document modular by creating modules (blurb.tex and syllabus.tex % in this case) and inputting them into the main document. % STATEMENTS COMMENTED OUT FOR NOW. %\input{blurb} %\input{syllabus} %%%%%%%%%% % One can create many different styles of reference lists using latex --this % is the simplest {\bibliographystyle{plain} % The following line tells BIBTEX where to find the .bib files. Notice that we % specify the full pathnames, don't put the .bib extension to the file % name, and don't leave any spaces between filenames! \bibliography{/newton/Users/mmisra/bib.dir/string,/newton/Users/mmisra/bib.dir/nn} \end{document} -------- 5. Now type: latex paper.tex latex paper.tex (yes, twice. This is so that the table of contents information is included. You'll often have to run latex twice to get everything to look just right, though often once is enough if you're just checking textual changes). 6. The resulting file is called paper.dvi. You can preview dvi files using "xdvi". So, xdvi paper will preview this file for you. You now have to convert this to a postscript file. Do this as follows: dvips -o paper.ps paper.dvi You might get all sorts of weird messages about default base files and fonts and ``extremely poor output''. Ignore these. (At other sites, you may need to use dvitps, available as public domain software. Type ``archie dvitps''.) You can now send paper.ps to any postscript printer (well, most!), and it'll print your formatted document. You can also preview it with a postscript previwer, if you have one. These are available on suns, nexts, etc. Ask your sysadmin. 7. To find out about more latex commands, including bibliographies and the like, get: LaTeX: A Document Preparation System, User's Guide and Reference Manual by Leslie Lamport Addison-Wesley, 1986 This is a very good book, very tutorial and well written. They usually have it for around $25 at the Bookstore.