Basic LaTeX Guide

Rules for posting and helping, along with guides for formatting and explanations of what to expect. Post "test" messages here.

Basic LaTeX Guide

Postby stapel_eliz on Thu Mar 05, 2009 7:25 pm

You can post formatted mathematical expressions by inserting LaTeX ("LAY-teck") commands between "tex" tags. You may click the "tex" button (at the right-hand end of the "formatting" row, across the top of the message-entry box) or else by typing the opening "[tex]" and closing "[/tex]" tags manually.

Exponents and Subscripts: To format exponents, use the same carat symbol, " ^ ", as you always have on your graphing calculator, probably the Shift-6 key on your computer keyboard. Thus, "[tex]x^2[/tex]" displays as "". Note: If your exponent is more than just the one character, use the LaTeX grouping symbols of "curly braces". To raise something to the one-half power, you would format as "[tex]x^{1/2}[/tex]" to get "". You can insert subscripts by using the understroke character. For instance, "[tex](x_1,y_1)[/tex]" displays as "". You can even combine the two: "[tex]x_1^2[/tex]" displays "".

Radicals: To create radical symbols, use the "sqrt" abbreviation (for "square root") and the back-slash "operator" command, using curly braces to indicate what goes inside the radical. To format the square root of seven, you would typeset as "[tex]\sqrt{7}[/tex]" to get "". To create other radicals, such as cube roots, put the base (for cube roots, this would be "3") inside square brackets. To display the cube root of five, you would format as "[tex]\sqrt[3]{5}[/tex]" to get "".

Fractions: To create fractions, use the "frac" abbreviation and the back-slash operator, and use curly braces to group the numerator and denominator. To format two-thirds, you would type "[tex]\frac{2}{3}[/tex]" to get "". You can put expressions and other operators inside the numerator or denominator. For instance:

. . . . .[tex]\frac{\sqrt{2}}{3}[/tex] displays

If you want to surround your fraction in size-appropriate grouping symbols, use the "\left" and "\right" tags to indicate this. For instance:

. . . . .[tex](\frac{14}{23})[/tex] displays as

...but:

. . . . .[tex]\left(\frac{14}{23}\right)[/tex] displays as

Special Symbols: The "not equals" symbol "" is inserted using "[tex]\neq[/tex]". The "greater than or equal to" (the symbol) and the "less than or equal to" (the symbol) are inserted using "[tex]\geq[/tex]" and "[tex]\leq[/tex]", respectively. The "wiggly equals" for "approximately" is inserted using "[tex]\approx[/tex]", which displays "". The symbol "", for "infinity", is inserted using "[tex]\infty[/tex]". To insert a "plus-minus" sign, such as for the Quadratic Formula, use "[tex]\pm[/tex]" to display "". Many of these same symbols can be "cancelled" or negated by using the "\not" tag. For instance, "not less than or equal to" would be typeset as "[tex]\not\leq[/tex]", which displays as "".

Try not to use a lower-case "x" to indicate "times", since this will be confused with the variable. Instead, use the "\times" operator: "[tex]3 \times 5[/tex]" displays as "". You can also use "\div" for the division symbol, "".

Colors and Spacing: Sometimes the default spacing is too crabbed and difficult to read. You can insert extra space by inserting "\," between your characters. For instance, "[tex]x^2+3[/tex]" displays as "", but "[tex]x^2\,+\,3[/tex]" displays as "". If you want to highlight something using color, use the "\color" operator and insert the desired color within curly braces. However, the different parts need to be inserted inside their own LaTeX tags, as the last color in the line seems to be interpreted (in the current installation) as being the color for the entire expression. For instance, "[tex]\color{red}x^2 \color{blue} \,+\,3[/tex]" displays as "", but "[tex]\color{blue}x^2\,[/tex][tex]\color{blue}+\,3[/tex]" displays as "".

Greek Letters and Special Characters: To insert Greek letters, such as "", spell the letter out, starting the name with a upper- or lower-case letter, depending on whether you want the upper- or lower-case Greek letter. So "[tex]\delta[/tex]" is the lower-case "" while "[tex]\Delta[/tex]" is the upper-case "". Common angle names are "alpha", "beta", "gamma", and "theta", which display as , , , and , respectively. You can display the "angle" symbol by using "\angle".

You can insert summation symbols by using the capital "Sigma", and you can include lower and upper limits: "[tex]\Sigma_{i=1}^n 2^n[/tex]" displays as:

. . . . .

Integrals are formatted similarly: "[tex]\int_0^3 x^2 dx[/tex]" displays as:

. . . . .

You can display limits using the "\lim" and "\rightarrow" commands: "[tex]\lim_{x \rightarrow \infty} \frac{1}{x}[/tex]" displays as .

To display set and element notation, use "\subset" for , "\not\subset" for , "\subseteq" for , "\in" for ("is an element of"), "\cup" for (set union), and "\cap" for (set intersection).

Note that "\" and "{}" are LaTeX "reserved" characters. To display them, you must first "escape" them, so the LaTeX renderer knows that you're not using them to begin a command. For instance, to format a set, you would type "[tex]\{1,2,3\}[/tex]" to display "".

Function Names and Text: You'll quickly notice that all textual information is assumed by LaTeX to be variables. However, sometimes you actually want text, or at least non-italicised characters. One way to accomplish this is to insert the text inside the "\mbox{}" operator. For instance, "[tex]This is text.[/tex]" displays as "", while "[tex]\mbox{This is not text.}[/tex]" displays as "".

If you want function names, such as "sine" or "log", to be non-italicised, you can use the back-slash to tell the LaTeX renderer that "the following is the well-known function of (whatever)". For instance, "[tex]ln(x)[/tex]" displays as "", while "[tex]\ln{(x)}[/tex]" displays as "". Other common function names are "\log", "\sin", "\cos", and "\tan". Each of these commands can take superscripts and subscripts: "[tex]\cos^2{(x)}[/tex]" displays as "" and "[tex]\log_2{(x)}[/tex]" displays as "".

Links to further information will be posted eventually. For now, this site has a nice display of many characters and commends, and the Physics Forum has a nice tutorial post. :D
User avatar
stapel_eliz
 
Posts: 1715
Joined: Mon Dec 08, 2008 4:22 pm

Sponsor

Sponsor
 

Re: Basic LaTeX Guide

Postby Martingale on Fri May 01, 2009 1:44 pm

stapel_eliz wrote:
. . . . .



I think the \sum command looks better





Code: Select all
\sum_{i=1}^n 2^n
User avatar
Martingale
 
Posts: 350
Joined: Mon Mar 30, 2009 1:30 pm
Location: USA

Re: Basic LaTeX Guide

Postby michaelempeigne on Wed Aug 05, 2009 2:45 pm

I never knew how to do these before
michaelempeigne
 
Posts: 5
Joined: Wed Aug 05, 2009 1:20 pm

Re: Basic LaTeX Guide

Postby afwings on Tue Oct 12, 2010 6:01 pm

Just testing the LaTeX (no need to respond). . And now a matrix:

afwings
 
Posts: 1
Joined: Mon Oct 04, 2010 8:42 pm

Re: Basic LaTeX Guide

Postby TeddyNall on Wed Apr 20, 2011 5:09 pm

How do I write quantors like "for each" or "exists"?
Last edited by TeddyNall on Tue May 10, 2011 12:55 pm, edited 1 time in total.
TeddyNall
 
Posts: 1
Joined: Wed Apr 20, 2011 5:06 pm

Re: Basic LaTeX Guide

Postby Martingale on Wed Apr 20, 2011 6:07 pm

TeddyNall wrote:How do I write quantors like "for each" or "exists"?





\forall \exists
User avatar
Martingale
 
Posts: 350
Joined: Mon Mar 30, 2009 1:30 pm
Location: USA


Return to Forum Rules & Guides

cron