You are not logged in.
Pages: 1
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 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
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
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
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
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 i do hope newcastle is referring to newcastle upon tyne )
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
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
go Dross
The Beginning Of All Things To End.
The End Of All Things To Come.
Offline
absolute legend, if your ever in newcastle i owe you a pint
Last edited by richyinnewcastle (2007-02-07 11:10:29)
Offline
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
Now there's a funny thing - I was in Aidan's collage until not that long ago!
Bad speling makes me [sic]
Offline
Pages: 1