Thursday, September 20, 2012

Using WinEdt on UoM windows image

A Simple Latex File
Tex is a computer program that can typeset text and mathematical formulae. Latex is a markup language that uses tex as its typesetting engine. Basically this allows the user to embed commands within a text file that can be interpreted by latex to produce a high quality typeset documents. WinEdt is a latex integrated development environment (IDE) for windows, that means that you can both edit text files and produce typeset documents all in one program, it is available to download for free but only on a trial basis.
Click on the start menu at the bottom of the page and enter 'winedt' in the search bar, then click on the application.
Once the program has opened, go the file menu and select new.
Now you must save the file before you start editing, so go to save as in the main menu, move to a directory in which you wish to save the document.
Call the file something like "test.tex" or "helloworld.tex", with the file ending ".tex".
Now we can start writing our latex file. Latex commands are always preceded by a backslash, there are predefined commands and the user may also specify their own. There is also a certain structure that must be adhered to. Two of the most common commands are \begin{} and \end{}, that signify the start and end of an environment. Like a good story all latex files need a start and an end, and the document environment signifies the start and end of a document, so all files require \begin{document} and \end{document}. The other requirement is some information about the structure of the document that you are creating. This information must be presented in the preamble (before \begin{document}) with the \documentclass{} command. There are certain default options that can be used, article is a popular choice. For the most simple of latex files enter the following text:
\documentclass{article}

\begin{document}
test
\end{document}
Once the "tex" has been written, it must be compiled in order to generate a file that can be printed or viewed on screen. A standard file type to convert to is pdf. There are lots of ways to generate a pdf, one is to go directly from the latex file to a pdf (using the pdflatex command) or and another is by converting from tex->dvi->ps->pdf.
Select the pdflatex option for the menu bar:
Click on the pdflatex button to compile the document, and now you should be able to view the pdf you have created by
clicking on the adobe acroread symbol in the menu bar.

No comments:

Post a Comment