wget http://potis.org/tutorial/guide.zip
unzip guide.zipThis produes a directory called 'guide-to-latex'
C-x C-f guide/demodoc.texThe first thing to notice is the syntax highlighting and indentation. As your document gets long, you may appreciate a feature that, to my knowledge, is unique to this system. Press the 'TeX' button at the right of the tool bar. This will shortly replace code sections with the rendered mathematical symbols. This greatly cleans up your document. However, if you use the cursor motion keys (not the mouse) to enter the region of the mathematics, you will find that the section expands, and you once again have direct access to edit the underlying code.
One of the most useful shortcuts is
`(on the top left side of the keyboard, with ~)
Try pressing:
`aAll the Greek letters, upper and lower case, as well as some other objects, are bound this way.
Open a file (on your computer or on your desk), LaTeX ref card (it is two pages) and emacs. Resize windows so that you can see all necessary windows.
Look at a file containing math and use math mode and the ref card
to reproduce the content.
These features are part of AUCTeX.
Step by step paper
The following guides you through a basic article class paper, step by
step in your version of emacs. In this step by step guide, you will
open a blank document, insert an article environment, write a basic
paper in that environment, add a graphic, and add a bibliography.
See the following nice guide on writing essays when it is time to generate real content for your paper: essay guide. For a superb comprehensive tutorial on written English see Dr. Syntax at Grinnell College-- a must for statistical communication or the Purdue Online Writing Lab (OWL). For my Math 103 students, see Laura Taalman's example file: latexsample.tex
C-x C-fCall your new document josh.tex (or hon.tex, or matt.tex, you get the idea. Note: avoid capital letters and spaces in file names. )
C-c C-eAccept the defaults by pressing return in the minibuffer as you are prompted. Place your cursor between
\begin{document}and
\end{document}and start writing your paper. Follow demodoc.tex to see how to do basic things. This file and many other help files are on your dvd. In the Newton lab, demodoc.tex is in
d:/texmf-doc/doc/english/guide-to-latex/The version on the DVD includes \usepackage{palatino}. This is a font that is not available in TeX Live, so unless you have installed it, you need to comment this line out if you want to typeset the example document. You can comment regions out by selecting the region and commenting it with
M-x comment-regionor by placing the comment character
%at the start of the line you want to comment out.
\usepackage{graphicx}after the \documentclass line and before the \begin{document} line. This region is called the 'preamble' and is where you place instruction to the TeX system regarding how to process your document. For more information on the graphicx package, see section 6.1.1 of this more detailed guide for writing papers: More on including graphics. In general, use Emacs to help you. For graphics,
C-c C-e figureThis will insert a figure environment. Inside the figure, place
\includegraphics{yourfile}(.png, .jpg, .pdf is not necessary)
In R, you have a number of choices for how to export graphics. PDF works well, since the document you produce using these instructions will be a PDF file.
library(xtable) help(xtable)for exporting R output in LaTeX code. This also lets you export tables. To make a table by hand, again, insert environment:
C-c C-e tableType
C-c C-eand then press TAB twice to see available environments.
C-c C-sthen choose the level of nesting for your section break.
C-c C-t C-pObserve the minibuffer and the status line where you will see Tex-Pdf mode enabled and PDFLaTeX in the status bar above the minibuffer. Toggle as needed. If you use a png (graphs) or jpeg (photographs), you may need to set the dimensions, as indicated in the above link.
C-x C-f stat.bibChoose a good name. It must end in .bib. Note: avoid capital letters and spaces in file names. If you plan well, this single file is where you will keep all your bibliographic entries: for your dissertation, for your presentations, your journal articles, for everything you write from now on. You will want to place this file in version control.
C-c C-e M(C-c C-e for bib tex entry is a common a shortcut you will use often enough that you should learn it.) You are placed in a correct template containing all the parts your entry might have. In this case they are all optional, thus in red. C-j to move down to the Author field. Enter
Panayotis Giannakouros and Lihua ChenC-j to each of the next fields entering the title
Guide to UT Newton Lab DVD
January
2007and the url for how published:
http://potis.org/tutorialAvoid citing web pages, if you can.
C-c C-cNotice that the unused fields were deleted. Also, you are prompted for a key, in this case a rather long key composed of the author and title. If entering references by hand, you might want a shorter key, but you will probably want to use RefTeX, in which case citations will be automatic.
M-x reftex-mode
C-c [You will be prompted for a 'regular expression matching a set of entries in the bibliographic data base.' This means, type a few letters of the name of the author you want to cite. In our case type
giaYou see our entry pop up in your lower screen. This is the only match, so just press return. You now see a proper \cite{} tag for the reference. (Did you see 'no bibilography' instead of the prompt for a regular expression? Use C-x C-w to make sure the bib and the LaTeX file are in the same directory (I recommend "~/"). If it still fails, you used capital letters in your file name and are using Windows.)
beamerrather than document. A beamer presentation is made up of frames.
C-c C-e frameWhen you add constructs like lists, you will be given an extra prompt,
overlayThis controls when something will appear on the slide. Try it. For more complicated effects and setting background themes,
wget http://statlive.org/~poti/math220/beamerexample.zip unzip beamerexample.zip
For a full, searchable, reference containing any construct you might
want to insert see:
Comprehensive
list of symbols
Once you become accustomed to using LaTeX for basic things, you will soon want to see how to do things in LaTeX, not just how to make a particular symbol. See the Visual FAQ for this.