LaTeX with GitLab/GitHub and Dropbox PDF share

1 minute read

Related: LaTeX with GitLab/GitHub and Dropbox Git backup


The procedure below is for switching away from Overleaf v1. Overleaf v2 is hosted at GitHub, so with Overleaf v2 one could simply shut off Overleaf v2 GitHub syncing.

The examples show GitLab but of course work equally well with GitHub/Bitbucket/etc. I use GitLab because of unlimited free repos.

A colleague told me my high-resolution vector graphics in Overleaf v1 were very blurry in the Overleaf v1 PDF preview. I switched from Overleaf to GitLab for group editing, with Dropbox for shared PDF display.

  1. create a blank GitLab repo. Do not create any README, LICENSE, or .gitignore.
  2. 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
    
  3. 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
      
  4. 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

Leave a Comment