tags:

views:

94

answers:

3

Two (hopefully quick) questions about LaTeX:

  1. How do you number select functions? I'm working in a documentclass{article}, if that matters. I want to have certain functions numbered such as

    function1  
    function2 (1)  
    function3  
    function4 (2)
    
  2. How do you make a sign to evaluate an integral? I know how to do brackets, but is it possible to only make one straight light to the right of the function with the bounds of integration? I can't figure out how to do that.

+3  A: 

I did what you asked in LyX and exported to LaTex:

\begin{document}
\L{\begin{equation}

\int_{0}^{1}x^{2}=\left.\frac{1}{3}x^{3}\right|_{0}^{1}=\frac{1}{3}\end{equation}
}

\L{\[
a=b+c\]
}

\L{\begin{equation}
1+1=2\end{equation}
}
\end{document}

Edit: Oh, and while you didn't ask - check out Detexify, since you'll definitely need to look up symbols in the future :)

Amir Rachum
+6  A: 

The answer to 1.

\begin{eqnarray}
function1  \nonumber \\
function2            \\
function3  \nonumber \\
function4 
\end{eqnarray}

The answer to 2.

$\left. \frac 12 \right|_1^2$
hanno
eqnarray environments really oughtn't be used -- as noted in the AMS Short Math Guide (ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf), they "produce inconsistent spacing of the equal signs and make no attempt to prevent overprinting of theequation body and equation number."Your solution works great if you use an align environment instead though!
TJ Ellis
+1  A: 

If you wish to add a note to a piece of text, such that it renders something like the following:

The fox[1] jumped over the fence
...

[1] A fox is a clever mythical creature

then you can use the \footnote{} command, like so:

The fox\footnote{A fox is a clever mythical creature} jumped over the fence

If you wish to number an equation so you can refer to it later in your text, such that it renders something like the following:

    f(x,y)=3π    (1)

is numbered 1.

then you can use the \equation{} environment with a \label:

\begin{equation}
\label{f}
f(x,y)=3\pi
\end{equation}
is numbered \ref{f}.

Lastly, as for integration:

\[\int \frac{sin(x)}{cos(x)}dx\]
from 0 to 1,
\[\left.\frac{sin(x)}{cos(x)}\right|_0^1\]
wilhelmtell
Explicitly labeling the equations is probably what I would do too -- as Wilhelm says, it allows you to refer back to them automatically, which is convenient, and works even when all of the equations are right after one another (though they are in your example, this is good to know for future reference!)
TJ Ellis