LaTeX with Gitlab/Github and Dropbox PDF share

Related: LaTeX with Gitlab/Github and Dropbox Git backup


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

Recently, Overleaf corrupted history of an important paper draft, and a colleague told me my high-resolution vector graphics in Overleaf were very blurry in the Overleaf PDF preview. This drove me to eliminate Overleaf from my scholarly (and overall) workflow.

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