# LaTeX Fomulas: Math v2.0

42 replies to this topic

### #1 alexander

alexander

Dedicated Smart-ass

• Members
• 5722 posts

Posted 11 May 2006 - 10:32 PM

NOTE: I am in the process of reworking this, it is still a decent reference, but i will be working on it, so expect changes

Intro:
This has been a long coming, endless traps have been setting the math evolutionary progress back throughout time, and you, Physics and Math people have been forced to use simple text equation display techniques to show complex math. Well, be that no longer, as i am about to introduce you to the world that no longer follows the standard text rules, it defies the normal thought, depends only on how far you are willing to take it and has no rivals in the realm of
 Microsoft
. I will attempt to teach you how to block the evil force from taking control of you, make you free as in freedom, to be what you want to be and know no limit. And when the forces of evil can no longer hold you down (and i am referring to M$IE support for CSS 2 and 3), you will enter the new realm of Latex.  how's that for an intro? Actually, it is quite sad that this hasn't happened any earlier, we are a scientific community, so the need for something like this, has bound to be around from very early on in the game (back when Uncle AL, TeleMad, FreeThinker, Gahd and Tormod ran the "Math and Physics" show). But i do have this to say, the software really hasn't caught up with this until early last year, so i guess it's just been ignored or something. Latex itself is a language, similar to HTML, but with major differences; it is a typesetting language made to be able to generate files that will be printable on many different types of printers. Latex is actually a dialect of Tex that was created by D.E.Knuth, it includes many plugins to the original Tex, including the one that i will describe to you today, one created for math. So what is the major difference between Math v1.0 and Math v2.0? Well its simply this, say you have an expression, and in Math v1.0 you would write it like such: f(x)=integral from -infinity to x of (e^(-t^2))/(radical(pi^x))dt uh, yeah, its kinda hard to follow, and some people would actually need to write it out to understand what is going on.... Wouldn't it be easier if you said just: $f(x)=\int_{-\infty}^x \frac{(e^{-t^2})}{\sqrt{\pi^x}}dt$ So, finally arching your attention? I sure hope so, because i am excited as well, and it is not that difficult to write this expression, in latex it looks like this: f(x)=\int_{-\infty}^x\frac{(e^{-t^2})}{\sqrt{\pi^x}}dt It may seem a bit much, but trust me, this will be a breeze once you get it. Basics: BB Tags Hypography uses a $tag to signify the beginning and$ tag to signify the end of a latex section of the post. Tags are surrounded by square brackets such as [tag] and respectively [/tag]. I strongly urge you to not forget to close the tags, it is not vital, but it is a good practice, even if you only plan to display an expression Tex Characters: Most characters in latex are rendered as the regular characters, such as a-z 0-9 () {} [] *$ % and so forth $a-z 0-9 () [] * \ \%$. Some need escaping, such is the case with $and % in our previous case, escaping means putting a \ in front like \$. But latex introduces some characters that have a meaning and render things differently (for math purposes) such characters would include the underscore (_) and the carat(^). Those characters are used to identify sub and superscript, respectively; for example a_b renders as $a_b$, a^b renders as $a^b$. Latex also has a load of characters that are not defined by regular keyboards, they are special characters and follow the following syntax: \name. Things like \alpha, \beta, \gamma, \delta, \pi and many many others are included ftp://tug.ctan.org/pub/tex-archive/info/symbols/comprehensive/SYMLIST
Those character commands are case sensitive, so \delta $\delta$is different from \Delta $\Delta$.

to be continued...

Continued

Size:
Latex supports many size options, the new software lets us support all of it, but for simplification reasons, any text you type, enclose it in the \text{} tag, you can actually control color, font and size from within those, but to simplify the size for you:
\tiny $\text{\tiny{tiny}}$
\small $\text{\small{small}}$
\normalsize (default)$\text{\normalsize{normal}}$
\Large $\text{\Large{large}}$
\LARGE $\text{\LARGE{even larger}}$
\huge $\text{\huge{huge}}$

I highly recommend using the default size... its just text

