Added initial version of rlatexmk

main
Marcel Kapfer 4 years ago
parent e13e9fdbb5
commit 2ec5c90b35
No known key found for this signature in database
GPG Key ID: 2DD1043A5603FCED

@ -0,0 +1,47 @@
#!/bin/sh
# rlatexmk.sh
# Script for remote LaTeX compiling using rlatexmk
# 2019 (c) Marcel Kapfer <opensource@mmk2410.org>
# 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" <<EOF
cd $REMOTE_PATH
latexmk -C
latexmk $LATEXMK_OPTIONS $@
EOF
}
# Main function
main() {
import_config
sync_up
compile
sync_down
}
main

@ -0,0 +1,5 @@
HOST="127.0.0.1"
USER="texlive"
REMOTE_PATH="/tmp"
RSYNC_OPTIONS="--delete --archive --human-readable --partial --progress"
LATEXMK_OPTIONS="-lualatex"
Loading…
Cancel
Save