| 1 | #! /bin/sh |
| 2 | |
| 3 | # Copyright (C) 1994-2021 Werner Lemberg <[email protected]> |
| 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 2 of the License, or |
| 8 | # (at your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program in doc/COPYING; if not, write to the Free |
| 17 | # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 18 | # MA 02110-1301 USA |
| 19 | |
| 20 | n=1 |
| 21 | argv= |
| 22 | |
| 23 | # get last argument |
| 24 | while test 1 -lt $#; do |
| 25 | eval argv$n=\$1 |
| 26 | argv="$argv \"\$argv$n\"" |
| 27 | n=`expr $n + 1` |
| 28 | shift |
| 29 | done |
| 30 | |
| 31 | # replace extension with .cjk or append .cjk if there is no extension |
| 32 | tex=$1 |
| 33 | case $tex in |
| 34 | ""|*.cjk) |
| 35 | echo >&2 "Usage: $0 [options] latex-file" |
| 36 | exit 1;; |
| 37 | *) |
| 38 | aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; |
| 39 | esac |
| 40 | |
| 41 | cefsconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" |
| 42 | |
| 43 | # EOF |