Do not be afraid of TEX! Easy awesome looking posts HOWTO

Thread Starter

thatoneguy

Joined Feb 19, 2009
6,359
In a few minutes of practice and knowing the common commands shortcuts, make your posts very readable! This forum has the TEX engine built in, using tex tags (use {tex} to start, and {/tex} to end, replace { with [ and } with ], just like using a URL!

In addition to the "Fast pick" symbols to the right of a reply box, there is MUCH more you can do!

There is a drop-down pre-format list when you click on the Ʃ button, to the right of the second button row in the Advanced Editor. This brings up the TeX/LaTeX quick button bar. BTW, it is pronounced "Tech".

If you are not familar with LaTeX, the menu is not intuitive, however, but will be once you see the basics outlined here.

If you refer to this quickref, and use the equations with posts as often as needed, there are only FIVE THINGS you need to remember! You can then type in "fancy" formulas without relying on a click and fill system. When you preview or submit a post, the "code" is automaticallly turned into an image and linked inline with your post, as seen all over below!

The basic concepts: Parameters are held in braces {}, symbols/operators are used with \ preceeding, A few examples are shown below:


  • Subscript: Inside the tex and /tex tags, this is easy. The 'command' is _ . Examples: \( RDS_{ON}, V_{RMS \sim }, I_1\) For the single subscript, such as '1', no braces are needed, i.e. I_1, for more than one character, braces are used, such as RDS_{ON}. Subscripts can be "cascaded" as well, e.g. \(I_{R}_{\small 1}\) If the overall image is too large, use the \small operator right after the opening tex tag.
  • Superscript: This is as easy, and follows the same rules as subscript, but with a different operator. Just like exponent in computer languages, that operator is ^. So to write \(2^2\), Use 2^2 inside tex tags! Simple, eh?
  • If you are squaring or cubing things, you need to "undo" them in formulas. This is done with \sqrt. \sqrt takes one parameter and one optional, the number for the square root, \(\sqrt{192}\). Remember, the full operand needs to be in braces, If I put 192 in the above without braces, it turns out like this: \(\sqrt 192\) That is probably not what you were trying to say. For cube root, the more generic is \sqrt[root]{operand} So for the 4th root of 196, it is written \sqrt[4]{196} which displays as \(\sqrt[4]{196}\) when the tex tags are around that same text. Notice the brackets instead of braces around the root!
  • Logic. This is one area I'd like to see more use. For active low/inverted, use \overline{Val}, \overline{A} produces \(\overline{A}\) Add in \cdot, the standard + sign on keyboard, and you can write any logic in "Textbook Quality". \overline A \cdot \overline B \cdot C + D produces: \( \overline A \cdot \overline B \cdot C + D\). Of course, dots for working with matrices or in formulas such as 2*pi*f or: \(\omega = 2 \cdot \pi \cdot f\). That last part, was written as \omega = 2 \cdot \pi \cdot f. Most greek letters are simply their name with a backslash, such as \Theta - \(\Theta\)
  • An intro wouldn't be complete without Fractions: Many get stuck working with fractions. Simply remember that all commands are "Nestable", and it works out great! Balancing the {} braces can get hairy with a Very complex equation, but it usually isn't that hard. Preview post tells you immediately where something is missing with a little practice.
    Here's the hard part about fractions: \fra or \frac, followed by {over}{under}. \frac{1}{2} = \(\frac{1}{2}\) Shocking! I know. With nesting rules, the parallel resistance equation is fairly straightfoarward: \frac{1}{\frac{1}{R_1}+\frac{1}{R_2}+{\dots}+{\frac{1}{R_N}}} Becomes: \(\fra{1}{\fra{1}{R_1}+\fra{1}{R_2}+{\dots}+{\fra{1}{R_N}}\)

I hope this of some use to you, there are Many More commands and fun formatting available, but the ones above cover most of what is spoken of!

Here's to no more ugly formula questions! :D
 
Last edited:

KL7AJ

Joined Nov 4, 2008
2,229
If TEX did nothing for you but creating snappy-looking math formulas, it would be well worth the time to learn. I've been using LaTeX, the Unix version of TEX (actually the FIRST version) for ages.

Eric
 

Wendy

Joined Mar 24, 2008
22,235
It also allows you to display pictures full size in a post, either from an attachment as in here, or from AAC build in albums.

The url linking feature is another favorite of mine, as shown above. Using brackets "[]"instead of {}, the format is {url=http:your link}your description{/url}.
 

studiot

Joined Nov 9, 2007
4,998
Thanks for these tips, very grateful here.

I've managed to do some simple stuff here with TEX, but had it bomb out several times when trying for something more complex.

There seems to be some line length limit for instance. Any idea what this might be?

The other thing I can't seem to get right is changing some of the characters (eg for super/ sub script) to a smaller size.
Again any ideas welcome.
 

Thread Starter

thatoneguy

Joined Feb 19, 2009
6,359
To make a new line, close the tex tag, and start a tex tag on the next one. Put a \ before each space, since it is in math mode (TeX) rather than LaTeX (Text) mode - As KL7AJ stated, LaTeX was Very widespread and "Standard formatting" for books and newspapers before desktop publishing took over. Some publishers still use LaTeX in addition to postscript.

\large and \small adjust font sizes, as well as several others: \tiny, \footnotesize, \Large, \LARGE, \Huge, \HUGE, \normalsize

^ is superscript and _ is subscript, I usually use \small before RMS - \(V_{\tiny{RMS}}^{\small2}\) - by V_{\tiny{RMS}}^{\small2} with tex tags around it.

\(\mathsf \tiny{This\ is\ tiny}\)
\(\mathsf \footnotesize{This\ is\ footnotesize}\)
\(\small{This\ is\ small}\)
\(\mathsf {This\ is\ normalsize}\)
\(\mathsf \large{This\ is\ large}\)
\(\mathsf \Large{This\ is\ Large}\)
\(\mathsf \LARGE{This\ is\ LARGE}\)
\(\mathsf \huge{This\ is\ huge}\)
\(\mathsf \Huge{This\ is\ Huge}\)
\(\mathsf \HUGE{This\ is\ HUGE}\)

Testing a big TeX block: Everything below is in one tag, works OK:

\(f(z) = \left\{ \begin{array}{rcl}
\overline{\overline{z^2}+\cos z} & \mbox{for}
& |z|<3 \\ 0 & \mbox{for} & 3\leq|z|\leq5 \\
\sin\overline{z} & \mbox{for} & |z|>5
\end{array}\right
\
\left( \begin{array}{cc} 2\tau & 7\phi-32\theta \\
3\psi & \frac{\pi}8 \end{array} \right)
\left( \begin{array}{c} x \\ y \end{array} \right)
\mbox{~and~} \left[ \begin{array}{cc|r}
3 & 4 & 5 \\ 1 & 3 & 729 \end{array} \right]\)

--ETA: Simply quote this post to see the formatting if it is confusing!
That last two equations in the length test are from the reference Symbols.pdf posted above.
 
Last edited:

Thread Starter

thatoneguy

Joined Feb 19, 2009
6,359
Remember: TeX is Case Sensitive. \ theta and \Theta are not the same! One is the capital greek letter \(\Theta\) (Theta) and the other is the small \(\theta\) (theta) Same for Omega/omega \(\Omega\ \omega\), etc...
 

someonesdad

Joined Jul 7, 2009
1,583
I'm new to AAC and I think it's fabulous that it supports TeX in posts. The ability to get the Greek letters commonly used by clicking at the right of the editing window is super too.

I used LaTeX about 8 or 10 years ago and liked it. However, I always found it a bit of a pain to find and get the necessary things downloaded and installed to get things working, especially on Windows. Thus, I find I use Open Office Writer almost exclusively now and it allows me to easily include the math stuff I want. Its equation editor will seem a bit familiar if you're used to TeX or LaTeX, but not quite as powerful. However, it has been adequate for all my needs. Open Office also comes with a pretty good drawing program for making pictures, as well as a spreadsheet and presentation program that has always been able to open its Microsoft counterparts' files.

Here's a brief introduction to some of OO Writer's math capabilities and here's the updated cheatsheet I keep next to my computer to help me remember things I can't remember.
 

John Luciani

Joined Apr 3, 2007
477
I used LaTeX about 8 or 10 years ago and liked it. However, I always found it a bit of a pain to find and get the necessary things downloaded and installed to get things working, especially on Windows.
Have you tried MiKTeX? I haven't used Windows for six years but when I did MiKTeX
worked quite well.

On Linux I download the TeXLive distribution. I am not sure if that plays nice with
Windows.

(* jcl *)
 

Thav

Joined Oct 13, 2009
82
Use a pair of double backslashes to create newlines in a single tag.

For example:

i_C = C \dot {v_C} \\
v_L = L \dot {i_L}

in tags gives...

\(
i_C = C \dot {v_C} \\
v_L = L \dot {i_L}
\)

Without the slashes you get...

\(
i_C = C \dot {v_C}
v_L = L \dot {i_L}
\)
 

Dave

Joined Nov 17, 2003
6,970
Use a pair of double backslashes to create newlines in a single tag.

For example:

i_C = C \dot {v_C} \\
v_L = L \dot {i_L}

in tags gives...

\(
i_C = C \dot {v_C} \\
v_L = L \dot {i_L}
\)

Without the slashes you get...

\(
i_C = C \dot {v_C}
v_L = L \dot {i_L}
\)
That's a good one, I wasn't aware of that. Thanks.

Dave
 

Thav

Joined Oct 13, 2009
82
No problem! I use it when writing in LaTeX and it happened to work here. Now what we really need is some additional commands defined. I use these in my LaTeX documents.

\newcommand{\dx}[1]{\mathrm{d}#1}
\newcommand{\ddt}{\frac{\mathrm{d}}{\dx{t}}}
\newcommand{\dxdt}[1]{\frac{\dx{#1}}{\dx{t}}}
\newcommand{\dxdy}[2]{\frac{\dx{#1}}{\dx{#2}}}

These make the "d"s not italicized so it's more clear they are not variables, but the differentiation operator. That would allow us to write say...

\dx{v}
\ddt
\dxdt{v}
\dxdy{v}{l}

and end up with

\(
\mathrm{d}v \\
\frac{\mathrm{d}}{\mathrm{d}t} \\
\frac{\mathrm{d}v}{\mathrm{d}t} \\
\frac{\mathrm{d}v}{\mathrm{d}l}\)
 

studiot

Joined Nov 9, 2007
4,998
Someone really knows his Latex.

Can we please please persuade you to write a dummies guide?

I'd really love to be able to do some of this, eg layout fractions, superscipt and subscript easily.
 
Top