Graphics, Figures & Tablesfigure float adjustments

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
assafwe
Posts: 33
Joined: Sun Oct 04, 2009 2:27 pm

figure float adjustments

Post by assafwe »

Hi,

I'm trying to insert an EPS file as a figure float into the LyX editor. I succeed in doing this, but it doesn't look nice enough; Is there any recommended way to know how to adjust the figure to the text?

Thanks a lot,

Assaf

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

figure float adjustments

Post by fatra2 »

Hi there,

When you say "adjust the figure to the text", do you mean that you would want to adjust the size of the figure??? It would much easier to help you with a copy of the code you are using. But here goes nothing:
  • First create a figure environment, with the caption and label if you feel like it

    Code: Select all

    \begin{figure}
    \caption{this is my caption}
    \label{fig:my_fig}
    \end{figure}
  • Then, include your .eps file
    \begin{figure}
    \includegraphics{my_eps_file}
    \caption{this is my caption}
    \label{fig:my_fig}
    \end{figure}
  • Your .eps file will be displayed on 100% scale. If you want to change the size of its display, just add the option
    \begin{figure}
    \includegraphics[width=\textwidth]{my_eps_file}
    \caption{this is my caption}
    \label{fig:my_fig}
    \end{figure}
    which will diplay the .eps file to the width of the text. You can choose to specified the height of your file with the option \includegraphics[height=0.2\textheight]{my_eps_file}
Hope this helps

Cheer
assafwe
Posts: 33
Joined: Sun Oct 04, 2009 2:27 pm

Re: figure float adjustments

Post by assafwe »

Thanks so much!
the only thing is that I'm using LyX, not LaTeX editor.. is there any way of inerting LaTeX source code in LyX?

Tnx,

Asaf
fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

figure float adjustments

Post by fatra2 »

Hello,

Inserting LaTeX code in your file simply means write these lines where you write your text document. When you compile your LaTeX file, with the Lyx compiler, the command that start with a backslash will not be printed out in your text. They are called commands, which are used to tell LaTeX what to do with some part of the text.

Therefore, by telling Lyx:

Code: Select all

\begin{figure}

\end{figure}
you are telling Lyx that this is a figure environment, in which there will most probably be a figure/graphic/image.

Another command is:

Code: Select all

\includegraphics[width=0.95\textwidth]{my-fig-file}
tells Lyx that you want to include a graphic file, with a width of 95% of the textwidth, called my-fig-file.

Code: Select all

\caption{this is my caption for this graphic}
tells Lyx that you will have a caption. The compiler knows what to do with this caption.

Code: Select all

\label{fig:my-fig}
is used essentially to refer to the figure/graphic/image further in your text. Instead of having to remember the number of the image, you just need, in your text, to make a reference to it. The compiler will figure out which graphic you mean and will refer to it by its number.

Cheers
assafwe
Posts: 33
Joined: Sun Oct 04, 2009 2:27 pm

Re: figure float adjustments

Post by assafwe »

Thank you so much for this.

asaf
Post Reply