Formatting Math Equations (TeX / LaTeX)One of the, perhaps more ominous formatting options is TeX / LaTex which is supported by TNS, as well as many other scientific websites. It allows the formatting of mathematical arguments beyond what you can do with basic superscripts and subscripts, and text characters. For example, one can use mathematical symbols to create fractions, sums, integrals, square roots, cubed roots, vectors, and etc.
Each implementation of TeX may have a few quirks, so I will add a few tricks that I have found useful for working with TeX on TNS, but would encourage each person to experiment to find formats they are comfortable with.
However, once you know a few basic commands and syntax, then it is easy to search on the web for additional, or more specific commands.
To start writing in TeX, you select the
LaTex icon above the edit window.
This will create the basic BB code structure:
[tex]...[/tex]Most of the TeX commands will begin with a backslash
"\", followed by a command such as
frac, followed by one or more arguments in curly brackets
{...}. If it doesn't work, first check that your backslash is going in the right direction
"\", which is opposite than the BB code
[/tex]Ok, say you want to start with a basic fraction,
.
You find the
\frac TeX function takes two arguments
{numerator}{denominator}.
Put it all together,
[tex]\frac{x}{y}[/tex], and you have your first TeX function
.
Now, say you wish to do powers. For example, using BB code, you can write
X^{2m} as
X[sup]2m[/sup].
In TeX, the
"^" symbol is used to denote superscripts, and the
"_" symbol to denote subscripts.
So, you put it together, and you end up with:
[tex]X^2m[/tex], and discover that you've failed, ending up with
, having lost the m
^{th} power.
To remedy this situation, add an extra set of curly brackets
{} to denote the range that is superscripted.
[tex]X^{2m}[/tex], creating
.
Now, you can start combing TeX functions. So, if you wanted to combine
with the fraction earlier, you just add it to the arguments.
[tex]\frac{X^{2m}}{Y}[/tex], creating
Some of the common TeX functions you may use include (ignoring the BB code)
[tex]...[/tex]Symbol  Function  Example  Produces 
^  Superscript  X^{2m}  

_  Subscript  H_2O  

\frac  Fraction  \frac{x}{y}  

\sqrt  Square Root  \sqrt{xy}  

\sqrt  Cubed Root  \sqrt[3]{xy}  

\sum  Sum  \sum\limits_{i=1}^n {3i}  

\int  Integral  \int_1^\infty\frac{1}{x^2} dx  

\vec  Vector  \vec{xy}  

\rightharpoon  Vector  \rightharpoon\atop{ab}  

\rightharpoon\atop\leftharpoondown  Equilibrium  A{\rightharpoon\atop\leftharpoondown}B  

   

You may have noticed that all of the TeX characters are in script. That may or may not be acceptable for your work. There are a couple of solutions. I often mix TeX and nonTex script together to get the effect that I want.
For example, when writing Helium.
, one might not desire the script, so rather one might choose to write it in mixed text formatting,
He, Tex:
[tex]^4_2[/tex]He.
The Functions,
\mathrm,
\textrm, &
\text in TeX may also create a similar style. However, they can be a bit quirky. With helium, above, one gets
[tex]\text{^4_2He}[/tex], displaying
, but the vertical spacing is still suboptimal.
Unfortunately, the
\text (and related) functions can create odd results with spaces and repeated characters. You may be able to work around it, but it may also be easier to combine the normal and TeX formatting.
For example, consider Water H
_{2}O, in TeX
[tex]H_2O[/tex], giving
. To attempt to get rid of the script, one might try:
[tex]\text{H_2O}[/tex], producing
, somehow producing a phantom O, and no subscript [xx(]. In an attempt to remedy it, one might try using the
\text command twice,
[tex]\text{H}_2\text{O}[/tex], producing
, with a good subscript, but an extra space. It does, in fact, produce the desired water molecule when one adds an extra pair of curly brackets
[tex]\text{H{_2}O}[/tex], producing the desired
Anyway, it never hurts to check your work as you develop your own style.