X-Git-Url: http://git.chise.org/gitweb/?p=m17n%2Fm17n-docs.git;a=blobdiff_plain;f=utils%2Flatex.sh;h=a37e9183731078d69490ad05d04d6ed546e8538a;hp=e424dac1cb2130dd2dcd350fee018eb404b29a8d;hb=424eb343e14a687e4e64f41c4551135e724d0bdc;hpb=a50efd9920a577f5011c9ba2437b5b05734fd6ff diff --git a/utils/latex.sh b/utils/latex.sh index e424dac..a37e918 100755 --- a/utils/latex.sh +++ b/utils/latex.sh @@ -1,47 +1,53 @@ #!/bin/sh # -*- coding: utf-8; -*- # $1: target directory (usr/latex, ja/latex, or dev/latex) -# $2: latex commnad (latex, platex, or pdflatex) umask 002 USR_JA_DEV=`dirname $1` -TEXINPUTS=`pwd`/styles:.: -export TEXINPUTS +cp styles/m17n-lib.sty $1 cd $1 -LATEX=$2 +LATEX=latex if [ $USR_JA_DEV = "ja" ] ; then LATEX=platex if [ -d /usr/local/teTeX/bin ] ; then PATH=/usr/local/teTeX/bin:$PATH fi - SOURCE=m17n-lib-ja - echo '\appendix' > app.tex - sed -n -e '/コンパイル/,/GFDL/ p' < refman.tex >> app.tex + echo '\\appendix' > app.tex + sed -n -e '/コンパイル/,/include{m17nDBFormat}/ p' \ + -e '/Tutorial for writing/,/include{GFDL}/ p' \ + -e '/printindex/,$ p' < refman.tex >> app.tex sed -e '/documentclass/ s/a4paper/a4paper,twoside/' \ - -e '/コンパイル/,/GFDL/ d' \ - -e '/structMInputXIMArgIM/ r app.tex' \ - < refman.tex > ${SOURCE}.tex + -e '/inputenc/ d' \ + -e '/コンパイル/,/include{GFDL}/ d' \ + -e '/chapter{ファイル}/,$ d' < refman.tex > m17n-lib.tex + cat app.tex >> m17n-lib.tex + rm -rf tmp + mkdir tmp + for f in *; do + case "$f" in + m17nDBData.tex) ;; + *.tex) mv "$f" tmp; iconv -f utf-8 -t euc-jp < "tmp/$f" > "$f";; + *.sty) mv "$f" tmp; iconv -f utf-8 -t euc-jp < "tmp/$f" > "$f";; + esac + done + rm -rf tmp elif [ $USR_JA_DEV = "dev" ] ; then - SOURCE=m17n-lib-dev sed -e '/documentclass/ s/a4paper/a4paper,twoside/' \ -e '/The m17n Library Module Index/,/pages/ d' \ -e '/The m17n Library File Documentation/,/textprop_8c/ d' \ -e '/The m17n Library Directory Documentation/,/dir_000001/ d' \ -e 's/The m17n Library Page Documentation/Appendix/' \ - < refman.tex > ${SOURCE}.tex + < refman.tex > m17n-lib.tex else - SOURCE=m17n-lib echo '\\appendix' > app.tex - sed -n -e '/Print compile/,/GFDL/ p' < refman.tex >> app.tex + sed -n -e '/Print compile/,/include{GFDL}/ p' \ + -e '/printindex/,$ p' < refman.tex >> app.tex sed -e '/documentclass/ s/a4paper/a4paper,twoside/' \ - -e '/Print compile/,/GFDL/ d' \ - -e '/structMInputXIMArgIM/ r app.tex' \ - < refman.tex > ${SOURCE}.tex + -e '/Print compile/,/include{GFDL}/ d' \ + -e '/chapter{File Documentation}/,$ d' < refman.tex > m17n-lib.tex + cat app.tex >> m17n-lib.tex fi -${LATEX} ${SOURCE}.tex -#if [ "${USR_JA_DEV}" = "ja" ] ; then -# nkf -e < ${SOURCE}.idx > temp.idx; mv temp.idx ${SOURCE}.idx -#fi -/usr/bin/makeindex ${SOURCE}.idx -${LATEX} ${SOURCE}.tex -${LATEX} ${SOURCE}.tex +${LATEX} m17n-lib.tex +makeindex m17n-lib.idx +${LATEX} m17n-lib.tex +${LATEX} m17n-lib.tex