Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
34 views2 pages

A Simple Sample L TEX File

- LaTeX is not a word processor like Microsoft Word; the formatting seen while typing a .tex file will differ from the output .dvi file, and commands and environments are used to control formatting. - Text is entered within environments like math mode using $...$ or $$...$$, which determine if equations are displayed inline or on their own line. - LaTeX allows for precise control over formatting, spacing, alignment, and inclusion of various document elements like tables, figures, and cross-references. Learning LaTeX is best done by examining sample files to see how commands produce different output.

Uploaded by

Howo4Die
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

A Simple Sample L TEX File

- LaTeX is not a word processor like Microsoft Word; the formatting seen while typing a .tex file will differ from the output .dvi file, and commands and environments are used to control formatting. - Text is entered within environments like math mode using $...$ or $$...$$, which determine if equations are displayed inline or on their own line. - LaTeX allows for precise control over formatting, spacing, alignment, and inclusion of various document elements like tables, figures, and cross-references. Learning LaTeX is best done by examining sample files to see how commands produce different output.

Uploaded by

Howo4Die
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

A A Simple Sample L TEX File

Stupid Stuff I Wish Someone Had Told Me Four Years Ago (Read the .tex le along with this or it wont make much sense)

A The rst thing to realize about L TEX is that it is not WYSIWYG. In other words, it isnt a word processor; what you type into your .tex le is not A what youll see in your .dvi le. For example, L TEX will completely ignore extra spaces within a line of your .tex le. Pressing return in the middle of a line will not register in your .dvi le. However, a double carriage-return is read as a paragraph break. Like this. But any carriage-returns after the rst two will be completely ignored; in other words, you cant add more space between lines, no matter how many times you press return in your .tex le. In order to add vertical space you have to use vspace; for example, you could add an inch of space by typing \vspace{1in}, like this:

To get three lines of space you would type \vspace{3pc} (pc stands for pica, a font-relative size), like this:

A Notice that L TEX commands are always preceeded by a backslash. Some commands, like \vspace, take arguments (here, a length) in curly brackets. A The second important thing to notice about L TEX is that you type in various environments...so far weve just been typing regular text (except for a few inescapable usages of \verb and the centered, smallcaps, large title). There are basically two ways that you can enter and/or exit an environment;

this is the rst way... this is the second way. Actually there is one more way, used above; for example, this way. The way that you get in and out of environment varies depending on which kind of

environment you want; for example, you use \underline outside, but \it inside; notice this versus this. A The real power of L TEX (for us) is in the math environment. You push and pop out of the math environment by typing $. For example, 2x3 1 = 5 is typed between dollar signs as $2x^3 - 1 = 5$. Perhaps a more interesting example N is limN k=1 f (tk )t. You can get a fancier, display-style math environment by enclosing your equation with double dollar signs. This will center your equation, and display sub- and super-scripts in a more readable fashion:
N N

lim

f (tk )t.
k=1

If you dont want your equation to be centered, but you want the nice indicies and all that, you can use \displaystyle and get your formula in-line; using
N

our example this is lim

f (tk )t. Of course this can screw up your line


k=1

spacing a little bit. A There are many more things to know about L TEX and we cant possibly talk A about them all here. You can use L TEX to get tables, commutative diagrams, gures, aligned equations, cross-references, labels, matrices, and all manner of strange things into your documents. You can control margins, spacing, alignment, et cetera to higher degrees of accuracy than the human eye can percieve. You can waste entire days typesetting documents to be just so. In short, A L TEX rules. A The best way to learn L TEX is by example. Get yourself a bunch of .tex les, see what kind of output they produce, and gure out how to modify them to do what you want. There are many template and sample les on the department A L TEX page and in real life in the big binder that should be in the computer lab somewhere. Good luck!

You might also like