This is how I automatically fetch and compile LaTeX code from Google Docs:
- Create the Google Docs document
- Put some LaTeX code in it. Hopefully you have some "boilerplate" code you always start with.
- (I assume you have a LaTeX compiler installed and know how to write in LaTeX)
- Install wget if you don't have it (Windows: http://gnuwin32.sourceforge.net/packages/wget.htm, Other: http://ftp.gnu.org/gnu/wget/)
- Press Share in your doc and allow anyone with the link to view it:
- Save. Copy the public link. Change the "/edit" in the end to only "/export?format=txt".
- Make a folder on your computer where you will be doing the LaTeX compilation.
- Make a script which downloads the doc as raw text file and then compiles it with the latex compiler.
This is how my download-and-compile script looks like:
"path/do/wget" "https://docs.google.com/doc..." -O thesis.tex --no-check-certificate
"path/to/pdflatex.exe" -interaction=nonstopmode "thesis.tex"
Those two lines are basically all it takes. When I run build_thesis.bat it downloads the very latest code and compiles it into a pdf.
- Problems with the UTF-8 BOM sneaking in to the beginning? Try using lualatex.exe instead which supports UTF-8.
- If you want to split up into many .tex files you can make many docs and wget all of them.
- If you use images it's easiest to simply have them in your working folder.
- Images in the Google Doc will be ignored in the raw text, so you can have your images in the doc and the code for LaTeX to compile them in for a nice preview.
- A ToC in the doc follow as text in raw format, so it's best not to use it and instead rely on scrolling.
Tell me your results. Happy LaTeXing!
this is also useful in case of large data files hosted by google docs (e.g. *.csv). But sorry I'm not able to reproduce it. It always terminates with an error "404 not found".
I try the following as proposed:
wget "https://docs.google.com/file/d/0B9p4RE6qhRcqbko0Skd0dkJlZUU//export?format=txt" -O myData --no-check-certificate
If you change the URL to "Edit-Mode" you can access it by browser. Any ideas ?
The problem is that the file is a "raw" file unknown to Google Drive. If you go to "Edit mode", then File>Open with>Google Sheets it will import the data into a sheet. Make sure the new sheet is shared to everyone via a link. Then you can File>Downdload as>Comma Separated Values (.cvs). That will download the data as a .cvs file. Have a look at the URL of that file in your browsers download manager. You should be able to wget that same .cvs file using wget in a similar way as explained.
Let me know how it goes :-)
i like your web Zong Net PackagesReplyDelete