13

How can I refer to a file (e.g. in \includegraphics{}) that lives in my home directory (I am on linux)?

\documentclass{article}
\usepackage{graphicx}

\begin{document}
not working: $\sim$/foo.png
%%\includegraphics{~/foo.png}

not working either: \$HOME/foo.png
%%\includegraphics{$HOME/foo.png}
\end{document}
egreg
  • 1,121,712
Andreas
  • 521

1 Answers1

23

\includegraphics{foo} would work if your home directory is in your TEXINPUTS path, or \includegraphics{\string~/foo} should work on most systems.

David Carlisle
  • 757,742