Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
2  
\includegraphics{foo} would work if your home directory is in your TEXINPUTS path, or \includegraphics{\string~/foo} should work on most systems. –  David Carlisle Feb 11 '13 at 21:57
    
@DavidCarlisle Tanks for \string~. That does work indeed. –  Andreas Feb 11 '13 at 22:08

1 Answer 1

up vote 5 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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