1

I have read the following posts on this site: How to avoid showing the filename when using graphicx? and Include figure from PDF file, but havent had any luck following the answers posted in the questions.

I am using \includegraphics to bring in figures and the file locations for the figures are showing up with the figures when I compile the PDF.

A working example:

 \documentclass[12pt]{article}

%preamble - set document settings

%package for loading images
\usepackage{graphicx}

%package needed for setting graphicspath with spaces in directory name
\usepackage[space]{grffile} 

\begin{document}

\includegraphics[width=0.5\linewidth]{{S:/Adv/Scallop Central/Logos/fullcolorlogo}.png}

\end{document}

I have also tried the following:

\includegraphics[width=0.5\linewidth]{{"S:/Adv/Scallop Central/Logos/fullcolorlogo"}.png}


\includegraphics[width=0.5\linewidth]{"S:/Adv/Scallop Central/Logos/fullcolorlogo".png}

but the PDF did not compile. There was a warning that the image couldn't loaded because it is not a recognized file format.

When I do get the image in the PDF it looks like:

enter image description here

Any help would be appreciated .

  • Did you try {"S:/Adv/Scallop Central/Logos/fullcolorlogo.png"}? – Sigur Feb 12 at 19:56
  • Why is the .png outside? I've never seen anyone do that "...." Ln the entire file name should be enough. Best if course is to never use spaces in folder or file names – daleif Feb 12 at 19:57
  • The answer below is why - it is from one of the two other answers above \usepackage{graphicx} \begin{document} \begin{figure} \includegraphics{{"../Current folder/1.This file"}.png} \end{figure} \end{document} – user41509 Feb 12 at 20:01
  • Yes I did try {"S:/Adv/Scallop Central/Logos/fullcolorlogo.png"} and got the same error message. – user41509 Feb 12 at 20:05
  • 1
    with pdflatex \includegraphics[width=0.5\linewidth]{"S:/Adv/Scallop Central/Logos/fullcolorlogo".png} should work (although not having spaces is better and not having the full path makes the document more portable) so \includegraphics[width=0.5\linewidth]{fullcolorlogo} would be best. If you are using latex+dvips then it can not include png files. This form should work just with graphicx, you don't need grffile – David Carlisle Feb 12 at 20:52
1

Did you tried with no " and {} like below?

\includegraphics[width=0.5\linewidth]{S:/Adv/Scallop Central/Logos/fullcolorlogo.png}

I have tried with below code and it worked, but it does not worked when quotation marks are included.

UPDATE

I got similar result as above answer with XeLaTeX. The filename disappeared when I compiled with pdfLaTeX.

\documentclass{article}

\usepackage{graphicx}
\usepackage[space]{grffile}

\title{test}
\author{tester}

\begin{document}
    \maketitle

    test

    \includegraphics[width=0.5\textwidth]{/Users/j/Desktop/Screen Shot 2019-01-30 at 11.40.38.png}

\end{document}

enter image description here

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.