# Including files from google drive

Does someone knows how can I include a file from Google drive? Something like

\input{http://adress_to_myfile_at_GDrive.tex}

• I don't think, that TeX will have access to the internet/build a socket to input content somewhere in the cloud ;-)
– user31729
Sep 18, 2014 at 15:59
• The download package might be useful. Sep 18, 2014 at 16:05
• on windows and mac at least, can't you sync drive to a local folder tex could see? Sep 18, 2014 at 16:16

Here is the minimal example which should work, no extra packages are needed.

I created webfile.tex with the following content:

THIS IS THE WEB FILE.


I put it on my webpage.

In the main document, which is in my case ~/StackOverflow/ex2.tex, use \write18 to run shell command and \immediate to do it immediately. I recommend to use \unexpanded, if your link contains ~, # etc. The document is here:

\documentclass[12pt]{report}

\begin{document}

Here is the main document.

And here will be the imported \texttt{webfile.tex} file, which I uploaded on my web page.

\immediate\write18{\unexpanded{wget -P ~/StackOverflow http://sirrah.troja.mff.cuni.cz/~pavlik/webfile.tex}}
\input{webfile}

\end{document}


Then compile it with pdflatex -shell-escape ex2.tex

The result is

But this will still download the .tex file to your computer (download directory is specified by the -P /some/dir/here switch), there is imho no way to do it without downloading the file.