From: Mart Lubbers Date: Wed, 21 Jun 2017 12:03:37 +0000 (+0200) Subject: add interactive latex scripts X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=1a5c1eb8043c60fa632a2f87eeee49a2ff3227e6;p=dotfiles.git add interactive latex scripts --- diff --git a/email/.mutt/notmuch.muttrc b/email/.mutt/notmuch.muttrc index 673ec6f..6b299dc 100644 --- a/email/.mutt/notmuch.muttrc +++ b/email/.mutt/notmuch.muttrc @@ -1,19 +1,19 @@ -macro index "\ - set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ - notmuch-mutt -r --prompt search\ - `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ - set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ - "notmuch: search mail" +macro index \ +"set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ +notmuch-mutt -r --prompt search\ +`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ +set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: search mail" -macro index "\ - set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ - notmuch-mutt -r thread\ - `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ - set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ - "notmuch: reconstruct thread" +macro index \ +"set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ +notmuch-mutt -r thread\ +`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ +set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: reconstruct thread" -macro index "\ - set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ - notmuch-mutt tag -- -inbox\ - set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ - "notmuch: remove message from inbox" +macro index \ +"set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ +notmuch-mutt tag -- -inbox\ +set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: remove message from inbox" diff --git a/shell/.bashrc b/shell/.bashrc index 92a1b0a..1a598b5 100644 --- a/shell/.bashrc +++ b/shell/.bashrc @@ -19,8 +19,7 @@ export CLEAN_HOME=/opt/clean export PATH=~/.local/bin:$PATH export PATH=$PATH:$CLEAN_HOME/lib/exe:$CLEAN_HOME/bin export PATH=$PATH:~/projects/esp-open-sdk/xtensa-lx106-elf/bin -export PATH=$PATH:/opt/texlive/2016/bin/x86_64-linux -export PATH=$PATH:~/.local/texlive/2016/bin/x86_64-linux +export PATH=$PATH:/opt/texlive/2017/bin/x86_64-linux export GTK_IM_MODULE=xim export QT_IM_MODULE=xim diff --git a/vim/.vim/spell/en.utf-8.add b/vim/.vim/spell/en.utf-8.add index 97ca7c2..60b672d 100644 --- a/vim/.vim/spell/en.utf-8.add +++ b/vim/.vim/spell/en.utf-8.add @@ -8,3 +8,5 @@ diphone SDS Microcontrollers tonotopic +backend +backends diff --git a/vim/.vim/spell/en.utf-8.add.spl b/vim/.vim/spell/en.utf-8.add.spl new file mode 100644 index 0000000..f05f0a0 Binary files /dev/null and b/vim/.vim/spell/en.utf-8.add.spl differ diff --git a/x/.local/bin/pdflatexi b/x/.local/bin/pdflatexi new file mode 100755 index 0000000..015002c --- /dev/null +++ b/x/.local/bin/pdflatexi @@ -0,0 +1,22 @@ +#!/usr/bin/expect +spawn pdflatex {*}$argv +set latexpid $spawn_id +set oldresult "" +expect -re "^.*File .(.*). not found.*$|^.*language definition file (.*) was not foun" { + set result $expect_out(1,string) + send_user "\nTrying to install missing package\n" + if {$oldresult == $result} { + send_user "$result has been tried twice with no results\n" + send_user "Is this not an image? Aborting...\n" + exit + } { + spawn tlmgri $result + interact + set spawn_id $latexpid + close + wait + spawn pdflatex {*}$argv + set oldresult $result + exp_continue + } + } diff --git a/x/.local/bin/thumbnailer.sh b/x/.local/bin/thumbnailer.sh index 0867ee9..9c7edeb 100755 --- a/x/.local/bin/thumbnailer.sh +++ b/x/.local/bin/thumbnailer.sh @@ -15,6 +15,7 @@ fi log "Processing $1 to $2" TMPDIR="$(mktemp -d)" +trap "rm -r $TMPDIR" EXIT log "Temp directory created in $TMPDIR" NUMPAGES=$(identify "$1" | wc -l) @@ -30,8 +31,3 @@ log "done!" montage -geometry +0+0 $TMPDIR/*.png "$2" log "Montaging done" - -rm -r $TMPDIR -log "Cleaned up" - -log "Done" diff --git a/x/.local/bin/tlmgri b/x/.local/bin/tlmgri new file mode 100755 index 0000000..64c3051 --- /dev/null +++ b/x/.local/bin/tlmgri @@ -0,0 +1,23 @@ +#!/bin/bash +if [ "$#" -ne 1 ] +then + echo "Usage: $0 FILE" + exit 1 +fi + +PKGS="$(tlmgr search --global --file "/$1" 2>/dev/null | grep -Po "^.*(?=:$)")" +if [[ -z "$PKGS" ]]; then exit 1; fi +if [[ $(wc -w <<< "$PKGS") -eq 1 ]] +then + tlmgr install "$PKGS" +else + select package in $PKGS; do + INDEX=1 + for p in $PKGS; do + if [ $((INDEX++)) -eq $REPLY ]; then + tlmgr install "$p" + fi + done + break; + done +fi