You have probably noticed, but latex in math mode also removes spaces thus not making it ideal to write normal text. Another thing to notice is that it outputs an image, however it is partly so, this image is dynamically generated and actually does not get saved on our server; it only exists in your browser, hence linking to it from other websites may be a bit harder then you'd expect, and if the outside traffic picks up too much, i will have to block anyone from the outside domain to be able to use this program...

Spaces and Styling:

Spaces are not mandatory, however i encourage my readers to use them to avoid confusion, for example you can write \frac{2}{x} and it will render as $\frac{2}{x}$, however this is fine it still presents a problem, if the fraction is x over 2 then \frac{x}{2} will not work, latex will render the command as fracx and that is not a valid command and hence a problem is due. To avoid confusion i recommend sticking to a good syntax style, such as using popper curly braces and spaces, you can either write that fraction as \frac x2 or using the prototype you should really get used to writing \frac{x}{2} that way you will not have to remember the braces when a complex fraction is due and the fraction or any function for that matter will come out right the first time. On the topic of spaces, i can see that people will ask about newlines and things of that manner. You can actually write text and use newlines and things of that nature. A new line is represented by a \\ and if you needed to write text, you can use the \text{} mode to write it and spaces and such will be used. For example y=\left\lbrace\begin{array}{c c}{2x+5} & \text{if x is less then 1/2} \\ {\pi{x}}^e & \text{if x is more then 1}\end{array}\right. $y=\left\lbrace\begin{array}{c c}{2x+5} & \text{if x is less then 1/2} \\ {\pi{x}}^e & \text{if x is more then 1}\end{array}\right.$ Latex actually provides spacing commands \, \: \; \quad \qquad, those take no arguments and (a\,b\:c\;d\ e\quad f\qquad g) renders as $(a\,b\:c\;d\ e\quad f\qquad g)$

