Added initial version of rlatexmk
This commit is contained in:
parent
e13e9fdbb5
commit
2ec5c90b35
2 changed files with 52 additions and 0 deletions
47
rlatexmk/rlatexmk.sh
Executable file
47
rlatexmk/rlatexmk.sh
Executable file
|
@ -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
|
5
rlatexmk/rlatexmk_config.sh
Normal file
5
rlatexmk/rlatexmk_config.sh
Normal file
|
@ -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…
Reference in a new issue