Created
January 10, 2015 22:27
-
-
Save endreszabo/3e857337c2d80ed7949c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Tmux based TeX editor helper | |
EDITOR="${EDITOR:-vim}" | |
DOCUMENT="${1:-deriv}" | |
SESSIONID="tmuxtexex_${DOCUMENT}_$$" | |
tmux new-session -d -s "${SESSIONID}" && tmux new-window -t "${SESSIONID}:1" -n 'TmuxTeXEx' "$EDITOR ${DOCUMENT}.tex" && tmux split-window -v -l 6 -t "${SESSIONID}:1" "while :; do inotifywait -e modify \"${DOCUMENT}.tex\" && { make || pdflatex \"${DOCUMENT}.tex\" } && jobs %% || { evince \"${DOCUMENT}.pdf\" & }; done" && tmux select-pane -U -t "${SESSIONID}:1" && tmux -2 attach-session -t "${SESSIONID}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment