Results 1 to 6 of 6

Thread: Lyx, Latex and images

  1. #1
    Join Date
    Jan 2008
    Beans
    11

    Lyx, Latex and images

    Hi!

    I have a problem inserting images (I use .png) into my Lyx-document.
    Well, inserting is not the real problem, but when I try to generate a PDF I get the following error message:

    Paragraph ended before \@tempa was complete.

    I searched the latex code but could not find anything.
    What I can do without any error is to export the document to dvi but the inserted images are missing.

    Thanks in advance,
    Chris

  2. #2
    Join Date
    Feb 2008
    Location
    Berlin, Germany
    Beans
    49
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Lyx, Latex and images

    Make sure you're using the following package:
    Code:
    \usepackage{graphicx}
    Then, I add a .jpg file using the following code:

    Code:
    \begin{figure}
    \centering
    \includegraphics[scale=0.7]{filename.jpg}
    \caption{A caption and a reference \cite{REF08}}
    \label{fig}
    \end{figure}
    I think it should work with .png's as well.

    One last thing, in general I'd recommend, as long as it is possible, to insert vector based figures, since they are scalable! If it is an .eps for example, then you can easily convert it to PDF using:
    Code:
    epstopdf
    I hope it was helpful.

    Have a nice week.

  3. #3
    Join Date
    Dec 2006
    Location
    Canada
    Beans
    41
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Lyx, Latex and images

    sometimes when I need to put more than one figure side by side,

    the subfigure command comes to save my life

    you have to include the package...

    Code:
    \usepackage{subfigure}  % use for side-by-side figures

    and example of use

    Code:
    \begin{figure}[h!]
    \begin{center}
    \subfigure[caption_for_first_image]{
    \includegraphics[scale=0.5]{fig/figure_a}}
    \subfigure[caption_for_second_image.]{
    \includegraphics[scale=0.5]{fig/figure_b}}
    \caption{This is the caption for the whole figure.}
    \end{center}
    \end{figure}

    look here for a depicted example

    http://andy-roberts.net/misc/latex/latextutorial6.html


    Happy Ubuntuing!

  4. #4
    Join Date
    Jun 2005
    Location
    Australia
    Beans
    247
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Lyx, Latex and images

    Thanks Castudil, I wasn't aware of this package until now -- I am sure that it will come in very handy

  5. #5
    Join Date
    Jan 2008
    Location
    Auckland, New Zealand
    Beans
    3,129
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Lyx, Latex and images

    If you're still having problems then post a basic example of what you're trying to do and someone will help you out.

  6. #6
    Join Date
    Jan 2008
    Beans
    11

    Re: Lyx, Latex and images

    Hi!

    I did not have the time to investigate the real reason for my problem but changing the documentclass solved the problem in an easy way.

    Thanks a lot for your help.

    Cheers!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •