2

I am trying to embed a graphics pdf either using includegraphics or \graphicspath, however my directory includes apostrophes that are generating errors in the call. (I know this because when I put the visualizations in a parent file without an apostrophe it works). For example, the following does not work:

\includegraphics[scale=.2]{/Users/jim/Dropbox/jim's Personal Documents/figures/plot.pdf}

While this works:

\includegraphics[scale=.2]{/Users/jim/Dropbox/figures/plot.pdf}

Any idea how to reference a file through a path name with an apostrophe? Thanks.

  • A simple document with an apostrophe in the path name worked for me on Linux. Perhaps using an apostrophe is not the best way though –  Oct 17 '15 at 16:08
  • Are you sure that the problem is the apostroph and not the spaces? – Ulrike Fischer Oct 17 '15 at 16:12

1 Answers1

3

The problem does not seem to be the apostrophe, but the spaces in the filename. You can put \usepackage[space]{grffile} in the preamble as per https://tex.stackexchange.com/a/8426/89417. MWE:

\documentclass{article}
\usepackage{graphicx}
\usepackage[space]{grffile}
\begin{document}
\includegraphics[scale=0.2]{apo'stro phe/icon.png}
\end{document}

Please provide a complete example when you ask a question, or at least include the exact error message that is shown, to make it easier to reproduce the issue.

Marijn
  • 37,699