Skip to content

Instantly share code, notes, and snippets.

@rsdy
Created December 3, 2013 08:44
Show Gist options
  • Save rsdy/7765974 to your computer and use it in GitHub Desktop.
Save rsdy/7765974 to your computer and use it in GitHub Desktop.
Pdflatex livecoding with tmux
#!/bin/sh
SESSION=$USER-$(dirname "$0")
tmux -2 new-session -d -s $SESSION
# Setup a window for tailing log files
tmux new-window -t $SESSION:1 -n 'stuff'
tmux split-window -v -l 1 "okular plan.pdf"
tmux select-pane -t 0
tmux split-window -v -l 10 "make live"
tmux select-pane -t 0
tmux send-keys "$EDITOR plan.md" C-m
# Set default window
tmux select-window -t $SESSION:1
# Attach to session
tmux -2 attach-session -t $SESSION
do:
pandoc -f markdown -t latex plan.md > sections.tex
pdflatex plan.tex
pdflatex plan.tex
live:
while inotifywait plan.md; do \
make do; \
done
.PHONY = do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment