Skip to content

Instantly share code, notes, and snippets.

@tats-u
Last active April 11, 2016 14:22
Show Gist options
  • Save tats-u/2397e43aa19af7cc883c2f8a01e7d809 to your computer and use it in GitHub Desktop.
Save tats-u/2397e43aa19af7cc883c2f8a01e7d809 to your computer and use it in GitHub Desktop.
A Bash script to nable LuaJITLaTeX in Linux
#!/bin/bash
# Linux: 原則rootで実行してください
# Windows: Git Bashなどで実行してください
sed -i -e '/luajitlatex/s/^ *#! *//' `kpsewhich fmtutil.cnf` || exit $?
fmtutil-sys --byfmt luajitlatex || exit $?
case `uname | tr [:upper:] [:lower:]` in
*msys*)
break;;
*cygwin*)
break;;
*mingw*)
break;;
*)
DIR=$( dirname $( which luajittex ) )
cat > ${DIR}/luajitlatex <<'EOF'
#!/bin/sh
exec luajittex --fmt=luajitlatex.fmt $*
EOF
chmod $( stat -c %a $( which luajittex ) ) ${DIR}/luajitlatex
chown $( stat -c %U $( which luajittex ) ) ${DIR}/luajitlatex
chgrp $( stat -c %G $( which luajittex ) ) ${DIR}/luajitlatex
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment