Skip to main content

A tool for syncing LaTeX projects with Git and external folders.

Project description

papersync

papersync is designed to bridge the gap in academic projects where contributors have different roles: some focus on coding and producing tables and figures, while others focus solely on writing. In these cases, integrated solutions like Python notebooks are often unsuitable because (1) writers may not use statistical software, and (2) writing often requires precise formatting that advanced tools like LaTeX can provide, which simple Markdown-to-LaTeX conversions cannot match. Consequently, such projects often resort to cloud storage solutions without version control, missing the advantages of tracking changes in both code and LaTeX.

papersync addresses this need by enabling the synchronization of LaTeX projects managed in a Git repository with directories outside the repository (e.g., a Dropbox folder). The program ackage is built with the assumption that the Git repository maintains a central library of shared tables and figures (by default, ./assets), with each LaTeX project stored in its own folder within the repository (e.g., ./tex/article for the paper, and ./tex/presentation for the slides). papersync provides two commands,push and pull, to streamline syncing the local copy of each project with their remote counterpart.

papersync simplifies collaboration by allowing coders and writers to work seamlessly within their preferred tools while benefiting from the version control and change-tracking capabilities of Git. As a CLI program, it can be easily integrated with Makefiles or other automation scripts.

Installation

Install from pip

pip install papersync

Usage: a minimal example

Say that Alice, Bob, and Charles are all working on a project. Alice and Bob are the writers/coders, and Charles is only a writer. The Git repo is structured as follows:

├-- main.R # the statistical code
├-- assets # the folder that contains the tables and figures created by main.R
|   ├-- tables
|   |   └-- my-table.tex
|   └-- figures
|       └-- my-figure.pdf
└-- tex # the folder that contains all the writing
    ├-- presentation
    |   └-- main.tex
    └-- paper
        └-- main.tex

The team is working on a paper and a presentation. The paper is hosted on Overleaf, while the presentation is on Dropbox.

To get started, open a terminal, navigate to the repo, and type papersync create to set up papersync in a new or existing project. This will create/update two configuration files, and encourage you to modify them according to your needs:

  • Public configuration file, ./papersync.yaml: Specifies the path to the assets directory and the local paths of each LaTeX project within the repository.
  • Private configuration file, .env: Indicates the remote paths for each project. As usual with .env files, this file is unique to each contributor’s environment and should not be committed to the repository.
cd my-project
papersync create

The Git repo now looks like this:

├-- main.R # the statistical code
├-- assets # the folder that contains the tables and figures created by main.R
|   ├-- tables
|   |   └-- my-table.tex
|   └-- figures
|       └-- my-figure.pdf
├-- tex # the folder that contains all the writing
|   ├-- presentation
|   |   └-- main.tex
|   └-- paper
|       └-- main.tex
├-- papersync.yaml # the public configuration file
└-- .env # the private confifguration file

The file papersync.yaml should be specified as follows:

assets: "./assets"
projects: 
    article: "./tex/article"
    presentation: "./tex/presentation"

The file .env indicates where the project folders are stored in each of Alice's and Bob's computer. Indeed, the Dropbox location is different for each coauthor. As such, .env should not be committed to Git. You should add it to the .gitignore. Here is how .env looks for Alice:

# other variables stored in .env
SOME_VARIABLE=SOME_VALUE
# variables required byt papersync
PAPERSYNC_ARTICLE="/Users/alice/Library/CloudStorage/Dropbox/Apps/Overleaf/cool-paper"
PAPERSYNC_PRESENTATION="/Users/alice/Library/CloudStorage/Dropbox/projects/cool-project/presentation"

After initialization, both Alice and Bob can use papersync push from the CLI to push the latest version of each project to its corresponding remote directory, along with the assets folder. To synchronize the current state of each remote project directory back into the repository (e.g., after Charles has made some changes), they can use papersync pull.

cd my-project
papersync push
papersync pull

On pushing or pulling, papersync will create symlinks in each project directory, pointing to the assets library, so the projects can refer to the library using local file paths. This can also be done using the papersync link command. The final file structure will look like:

├-- main.R # the statistical code
├-- assets # the folder that contains the tables and figures created by main.R
|   ├-- tables
|   |   └-- my-table.tex
|   └-- figures
|       └-- my-figure.pdf
├-- tex # the folder that contains all the writing
|   ├-- presentation
|   |   ├-- assets # a symlink pointing to the assets folder in the root
|   |   └-- main.tex
|   └-- paper
|       ├-- assets # a symlink pointing to the assets folder in the root
|       └-- main.tex
├-- papersync.yaml # the public configuration file
└-- .env # the private confifguration file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

papersync-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

papersync-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file papersync-0.1.0.tar.gz.

File metadata

  • Download URL: papersync-0.1.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for papersync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9af9faa5e1e76b2963ad824d2ef23e292adc60296b0f92b713d6a22bf38610b9
MD5 adcab0ba5ad3b43f17eafa1fce0d6d43
BLAKE2b-256 05b36b1ed85ce2a606f31b4e5523c6e3e7fa92a7c124bf4422649b820308ef68

See more details on using hashes here.

File details

Details for the file papersync-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: papersync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for papersync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e86e638404e8f92abe9c9e9fd4f2d9cdf4c218d2072e92fbcebdb1ea094f13c
MD5 9c8d560f7f32e66b96a90950c917226a
BLAKE2b-256 f32df6bbf07ce4166b221621455460500f1af1327923a938b0e38cc019970d9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page