[Tex/LaTex] use an image located on the web in a LaTeX document

external filesgraphicsonline

I have tried


But this returns the error

ERROR: Package pdftex.def Error: File
not found.

Are there other options?

Best Answer

you could use \write18 and a curl or wget script to grab the image from the web and download it to your directory.

\usepackage{graphicx} % includegraphics command is implemented here

\write18{wget http://www.some-site.com/path/to/image.png}


note however, that recent versions of miktex and texlive come with restricted versions of \write18, and it some cases you must pass an option to latex to enable it, as in:

pdflatex --shell-escape test.tex