LyX ⇒ Figure with label key
Figure with label key
Hey,
my problem is that I want to add a figure with automatic numeration and a label. So I tried the floating object because it has the automatic numeration and a label key, but this object seem not to stay on a specific location if I add some more stuff. So is there a solution to fix this object, or the other way around, why is there no label and numeration feature for the normal figure object ???
cheers
my problem is that I want to add a figure with automatic numeration and a label. So I tried the floating object because it has the automatic numeration and a label key, but this object seem not to stay on a specific location if I add some more stuff. So is there a solution to fix this object, or the other way around, why is there no label and numeration feature for the normal figure object ???
cheers
NEW: TikZ book now 40% off at Amazon.com for a short time.

Figure with label key
Hi,
That's the LaTeX code. You'll have to figure out how to implement this code using LyX.
Who says there is no such thing? Take a look at the following example:xray wrote: ...why is there no label and numeration feature for the normal figure object ???
Code: Select all
\documentclass{article}
\usepackage{caption}
\begin{document}
\noindent\begin{minipage}{\textwidth}
\centering
\rule{5cm}{3cm} % to simulate an actual image
\captionof{figure}{this is a non-floating figure with a caption an a label.}
\label{fig:test}
\end{minipage}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Figure with label key
Ok, nice. But I thought lyx exists because people don't wont to use latex code. So is there a way to fix a floating figure, with a simple command ? This would be the easiest because this object still has a label and auto numeration without knowing about latex code.
thanks
thanks
-
- Posts: 162
- Joined: Wed Jun 17, 2009 10:18 pm
Figure with label key
Sure it is, but there is a limit to what you can do with LyX. This may well be one thing that you cannot do with the graphical interface in LyX alone, and thus some LaTeX-code is required.xray wrote:But I thought lyx exists because people don't wont to use latex code.
One way of achieving this in LyX is the following:
- Go to Document --> Settings --> LaTeX Preamble, and add the line
Code: Select all
\usepackage{caption}
- Where you want a figure, insert first the code by hitting Ctrl + L, and typing the code in the box. Immediately after that, insert a minipage, by choosing Insert --> Box.
Code: Select all
\noindent
- To center the figure, put the text marker in the box, and click the Paragraph settings-button on the toolbar, where you choose centering.
- Insert the image as usual, via toolbar or menu.
- Add the caption by inserting code: Hit Ctrl + L and type
where "figure" is the type of float.
Code: Select all
\captionof{figure}{This is the caption}
- Add a label by choosing Insert --> Label, which will allow you to reference it later.
Figure with label key
You may also provide an example .lyx file containing some text and figures that show the problem you're having with it.xray wrote:Ok, nice. But I thought lyx exists because people don't wont to use latex code. So is there a way to fix a floating figure, with a simple command ? This would be the easiest because this object still has a label and auto numeration without knowing about latex code.
thanks
Re: Figure with label key
Thanks a lot torbjorn, this works!
cheers
cheers
-
- Posts: 162
- Joined: Wed Jun 17, 2009 10:18 pm
Figure with label key
Glad to be of assistance.
Now that the problem is solved, you can mark the thread as such, by editing the original post, and selecting the green check mark as post icon. (As mentioned in the board rules, section 3.)
Now that the problem is solved, you can mark the thread as such, by editing the original post, and selecting the green check mark as post icon. (As mentioned in the board rules, section 3.)
Re: Figure with label key
I can't edit my original post, there's only a 'edit' button for the last post I made here.