#!/bin/sh # Rd2dvi -- 'check' man pages (help files) by 'LaTeX'.. # # Example (in $RHOME): # bin/Rd2dvi src/library/base/man/Normal # bin/Rd2dvi `grep -l 'KEYWORD(distr' src/library/base/man/* |sort|uniq` # Pwd=`dirname $0` RHOME=${Pwd}/.. MANTEXDIR=${RHOME}/doc/manual D2L="${Pwd}/Rdconv -t latex" # call_dir=`pwd` if [ -f Rd2.tex ] then echo "'Rd2.tex' already exists -- renaming it to Rd2.tex.Older" echo " -------- " mv Rd2.tex Rd2.tex.Older fi $D2L $@ > Rd2.tex echo "MANTEXDIR= '$MANTEXDIR'" if [ ! -f Rd2dvi.tex ] then ##ln -s ${MANTEXDIR}/Rd2dvi.tex . R_P=`echo 'getenv("R_PAPERSIZE")'| R --vanilla --quiet|grep '"'|sed 's/ *//g;s/"//g'` sed "s/a4paper/${R_P}paper/" ${MANTEXDIR}/Rd2dvi.tex > Rd2dvi.tex fi if [ ! -f Rd.sty ]; then sed 's/markright{#1}/markboth{#1}{#1}/' ${MANTEXDIR}/Rd.sty > Rd2.sty fi #exit #--------------------- latex Rd2dvi if [ -x `/usr/bin/which makeindex` ] then makeindex Rd2dvi latex Rd2dvi fi if [ -x `/usr/bin/which xdvi` ] then xdvi Rd2dvi & fi echo '' echo 'Rd2dvi: You may want to clean up by' echo ' rm -f Rd2dvi.* Rd2.sty Rd2.tex*' echo ''