LaTeX with GitLab/GitHub and Dropbox PDF share

Related: LaTeX with GitLab/GitHub and Dropbox Git backup


This is a bit of a complicated procedure, most people will not want to do this. It shows how to have a document live on GitHub while sharing the locally complied PDF via Dropbox. The examples show GitLab but of course work equally well with GitHub/Bitbucket/etc. A colleague told me my high-resolution vector graphics in Overleaf were very blurry in the Overleaf PDF preview. I switched from Overleaf to GitLab for group editing, with Dropbox for shared PDF display.

Create a blank GitLab repo. Do not create any README, LICENSE, or .gitignore.

Switch Git Overleaf remote origin to GitLab

git remote set-url master https://gitlab.com/username/MyDissertation.git
git push -u origin master

after this, you can make future pushes simply by

git push

Create a Dropbox directory just for PDF sharing, say pdfshare. After this procedure, every LaTeX document you compile goes here. * Linux/Mac: assume absolute path ~/Dropbox/pdfshare * Windows: assume relative path ..\pdfshare

mklink /d ..\pdfshare %userprofile%\Dropbox\pdfshare

Options → Configure TeXstudio → Build.

Windows

Configure Windows TeXstudio to copy PDF output to Dropbox

Configure Windows TeXstudio to copy PDF output to Dropbox

  1. add to “Build & View” | txs:///copypdf
  2. add a user command copypdf:Copy PDF with

    cmd /C copy %.pdf ..\pdfshare\

Linux/Mac

Configure Linux/Mac TeXstudio to copy PDF output to Dropbox

Configure Linux/Mac TeXstudio to copy PDF output to Dropbox

  1. add to “Build & View” | txs:///copypdf
  2. add a user command copypdf:Copy PDF with

    bash -c "cp -t ~/Dropbox/pdfshare %.pdf"

Notes

  • Compile your document from TeXstudio, command line, or whatever with pdflatex and you’ll see your output PDF file in Dropbox/pdfshare.
  • You can share a link with collaborators to specific PDFs. Normally you would NOT share the entire folder.
  • Remember to give your LaTeX main documents unique names or they’ll overwrite each others’ PDF in pdfshare.
  • collaborators send back commented up PDFs from free Adobe Reader, Evince, or other free PDF readers