0

I am working on a document in Lyx. When i insert Images i put the in a floating container, give them a caption, an set the following preferences

  • The floating container to center align
  • The picture to a scaling e.g. 40%
  • I sometimes cut the borders due to screenshot issues

Sadly i seem to lack some knowledge, because while the document looks fine in preview, when i compile the document i get the following three issues:

  • The picture is not in the center (the caption is)
  • The cuts on the border are completely diffrent from what they looked in the preview
  • The resolution of the image is very low (actually it looks like they applied a gaussian blur)

Here is a comparison:

In the Preview:

How it looks in the preview

In the Document:

enter image description here

Any Ideas, what i have to do different?

EDIT: I also read Centering images in lyx and therefore added

\usepackage{graphicx}

to my preamble

3
  • Do not add \usepackage{graphicx} in the preamble manually. The is already added when you insert any image (check the LaTeX source:View > Source Pane > Complete Source)

  • To center the image, add \centering inside the float, before of the image: Ctrl+L > Write \centering inside the red box. Alternatively, select with the mouse from before of the image to after the image (a cyan border should appear), then Right click (over the image)> > Paragraph settings... > Center (check in Latex source a \begin{centering} ...\end{centering} was included in the right position.

  • About resolution and clipping of the image, without any information about that image or a minimal working example (MWE) we can only guess. May be a defective image, so LyX cannot find the right dimensions, may be a bad conversion, a low resolution of the original format. So, only some comments that could help to understand the real problem:

  • Check what happens with other images of the same file format (but another source) and with other usual formats (JPG, PNG, PDF).

  • About clipping problems, chek-uncheck the Click to bounding box checkbox to see if there are some difference.

  • Pixeled aspect in the preview may be the result of scaling too much the preview image. Note that the original format, the preview format and the final format in the PDF may all be the same or not. For instance, a JPG images are supported by both LyX and LaTeX, while a GIF image can be used for the LyX preview but not in LaTeX code. Inversely, a PDF image can be used directly in a LaTeX file but not in the LyX preview, and some other formats as SVG image cannot be showed in LyX nor used in LaTeX. Fortunately, LyX call several converters, so GIF, PDF and SVG images are exported to compatible formats for the preview and/or the LateX code. The fact that the preview is always a bitmat format can explain a lower resolution, as well as the conversion itself. Note that the size of the bitmap image what you see in the preview is should be the result of the original image size and the Scale on the screen (%) in the graphics menu (in LaTeX and LyX options window tab!), but the image in the final PDF could be another bitmap or vectorial (PDF) format, with a size determined by the original size and the Scale graphics (%) option.

  • Thank you for your quick answer. The Centering worked --> i had to select the whole image. – Nicolas Antor Sep 7 '16 at 11:19
  • More Info on the picture: it is a PNG with 1102x709 Pixels and 96 PPI – Nicolas Antor Sep 7 '16 at 11:21
  • Where do i find the "Click to bounding box" option? – Nicolas Antor Sep 7 '16 at 11:24
  • @NicolasAntor Click on the image to open Graphics window, the go to the "Clipping" tab. With respect the PNG image, the Qt library should handle this format in LyX that is also fine for LaTeX ouput. If possible, edit your question to include that image and more relevant information (as if you have Lyx 2.2.0 or another version, Windows or Linux, etc., the document class, if this happen with other PNG images, etc.) Help us to help you. – Fran Sep 8 '16 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.