Latex has a couple of fonts, here's how to use them:
\mathnormal - default - $\mathnormal{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathrm - default without italic lower case - $\mathrm{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathit - italic -$\mathit{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathbf - bold - $\mathbf{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathsf - sans serif - $\mathsf{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathtt - mono space - $\mathtt{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathcal - caligraphy - $\mathcal{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathfrak - fraktur - $\mathfrak{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$
\mathbb - blackboard bold - $\mathbb{A B C d e f 1 2 3 \delta \Delta \infty \lceil \rceil}$

you can also choose to bold a symbol (such as a greek symbol)
\boldsymbol
$\boldsymbol{\Delta} \Delta$

also there are times when latex does not render something quite to your personal spacing specifications, sometimes you need to add or subtract a small space to "nudge" things into place, for this they created a set of spaces for "nudging"

\, 3/18th of a quad
\: 4/18
\; 5/18
\! -3/18

the negative space is handy for places like this:
$\left(\begin{array}{c} n \\ r \end{array}\right) = \frac{n!}{r!(n-r)!}$
it looks good, but it could look better
$\left(\!\!\!\begin{array}{c} n \\ r \end{array}\!\!\!\right) = \frac{n!}{r!(n-r)!}$

Brackets, Braces and More:

Ofcourse latex supports every imaginable and unimaginable bracet and brace you can ever imagine, from the simple [] () to over and under braces, and more. The curly brackets have their own symbol, as they are used in the syntax, \lbrace and \rbrace will render as $\lbrace\rbrace[\math]. Also braces brackets and such render as their default size unless they are specified to do differently, so if you have a complex fraction that you need to be bracketed, say [\frac{(\frac{x+3}{7})+5}{3x+8}] will render as [math][\frac{(\frac{x+3}{7})+5}{3x+8}]$ however to actually extend those brackets you can use \left and \right flags to do the job, so with the addition of them \left[\frac{\left(\frac{x+3}{7}\right)+5}{3x+8}\right] $\left[\frac{\left(\frac{x+3}{7}\right)+5}{3x+8}\right]$.

Now as promissed the unimaginable stuff. These things are referred to as math accents, and they include vector signs and things of that nature. So tags like \vec{} \hat{} \tilde{} \dot{} \ddot{} will output as $\vec{x} \hat{x} \tilde{x} \dot{x} \ddot{x}$. If you need an expression under the sign, the developers have also thought about you, the \widevec \widehat \widetilde do just that $\vec{xyz} \hat{xyz} \tilde{xyz}$. Not done yet, also available are \underline{} \overline{} that underline and overline text, as well as \overbrace and \underbrace that make horizontal braces as such $\overbrace{x+2}$. There's more to add though, as the sub and superscript come into play here, using it you can explain expressions such is that a1 a2 .. an are just referred to as ai in the matter, you can write that as \overbrace{a_1,a_2...a_n}^{a_i} $\overbrace{a_1,a_2...a_n}^{a_i}$ with the underbrace remember that you are trying to put stuff under the brace, so use the subscript sign (_) to accomplish the task. Also once again, notice that proper use of brackets is the key, it is easy to make a mistake in the expression, so use the advanced mode preview fearute.
Also available symbols:
\langle and \range $\left\langle xyz\right\rangle$
\| $\left\| xyz\right\|$

[B]Common Math Needs:[/B]
Matixees, use the \begin{matrix} and \end{matrix} to display one
\left[\begin{matrix} a1,1 & a1,2 & ... & a1,n \\ a2,1 & a2,2 & ... & a2,n \\ ..... & ..... & ..... & ..... \\ am,1 & am,2 & ... & am,n \end{matrix}\right]
$\left[\begin{matrix} a1,1 & a1,2 & ... & a1,n \\ a2,1 & a2,2 & ... & a2,n \\ ..... & ..... & ..... & ..... \\ am,1 & am,2 & ... & am,n \end{matrix}\right]$

matrix uses no relimiters
pmatrix ()
bmatrix []
Bmatrix {}
vmatrix |
Vmatrix || ||

example:
A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix}
$A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix}$

like matrices arrays allow you to space your content horizontally as well as vertically, they also allow you to define the lining for it:

\begin{array}{c|c}
1 & 2 \\
\hline
3 & 4
\end{array}

$\begin{array}{c|c} 1 & 2 \\ \hline 3 & 4 \\ \end{array}$

similarly

$\begin{array}{c|c||} \hline 1 & 2 \\ \hline 3 & 4 \\ \hline 5 & 6 \\ \hline \end{array}$

or if you get really creative with them:

$\begin{array}{|r|l|} \hline 7C0 & hexadecimal \\ 3700 & octal \\ \cline{2-2} 11111000000 & binary \\ \hline \hline 1984 & decimal \\ \hline \end{array}$

There is more then a dozen common math symbols recognized in latex:
\arccos $\arccos{\left ( \frac{\pi}{2} \right )}$
\arcsin $\arcsin{\left ( \frac{\pi}{2} \right )}$
\arctan $\arctan{(1)}$
\arg $\arg{\left ( \frac{-1-i}{i} \right )}$
\cos $\cos{(\pi)}$
\cosh $\cosh{(x)}$
\cot $\cot{\left( \frac{3\pi}{2} \right )}$
\coth $\coth{(x)}=\frac{e^{2x}+1}{e^{2x}-1}$
\csc $\csc{(y)}$
\deg $f_m([X])=\deg{f[Y]}$
\det_ $\Delta_{\overline{a}} \det(A)=\overline{a} \times \overline{c}$
\dim $\dim{X}=-1$
\exp $\exp{(x)}=e^x$
\gcd_ $\gcd{(a,}=2 \sum_{k=1}^{a-1} \lfloor kb/a \rfloor +a+b-ab$
\hom $\hom{(X, Y)}$
\inf_ $\inf{\{1,2,3\}}=1$
\ker $\ker{T}:=\{ v \in V: Tv=0_w\}$
\lg $\lg{(2)}=\log_2{(2)}$
\lim_ $\lim_{x \to \infty}{(2x+1)}$
\liminf_ $\liminf_{n \to \infty}{(x_n)}$
\limsup_ $\limsup_{n \to \infty}{(x_n)}$
\ln $\ln{(2)}=\log_{e}{(2)}$
\log $\log{(2)}=\log_{10}{(2)}$
\max_ $\lim_{0 \to 1}\max{(x, 1-x)}dx=\frac{3}{4}$
\min_ $\lim_{0 \to 1}\min{(x, 1-x)}dx=\frac{1}{4}$
\Pr_ no clue when this is used, if someone figures it out, let me know, i will post example
\sec $\sec{(20)}$
\sin $\sin{\theta} = \cos{\left( \frac{\pi}{2} - \theta \right )}$
\sinh $\sinh{(x)}=-i \sin{(ix)}$
\sup_ $\sup{(X_n)}$
\tan $\tan{(x)}$
\tanh $\tanh{(x)}=\frac{\sinh(x)}{\cosh(x)}$
\infty $\infty$

[B]Stuff that didn't fit anywhere else[/B]
\not can be used with other symbols \not\in $\not\in$
\cancel $\cancel{ABC}$
\overset{a}{=} $\overset{a}{=}$
\underset{a}{=} $\underset{a}{=}$
\overrightarrow{abc} $\overrightarrow{abc}$
\overleftarrow{abc} $\overleftarrow{abc}$
\widetilde{abc} $\overwidetilde{abc}$
\widehat{abc} $\overwidehat{abc}$
\overline{abc} $\overline{abc}$
\underline{abc} $\underline{abc}$

\subtrack
$\sum_{\substack{ 0<i<m \\ 0<j<n }} P(i,j)$

more math stuff:
roots:
\sqrt $\sqrt{2}$
root of another power
\sqrt[#] $\sqrt[5]{2}$

\exists - $\exists$
\forall - $\forall$
\neg - $\neg$

brackets:
() \, [] \, \{\} \, || \, \|\| \, \langle\rangle \, \lfloor\rfloor \, \lceil\rceil
$() \, [] \, \{\} \, || \, \|\| \, \langle\rangle \, \lfloor\rfloor \, \lceil\rceil$

You are free to practice latex in this thread: http://hypography.co...ice-ground.html
I will try to answer them as well I can, and eventually others will be able to answer them as well as they can, but it will create only one thread to go to for answers about latex synthax.

Here is a good reference, and this is my reference for some of the things on this page: LaTeX/Mathematics - Wikibooks, collection of open-content textbooks

Thanks for your time, use math v2.0 wisely, and become free in your expression of math...
 Peace

• CraigD, TheBigDog, modest and 2 others like this

### #2 Jay-qu

Jay-qu

Ancora Imparo

• Members
• 6340 posts

Posted 12 May 2006 - 02:03 AM

Excellent, so its all $\omega$orking now

### #3 Qfwfq

Qfwfq

Exhausted Gondolier

• Members
• 6241 posts

Posted 12 May 2006 - 02:17 AM

You mean the alignment is better now?
testing, $X^5$ one two three...
now, how does that look?

Huge! How do we get sizes right?

### #4 alexander

alexander

Dedicated Smart-ass

• Members
• 5722 posts

Posted 12 May 2006 - 04:26 AM

you should use a small case x, that or use \norm before the expression, i will explain more later, when i write up another section of the tutorial, but you can set size with:
\Large $\Large large text$
\normalsize $\normalsize normal text$
\small $\small small text$

### #5 Qfwfq

Qfwfq

Exhausted Gondolier

• Members
• 6241 posts

Posted 13 May 2006 - 03:05 AM

Great, thanx, but woudn't it be better for \norm $\norm normal text$ to be the default?

### #6 Tormod

Tormod

Hypographer

• Members
• 14353 posts

Posted 13 May 2006 - 03:50 AM

Sticking this and rewriting the title slightly.

### #7 alexander

alexander

Dedicated Smart-ass

• Members
• 5722 posts

Posted 13 May 2006 - 07:48 PM

Finally, finished, please post what you want to see in the tutorial and i will add it. Also, Math v2.0 was a catchy name for this stuff, but i guess you made it make more sense...

I just made a practice thread in testing section quick link:
Click here to enter the LaTeX test area
You can use it to practice latex if you would choose to do so, however, and i emphasize this, ASK YOUR QUESTIONS HERE PLEASE, so anyone looking for an answer will have only one thread to refer to.
Thank you for your attention...

### #8 alexander

alexander

Dedicated Smart-ass

• Members
• 5722 posts

Posted 13 May 2006 - 08:10 PM

I attempted to spellcheck the text, it should be mostly ok, so dont point fingers and say "he does not use spellcheck", however you will still not see proper gramar, so pbtt

### #9 Zerg

Zerg

Curious

• Members
• 3 posts

Posted 22 May 2006 - 06:18 AM

I started use LaTeX some time ago, it's great!

### #10 Zerg

Zerg

Curious

• Members
• 3 posts

Posted 22 May 2006 - 06:25 AM

Yep, LaTeX is great thing. Btw., I found one interesting program few days ago on iosoftware.co.uk and tried its trial. It supports LaTeX and visual editing simultaneosely. Though it doesn't support all Latex features, I found it useful in learning LaTeX.

### #11 alexander

alexander

Dedicated Smart-ass

• Members
• 5722 posts

Posted 23 May 2006 - 08:53 PM

there's a bunch of these programs around, the best one i've seen so far was for macs

LaTeX
or go directly here: http://en.wikipedia.org/wiki/LaTeX

under the Editors and IDEs there is a list of programs that will probably make a lot of beginner latex people lives a whole lot easier

### #12 Tim_Lou

Tim_Lou

Explaining

• Members
• 918 posts

Posted 28 June 2006 - 08:21 PM

nice,

v{a} for vector... hmm

$v{a}$

times for cross product

$v{a} \times v{a}$

hmm, bullet for dot product... nice

$\nabla \bullet v{E}=\frac{\rho}{\epsilon_0}$

$H_2+I_2 \leftrightarrow 2HI$

### #13 Erasmus00

Erasmus00

Creating

• Members
• 1561 posts

Posted 28 June 2006 - 08:39 PM

hmm, bullet for dot product... nice

You can use cdot as well. Its a bit smaller.

$v{\nabla} \cdot v{E} = 4\pi\rho$

-Will

### #14 Farsight

Farsight

Understanding

• Members
• 455 posts

Posted 16 November 2006 - 05:30 PM

$t_{crew} = t {\sqrt{1 - v^2 / c^2}$

### #15 snoopy

snoopy

Understanding

• Members
• 261 posts

Posted 21 December 2007 - 06:41 AM

just testing as the testing ground is down

$\setlength{\unitlength}{5cm} \begin{picture}(1,1) \put(0,0){\line(0,1){1}} \put(0,0){\line(1,0){1}} \put(0,0){\line(1,1){1}} \put(0,0){\line(1,2){.5}} \put(0,0){\line(1,3){.3333}} \put(0,0){\line(1,4){.25}} \put(0,0){\line(1,5){.2}} \put(0,0){\line(1,6){.1667}} \put(0,0){\line(2,1){1}} \put(0,0){\line(2,3){.6667}} \put(0,0){\line(2,5){.4}} \put(0,0){\line(3,1){1}} \put(0,0){\line(3,2){1}} \put(0,0){\line(3,4){.75}} \put(0,0){\line(3,5){.6}} \put(0,0){\line(4,1){1}} \put(0,0){\line(4,3){1}} \end{picture}$

hopefully this will work

### #16 Tormod

Tormod

Hypographer

• Members
• 14353 posts

Posted 21 December 2007 - 07:52 AM

Seems to me there is a lot of "font size" etc in your code, I don't think that's supposed to be there.

### #17 snoopy

snoopy

Understanding

• Members
• 261 posts

Posted 21 December 2007 - 08:08 AM

Seems to me there is a lot of "font size" etc in your code, I don't think that's supposed to be there.

yeah it keeps adding that fontsize thing there is none in the code
and im enclosing in latex
like

$y= mx + c$