Browse Source

Add latex update script

master
Riyyi 7 years ago
parent
commit
30d58fd49e
  1. 7
      .config/zsh/.zshrc
  2. 23
      .scripts/latex.sh

7
.config/zsh/.zshrc

@ -106,8 +106,8 @@ alias offtouchpad='sudo rmmod i2c_hid'
alias ontouchpad='sudo modprobe i2c_hid'
alias nw="$HOME/.scripts/network.sh"
# Other
source $ZDOTDIR/.zshrc_extended
# Scripts
alias ltx="$HOME/.scripts/latex.sh"
# Fun
spurdo() {
@ -115,6 +115,9 @@ spurdo() {
<<< "${@:-$(cat /dev/stdin)}"
}
# Other
source $ZDOTDIR/.zshrc_extended
## Login
[[ $USER == "rick" ]] && [ "$(tty)" = "/dev/tty1" ] && exec xinit -- vt1 &> /dev/null

23
.scripts/latex.sh

@ -0,0 +1,23 @@
#!/bin/sh
if [ "$1" = "kill" ]; then
kill -9 $(pgrep latex.sh)
else
DIR="$1"
OUT="$DIR/out"
mkdir -p $OUT
HASH="$(md5sum $DIR/main.tex)"
while true; do
sleep 1
TMP="$(md5sum $DIR/main.tex)"
if [ "$HASH" != "$TMP" ]; then
HASH="$TMP"
pdflatex -no-file-line-error -interaction=nonstopmode -synctex=1 \
-output-format=pdf -output-directory=$OUT $DIR/main.tex \
> /dev/null 2>&1
fi
done
fi
Loading…
Cancel
Save