Created
February 2, 2012 06:37
-
-
Save krrrr38/1722025 to your computer and use it in GitHub Desktop.
usage: tex_pdf.sh tex_file
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 | |
CMDNAME=`basename $0` | |
if [ $# -ne 1 ]; then | |
echo "usage: CMDNAME: tex_file" 1>&2 | |
exit 0 | |
fi | |
tex_file=$1 | |
file_name=${tex_file##*/} | |
file=${file_name%.*} | |
if [ ! -e ${file}'.tex' ]; then | |
echo "${file}.tex cannot be found" 1>&2 | |
exit 0 | |
fi | |
platex ${file}'.tex' | |
if [ ! -e ${file}'.dvi' ]; then | |
echo "${file}.tex cannot be found" 1>&2 | |
exit 0 | |
fi | |
xdvipdfmx ${file}'.dvi' | |
if [ ! -e ${file}'.pdf' ]; then | |
echo "${file}.pdf cannot be found" 1>&2 | |
exit 0 | |
fi | |
open ${file}'.pdf' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment