Some Latex Commands

soroban

Math Team
Dec 2006
3,267
408
Lexington, MA
In case the Latex tutorial doesn't have a list of commands,
here are some of my favorites.


\(\displaystyle \begin{array}{cc}
\backslash\text{pi} & \pi \\
\backslash\text{phi} & \phi \\
\backslash\text{equiv} & \equiv \\
\backslash\text{approx} & \approx \\
\backslash\text{perp} & \perp \\
\backslash\text{parallel} & \parallel \\
\backslash\text{cdots} & \cdots \\
\backslash\text{vdots} & \vdots \\
\backslash\text{circ} & \circ \\
\backslash\text{bullet} & \bullet \end{array}\)\(\displaystyle \begin{array}{cc}
\backslash\text{emptyset} & \emptyset \\
\backslash\text{cup} & \cup \\
\backslash\text{cap} & \cap \\
\backslash\text{subset} & \subset \\
\backslash\text{supset} & \supset \\
\backslash\text{vee} & \vee \\
\backslash\text{wedge} & \wedge \\
\backslash\text{flat} & \flat \\
\backslash\text{sharp} & \sharp \\
\backslash\text{natural} & \natural \end{array}\)\(\displaystyle \begin{array}{cc}
\backslash\tex{langle} & \langle \\
\backslash\text{rangle} & \rangle \\
\backslash\text{in} & \in \\
\backslash\text{sim} & \sim \\
\backslash\text{to} & \to \\
\backslash\text{boxdot} & \boxdot \\
\backslash\text{uparrow} & \uparrow \\
\backslash\text{rightarrow} & \rightarrow \\
\backslash\text{downarrow} & \downarrow \\
\backslash\text{leftarrow} & \leftarrow \end{array}\)\(\displaystyle \begin{array}{cc}
\backslash\text{s{q}rt\{3x\}} && \sqrt{3x} \\ \\
\backslash\text{frac\{2x\}\{3y\}} && \frac{2x}{3y} \\ \\ \\
\{\text{9 choose 3}\} && {9\choose3} \\ \\ \\
\backslash\text{overline\{AB\} } && \overline{AB} \\
\backslash\text{vec\{AB\}} && \vec{AB} \\
\backslash\text{hat\{AB\}} && \hat{AB} \\ \\
\backslash\text{cancel\{3ab\}} && \cancel{3ab} \end{array}\)
 
  • Like
Reactions: 2 people
Jul 2010
12,211
522
St. Augustine, FL., U.S.A.'s oldest city
Instead of {9 \choose 3} I've been using \binom{9}{3} and for \overline{x} I use \bar{x}. :D

I wrote yours on the left and mine on the right:

\(\displaystyle {9 \choose 3}=\binom{9}{3}\)

I prefer the output on the left!

\(\displaystyle \overline{x}=\bar{x}\)

These look the same.

Another one I use is \therefore \(\displaystyle \therefore\)

I prefer exponents to be smaller using the \tiny{x} and \small{x} commands:

\sin^{\tiny{-1}}(x): \(\displaystyle \sin^{\tiny{-1}}(x)\)

\sin^{\small{-1}}(x): \(\displaystyle \sin^{\small{-1}}(x)\)

\sin^{-1}(x): \(\displaystyle \sin^{-1}(x)\)

However, sometimes and seemingly arbitrarily, this makes the rest of the expression smaller too, and I can't figure out why! :?

Also, when enclosing a "tall" expression within parentheses (and other bracketing symbols), it doesn't look good with:

(\frac{3x^2}{2y^3}): \(\displaystyle (\frac{3x^2}{2y^3})\)

However, some sites will suggest:

\left(\frac{3x^2}{2y^3}\right): \(\displaystyle \left(\frac{3x^2}{2y^3}\right)\)

But, I've found an alternative (I notice others use it as well) that I prefer:

\(\frac{3x^2}{2y^3}\): \(\displaystyle \(\frac{3x^2}{2y^3}\)\) (Notice it is almost as tall as the preceding, but not as dark)

However, I've noticed when the expression is quite long, this shortcut doesn't always work, so then I put in the "left" and "right" and it works, although the bracketing symbols sometimes appear too dark or heavy. :?

I use the \text{} command for units:

3\text{ km}: \(\displaystyle 3\text{ km}\)

a = 3.4\text{ \frac{m}{s^2}}: \(\displaystyle a = 3.4\text{ \frac{m}{s^2}}\)

soroban, I would be interesting in hearing about your use of spacing and alignment! 8)
 
Apr 2011
782
1
USA
MarkFL said:
Also, when enclosing a "tall" expression within parentheses (and other bracketing symbols), it doesn't look good with:

(\frac{3x^2}{2y^3}): \(\displaystyle (\frac{3x^2}{2y^3})\)

However, some sites will suggest:

\left(\frac{3x^2}{2y^3}\right): \(\displaystyle \left(\frac{3x^2}{2y^3}\right)\)

But, I've found an alternative (I notice others use it as well) that I prefer:

\(\frac{3x^2}{2y^3}\): \(\displaystyle \(\frac{3x^2}{2y^3}\)\) (Notice it is almost as tall as the preceding, but not as dark)

However, I've noticed when the expression is quite long, this shortcut doesn't always work, so then I put in the "left" and "right" and it works, although the bracketing symbols sometimes appear too dark or heavy.
I was gonna say, I saw you do this and I tried it and it didn't work. What is "quite long"? I use a backslash-space to making spacings between things a lot, and a lone \ almost makes me think of a space, so knowing me, I'd get confused. :lol:
 
Jul 2010
12,211
522
St. Augustine, FL., U.S.A.'s oldest city
Erimess said:
...
What is "quite long"?...
I usually run into it when evaluating definite integrals and let the latex stretch across the screen to the point where those with older CRT displays with 4:3 ratio truncate the text...about 61 characters of regular text in width. :D

I just always use the preview option to make sure everything looks right, and if it doesn't, then I scramble to make it right, whatever I have to do. :lol:
 
  • Like
Reactions: 1 person
Apr 2011
782
1
USA
Hmm, I don't think I've done any "tall" stuff (in my case, just fractions) that were that big, but it still didn't work. But I have trouble with \cdot sometimes too - I think especially when there's parenthesis or fractions involved. I forget cause I tend to avoid it.

And yes, I preview everything. No way would I ever trust everything came out right. In fact, 95% of the time I manage to screw up at least one thing. :lol:
 
Jul 2010
12,211
522
St. Augustine, FL., U.S.A.'s oldest city
Erimess said:
...In fact, 95% of the time I manage to screw up at least one thing. :lol:
Me too! :lol:

I use the preview after just about every line so that I don't have a whole page of errors to correct at once! :mrgreen:
 
Sep 2010
101
0
Now when there is LaTeX thread, how do you insert new lines in text or expression?
 
Jul 2011
17
0
^ I wonder that too. Also, how do you make it aligned? \begin{aligned} ... \end{aligned} didn't work for me earlier.
 

greg1313

Forum Staff
Oct 2008
8,008
1,174
London, Ontario, Canada - The Forest City
\begin{align*} . . . &= . . . \\ . . . &= . . . \end{align*}

\(\displaystyle \begin{align*} . . . &= . . . \\ . . . &= . . . \end{align*}\)
 
Jul 2011
17
0
greg1313 said:
\begin{align*} . . . &= . . . \\ . . . &= . . . \end{align*}

\(\displaystyle \begin{align*} . . . &= . . . \\ . . . &= . . . \end{align*}\)
Yep, that works! Thank you!