Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-02-07 09:09:21

richyinnewcastle
Member
Registered: 2007-02-07
Posts: 4

Latex help

I am currently writing my final year project for university in latex.. and whilst I have picked it up quite well I have come up against something which no amount of googling can help me with!

I have quite a few examples in my project which involve formula, but whilst I do not want label them as equations, im using the displaymath function, i want to be able to label the example itself so it can be referenced later.. so for example tongue pardon the pun, i want an output like this:


""This can be shown below.

Example                          [1.1]

y = mx +c

As can be seen in example 1.1 ..""

That sort of thing.. I am hoping that someone knows how to define things that aren't an equation, or a figure etc in the same way you would normally say

\begin{equation}
y= mx + x
\label{eqn:easy}
\end{equation}

then reference in the usual way!

If anyone could help i would be really grateful..

thanks

richy.

Offline

#2 2007-02-07 09:51:35

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: Latex help

Maybe the mbox command might help. For example,

y=mx+c\mbox{ is the equation of a straight line.}

Is that what you were looking for?

We have a very good LaTeX tutorial in this topic. That's what I used to come up with that answer, so if you need anything else, I suggest you read that.


Why did the vector cross the road?
It wanted to be normal.

Offline

#3 2007-02-07 10:09:52

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,588

Re: Latex help

Instead of mbox, I'm gonna try the slash space and see what happens.
Click on LaTex to see the equation on this forum.



Last edited by John E. Franklin (2007-02-07 10:11:44)


igloo myrtilles fourmis

Offline

#4 2007-02-07 10:17:52

richyinnewcastle
Member
Registered: 2007-02-07
Posts: 4

Re: Latex help

no i want to be able to give an example a reference so that i can refer to it..

so i can say, as shown in example \ref{example:easy} or something like that then the output to be as shown in example 1.1 ....

hrmm

Offline

#5 2007-02-07 10:25:44

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: Latex help

this forum doesnt support all LaTeX functionality, not even all the math stuff is supported, although most of it is, so i dont think youll get much help about this side of LaTeX unless someone is an avid user of it, i tried querying a friend who is quite good with LaTeX but he isnt responding

(wooh newcastle big_smile i do hope newcastle is referring to newcastle upon tyne tongue )

Last edited by luca-deltodesco (2007-02-07 10:26:28)


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#6 2007-02-07 10:35:48

Dross
Member
Registered: 2006-08-24
Posts: 325

Re: Latex help

LaTeX will let you create your own floats. You define them in your preamble, and can label & refference them with the \label{...} and \ref{...} tags as usual. You define your floats (as many as you want to use) in the preamble of the document in the following way:

1) First, you want to put in \usepackage{float}.
2) Define the float style you want to use (this will be used for all subsequent floats you create, until you change it). The default (if you define no style) is plain, but there is also boxed and ruled, the last of which I think looks by far the nicest. Define it with \floatstyle{stylename}.
3) Now you actually define your float, by typing \newfloat{name}{place specifier}. "name" is, surprisingly, the name of your custom float, and the place specifier is like you'd use on drawings - h for here, b for bottom of page and t for top of page... and a few others I think.

Now you can use your float with the \begin{...} and \end{...} tags. You should give your floats a caption (\caption{describe float etx}) or you won't be able to reference them. For example, the following gives a demo file:

\documentclass{article}

\usepackage{float}

\floatstyle{ruled}
\newfloat{Example}{h}

\begin{document}

Here is the document. As you can see, it has many interesting features.

\begin{Example}
$V = \frac{4}{3}\pi r^3$\\
$A = \pi r^2$
  \caption{Some interesting equations}
  \label{Example:csEqns}
\end{Example}

You can clearly see in example~\ref{Example:csEqns} that I know what I'm talking about
and should blatantly get a first etc.

\end{document}

If there's more info you need just ask, or try googling "custom floats" or... something. Hope this helps.

Last edited by Dross (2007-02-07 10:42:37)


Bad speling makes me [sic]

Offline

#7 2007-02-07 10:44:22

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: Latex help

go Dross tongue


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#8 2007-02-07 11:06:20

richyinnewcastle
Member
Registered: 2007-02-07
Posts: 4

Re: Latex help

absolute legend, if your ever in newcastle i owe you a pint smile

Last edited by richyinnewcastle (2007-02-07 11:10:29)

Offline

#9 2007-02-07 11:07:37

richyinnewcastle
Member
Registered: 2007-02-07
Posts: 4

Re: Latex help

and yes it is newcastle upon the tyne haha altho the joyous place that introed me to latex is durham.. so close enough lol thanks again, thats really great

Offline

#10 2007-02-07 22:41:28

Dross
Member
Registered: 2006-08-24
Posts: 325

Re: Latex help

Now there's a funny thing - I was in Aidan's collage until not that long ago!


Bad speling makes me [sic]

Offline

#11 2007-02-08 09:35:21

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: Latex help

I must say, I love a good beerware program.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

Board footer

Powered by FluxBB