Displaying equations using Tex

Yes. I wasn't sure about that until I tried, and I was glad to see that it ignores the layout.
It makes coding continued fractions (and matrices, and other layered equations) much easier.
 
$$There \hspace{3} has \hspace{3} to \hspace{3} be \hspace{3} a \hspace{3} better \hspace{3} way \hspace{3} of \hspace{3} doing \hspace{3} spaces \hspace{3} than \hspace{3} this.$$

Code:
There \hspace{3} has \hspace{3} to \hspace{3} be \hspace{3} a \hspace{3} better \hspace{3} way \hspace{3} of \hspace{3} doing \hspace{3} spaces \hspace{3} than \hspace{3} this.

$$\mbox{Never mind, found one. You use an "mbox" function.}$$

Code:
\mbox{Never mind, found one. You use an "mbox" function.}

$$You \ can \ also \ use \ a \ single \ backslash \ for \ a \ space. \\ And \ a \ double \ backslash \ for \ a \ linebreak \ if \ you \ don't \ want \ to \ use \ the \ mbox \ function.$$

Code:
You \ can \ also \ use \ a \ single \ backslash \ for \ a \ space. \\ And \ a \ double \ backslash \ for \ a \ linebreak \ if \ you \ don't \ want \ to \ use \ the \ mbox \ function.

$$\fbox{\mbox{You can also make your text framed by using an "fbox", like this.}}$$

Code:
\fbox{\mbox{You can also make your text framed by using an "fbox", like this.}}

Hope all that helps someone.
 
Last edited:
*bump*
This thread is linked in the subforum FAQ, but the FAQ isn't stickied any more (what happened?)

Perhaps this thread could be stickied on its own?
I don't think the Alpha rules threads are used any more, so they could maybe be unstickied if the top area is feels cluttered.

Anyway... having some difficulties with formatting. According to the tutorial page, this:
\displaystyle f(x)=\int_{-\infty}^x e^{-t^2}dt​
...should render as:

mathtex.cgi


, but instead, I get:

$$\displaystyle f(x)=\int_{-\infty}^x e^{-t^2}dt$$

Not quite the same... see the position of the integral bounds?
The \displaytyle tag seems to do nothing.

It's not a big problem, but it makes this look a bit clunky:

