3

I am trying to include an image in PDF format into my document as a figure. When compiling with lualatex or pdflatex, the image does not appear. If I take that very PDF image and convert it to PNG and include the PNG file, it works. Additionally, when I try the PDF version, the figure has a double light grey line along the edge or corner depending on the viewer used. This does not occur with the PNG version.

I have used the \fbox command to enclose the \includegraphics command to make sure that the size is being interpreted correctly and it is in all cases, and changing the image size doesn't change anything.

Generally, my compile order is lualatex->bibtex->lualatex->lualatex and I've tried the same thing with pdflatex. I have other PDF files that compile fine but this one has been problematic.

EDITED: Minimal Example

This preamble is pretty large but I figured I would include everything just to be safe. This is all part of a larger thesis template file for my university, so I can't really go deleting any of the packages either or it breaks the template.

\documentclass[12pt]{report}
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=1.25in,bmargin=1.25in,lmargin=1.4in,rmargin=1.15in}
\usepackage[doublespacing]{setspace}
\usepackage{tocloft}
\usepackage[rm, tiny,center, compact]{titlesec}
\usepackage{indentfirst}
\usepackage{etoolbox}
\usepackage{tocvsec2}
\usepackage[titletoc]{appendix}
\usepackage{appendix}
\usepackage{rotating}
\usepackage[T1]{fontenc}\usepackage{lmodern}
\usepackage[hidelinks,unicode]{hyperref}
\usepackage{amsmath}
\usepackage{graphicx,float,wrapfig}
\usepackage{natbib}

\begin{document}

\begin{figure}[tb]
    \centering
    \includegraphics[width=0.8\textwidth]{AT3-Iso.pdf}
    \caption{Three-dimensional traversing mechanism affixed to 7$^{\circ}$ cone model.}
    \label{fig:traverse}
\end{figure}

\end{document}

Also, I have linked 3 files below. One is sample output from my .tex file with a PDF input, one with a PNG input, and then one is the original PDF image itself that I am trying to use. Hopefully all of this helps.

http://people.tamu.edu/~sacraig/debug/pdf-version.pdf

http://people.tamu.edu/~sacraig/debug/png-version.pdf

http://people.tamu.edu/~sacraig/debug/AT3-Iso.pdf

EDIT 2: The PDF image is one page from what was originally a 4 page document split into 4 separate images. I tried converting each to EPS and then back to PDF again and it seemed to work for two of the 4 images.

Finally, I had been using MiKTeX when encountering this problem in Windows. I moved over to Ubuntu and on TeXLive it seems to all compile just fine. I still primarily use Windows at work, however, so I'd like to figure out the problem on the Windows side.

EDIT 3: Through additional testing I have found that XeLaTeX compiles fine and produced the proper output with this file in Windows. I can use that in a pinch, but I would still prefer LuaLaTeX if possible.

EDIT 4: Well checking the .log file showed one warning for the version of the PDF. It was 1.6 and I guess only up to 1.5 is supported. Resaving the PDF as PDF 1.5 fixed it for this image, so that is awesome. It doesn't seem to fix it for a couple other images that were created the same way, however, which is really weird. Those .log files don't seem to have any errors or warnings either.

  • 1
    It is too difficulty to decide what to do in this case since we don't have any info about the pdf file neither your preamble. – Sigur Oct 24 '13 at 20:47
  • 1
    Please provide a complete minimal example (or here). As Sigur said, it is very difficult for people to help you without seeing what you are (not) doing. The problematic .pdf image would also be useful. – jon Oct 24 '13 at 22:21
  • 1
    there may be something non-standard about the PDF file, try converting to something else (e.g. postscript) and then back to PDF – Sam Mason Oct 25 '13 at 10:04
  • 2
    Including the pdf works perfectly with a minimal example and current pdflatex and lualatex. And your example also works perfectly. And your file pdf-version.pdf is not produced by pdfTeX or lualatex. – Martin Schröder Oct 25 '13 at 21:30
  • 1
    If that example file 'compiles' on windows but without the graphics showing up, do you see any errors or warnings? You should go through the .log carefully and see if any further diagnostic information can be found. Adding a \listfiles to the preamble will also help you track which versions you are loading. – jon Oct 27 '13 at 22:34

Your Answer

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

Browse other questions tagged or ask your own question.