#!/bin/sh # rlatexmk.sh # Script for remote LaTeX compiling using rlatexmk # 2019 (c) Marcel Kapfer # MIT License # Importing variables from local rlatexmk_config.sh import_config() { CONFIG="$(pwd)/rlatexmk_config.sh" if [ -f $CONFIG ]; then source $CONFIG else echo "Configuration file $CONFIG not available. Aborting." exit 1 fi } # Provide local folder content to remote using rsync sync_up() { rsync $RSYNC_OPTIONS ./ "$USER"@"$HOST":"$REMOTE_PATH" } # Get remote folder content using rsync sync_down() { rsync $RSYNC_OPTIONS "$USER"@"$HOST":"$REMOTE_PATH"/ . } # Run latexmk remote using SSH compile() { ssh "$USER"@"$HOST" <