#!/bin/sh
# iNoue Koich! (modified by S. Zenitani)

export PATH=$PATH:/usr/local/bin:/usr/local/teTeX/bin

COMMAND=${0##*/}
PTEX=${COMMAND%2pdf-*}
ENCODE=${COMMAND#*-}
JOBNAME=${1##*/}
JOBNAME=${JOBNAME%.*}

ptex -kanji=$ENCODE -fmt=$PTEX-$ENCODE -progname=$PTEX "$1" && \
dvipdfmx "$JOBNAME.dvi"

