#!/bin/bash # wrapper script for makeindex (to be called from lyx) # from http://www.educat.hu-berlin.de/~voss/lyx/index/indexstyle.phtml # copy the indexstyle (document_base_name.mst) to the directory $INDEXSTYLE. # if this file does not exist, $ISTDEFAULT is used instead. # if this also does not exist, no style file is used. # The .idx file can be filtered through a program named $FILTER. echo "Yes, I'm called!" INDEXSTYLE=~/indexstyles ISTDEFAULT=default.ist FILTER=cat MAKEINDEX=/opt/local/bin/makeindex # LyX (1.1.5fix1) calls makeindex with "makeindex -c -q idxfile" IDXFILE=$3 BASE=`basename $IDXFILE .idx` INDFILE=$BASE.ind MSTFILE=$BASE.mst ILGFILE=$BASE.ilg [ -f $INDEXSTYLE/$ISTDEFAULT ] && STYLE="-s $ISTDEFAULT" [ -f $INDEXSTYLE/$MSTFILE ] && STYLE="-s $MSTFILE" export INDEXSTYLE $FILTER $IDXFILE | $MAKEINDEX -c -q $STYLE -o $INDFILE -t $ILGFILE