Tips on Book Creation
Using LYX

Bruce Momjian

During the process of writing a book on POSTGRESQL, I learned number of tricks. I required output of both HTML and PDF formats. I used: Tips for LYX: Tips for TeTEX: Tips for Ghostscript and PDF: Tips for LaTex2html: Recommended books for LATEX fine-tuning: Here is the script I use to install new TEX fonts:


[ $# -eq 0 ] && echo Usage:  $0 [-n] afm ... 1>&2 && exit 1


# This uses LY1 encoding from


trap rm -fr /tmp/$$ /tmp/$$a 0 1 2 3 15

#set -x


mkdir /tmp/$$


for FILE


        # Remove a__ for Bitstream

        BASE=filebaseonly $FILE | sed 's/[a-z]___$//g' | sed 's/___$//g'

        BASEFILE=filebaseonly $FILE


# non-smallcaps 


        afm2tfm $FILE -v /tmp/$$/$BASE \

        -T /usr/tex/dvips/base/texnansx.enc /tmp/$$/r$BASE | tee /tmp/$$a


        vptovf /tmp/$$/$BASE.vpl /tmp/$$/$BASE.vf /tmp/$$/$BASE.tfm


        FONT=head -1 /tmp/$$a | sed 's/^r//g' | sed 's/texnansx/texnansi/g'

        FONT2=echo $FONT | awk '{print $1, $2}'

        FONTSC=recho $FONT | sed 's/ /sc /'

        FONTSC2=echo $FONTSC | awk '{print $1, $2}'


# do smallcaps


        afm2tfm $FILE -V /tmp/$$/${BASE}sc \

        -T /usr/tex/dvips/base/texnansx.enc /tmp/$$/r${BASE}sc | tee /tmp/$$a


        vptovf /tmp/$$/${BASE}sc.vpl /tmp/$$/${BASE}sc.vf /tmp/$$/${BASE}sc.tfm



        cp /tmp/$$/*.tfm /usr/contrib/teTEX/texmf/fonts/tfm/local


        cp /tmp/$$/*.vf /usr/contrib/teTEX/texmf/fonts/vf/local


        rm /tmp/$$/*


        pipe grep -v ^$FONT2$ /usr/contrib/teTEX/texmf/fontname/

        echo $FONT2 » /usr/contrib/teTEX/texmf/fontname/

        pipe grep -v ^$FONTSC2$ /usr/contrib/teTEX/texmf/fontname/

        echo $FONTSC2 » /usr/contrib/teTEX/texmf/fontname/


        pipe grep -v ^$FONT  /usr/contrib/teTEX/texmf/dvips/misc/

        echo $FONT <$BASEFILE.pfb »/usr/contrib/teTEX/texmf/dvips/misc/

        pipe grep -v ^$FONTSC  /usr/contrib/teTEX/texmf/dvips/misc/

        echo $FONTSC <$BASEFILE.pfb »/usr/contrib/teTEX/texmf/dvips/misc/



texhash Commons Attribution License