$$\begin{align}
\frac{25x^2}{9}+y^2 &= 25 \\
(dc')^2 &= (dx)^2 + (\frac{dy}{\gamma})^2 \\
c' &= 4\int_{x=0}^{x=3}dc'
\end{align}$$

btw... to align equations like that, do this:
Code:
\begin{align}
... &= ... \\
... &= ... \\
... &= ...
\end{align}

The double backslashes mark a new line, and the ampersands tell it where to align each line.
 
Last edited:
Got it. The details of where the limits go seem to be in the details of the implementation, but \displaystyle is the default style which is why it doesn't seem to do anything.

To explicitly dictate where the bounds or limits go, put \limits or \nolimits immediately after the \int, \sum, or whatever:

\int\limits_0^1 gives: $$\int\limits_0^1$$

\int\nolimits_0^1 gives: $$\int\nolimits_0^1$$
 
Can we sticky this thread?

Reminder to self: how to do limits

\lim_{n \rightarrow \infty }

$$\lim_{n \rightarrow \infty }$$

\lim_{n \rightarrow infty \\ m \rightarrow 0}

$$\lim_{n \rightarrow \infty \\ m \rightarrow 0}$$
 
Last edited:
Fun fact!
You can make simple diagrams in tex using the \picture tag.
In a picture tag, you can place any tex element at a specific location, and draw lines and circles/ellipses/arcs.
Check the picture section of the mimetex manual

Example 1:
\picture(100) {
(50,50){\circle(99)} %%head%%
(20,55;50,0;2){\fs{+1}\hat\bullet} %%eyes%%
(50,40){\bullet} %%nose%%
(50,35){\circle(50,25;34)} %%upper lip%%
(50,35){\circle(50,45;34)} %%lower lip%% }
$$\picture(100) {
(50,50){\circle(99)} %%head%%
(20,55;50,0;2){\fs{+1}\hat\bullet} %%eyes%%
(50,40){\bullet} %%nose%%
(50,35){\circle(50,25;34)} %%upper lip%%
(50,35){\circle(50,45;34)} %%lower lip%% }$$​

Example 2:
\picture(600,100){
%% Number line %%
(0,50){\line(600,0)}
(50,40;100,0;6){\line(0,15)}
(c50,30){0}
(c150,30){10}
(c250,30){20}
(c350,30){30}
(c450,30){40}
(c550,30){50}

%% Data points %%
(c110,60){\bullet}
(c170,60){\bullet}
(c200,60){\bullet}
(c230,60){\bullet}
(c290,60){\bullet}

%% Mean %%
(200,45){\line(0,-10)}
(200,45){\line(-3,-5)}
(200,45){\line(3,-5)}
(c200,25){\small{\textit{mean}}}

%% Standard deviation %%
(140,75){\line(120,0)}
(140,75){\line(5,3)}
(140,75){\line(5,-3)}
(260,75){\line(-5,3)}
(260,75){\line(-5,-3)}
(c200,85){\small{\textit{standard deviation}}}
}
$$
\picture(600,100){
%% Number line %%
(0,50){\line(600,0)}
(50,40;100,0;6){\line(0,15)}
(c50,30){0}
(c150,30){10}
(c250,30){20}
(c350,30){30}
(c450,30){40}
(c550,30){50}

%% Data points %%
(c110,60){\bullet}
(c170,60){\bullet}
(c200,60){\bullet}
(c230,60){\bullet}
(c290,60){\bullet}

%% Mean %%
(200,45){\line(0,-10)}
(200,45){\line(-3,-5)}
(200,45){\line(3,-5)}
(c200,25){\small{\textit{mean}}}

%% Standard deviation %%
(140,75){\line(120,0)}
(140,75){\line(5,3)}
(140,75){\line(5,-3)}
(260,75){\line(-5,3)}
(260,75){\line(-5,-3)}
(c200,85){\small{\textit{standard deviation}}}
}$$​
 
$$\\frac{\alpha ^e \infty ^{1/\mu }}{\frac{\pi }{e}}\leq \int_{\psi }^{\sigma } \zeta \, d\gamma$$

$$\Large \frac{\alpha ^e \infty ^{1/\mu }}{\frac{\pi }{e}}\leq \int_{\psi }^{\sigma } \zeta \, d\gamma$$

Makes perfect sense!

$$\\frac{(2.54 \text{cm}) (5280 \text{ft}) (12 \text{in}) \text{km} m \text{mi}}{(100 \text{cm}) \text{ft} \text{in} (1000 m) \text{mi}}$$

$$\Large \frac{(2.54 \text{cm}) (5280 \text{ft}) (12 \text{in}) \text{km} m \text{mi}}{(100 \text{cm}) \text{ft} \text{in} (1000 m) \text{mi}}$$
 
Last edited:
Fun fact!
You can make simple diagrams in tex using the \picture tag.



$$\picture(100) {
(50,50){\circle(99)} %%head%%
(20,55;50,0;2){\fs{+1}\hat\bullet} %%eyes%%
(50,40){\bullet} %%nose%%
(50,35){\circle(50,25;34)} %%upper lip%%
(50,35){\circle(50,45;34)} %%lower lip%% }$$


That looks like a demented ear-less Mickey. :)

Pretty cool.
 
$$\frac{T}{\tau}=\frac{1}{\sqrt{1-\frac{v^2}{c^2}}}$$


$${T}=\frac{\tau}{\sqrt{1-\frac{v^2}{c^2}}}$$
 
Problem:
The forum software adds an untyped space after 50 consecutive non-whitespace characters starting with a backslash (except in
Code:
 blocks?):
\123456789012345678901234567890123456789012345678901234567890

This can cause problems with tex:
[code]\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda
$$\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda\lambda$$

Solution: Add whitespace.
Code:
\lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda
$$\lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda \lambda$$
 
Back
Top