/[groff]/groff/contrib/pdfmark/pdfroff.sh
ViewVC logotype

Diff of /groff/contrib/pdfmark/pdfroff.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by wl, Fri Jun 17 07:11:37 2005 UTC revision 1.7 by wl, Thu Jun 23 20:59:34 2005 UTC
# Line 152  Line 152 
152  # to be passed on to 'groff', enforcing the '-Tps' option.  # to be passed on to 'groff', enforcing the '-Tps' option.
153  #  #
154    DIFF="" STREAM="" INPUT_FILES=""    DIFF="" STREAM="" INPUT_FILES=""
155    SHOW_VERSION="" ARGLIST="-Tps" GROFF_STYLE="$GROFF -Tps"    SHOW_VERSION="" GROFF_STYLE="$GROFF -Tps"
156    while test $# -gt 0    while test $# -gt 0
157    do    do
158      case "$1" in      case "$1" in
# Line 236  Line 236 
236                 ;;                 ;;
237    
238               --version)               --version)
239                 ARGLIST="$ARGLIST \"$1\""                 GROFF_STYLE="$GROFF_STYLE \"$1\""
240                 SHOW_VERSION="GNU pdfroff (groff) version @VERSION@"                 SHOW_VERSION="GNU pdfroff (groff) version @VERSION@"
241                 ;;                 ;;
242    
# Line 291  Line 291 
291  #  #
292        - | -i*)        - | -i*)
293             STREAM="$CAT ${GROFF_TMPDIR}/pdf$$.in |"             STREAM="$CAT ${GROFF_TMPDIR}/pdf$$.in |"
294             ARGLIST="$ARGLIST $1" INPUT_FILES="$INPUT_FILES $1"             test "$1" = "-" && INPUT_FILES="$INPUT_FILES $1" \
295                 || GROFF_STYLE="$GROFF_STYLE $1"
296             ;;             ;;
297  #  #
298  #     Those standard options which expect an argument, but are specified with  #     Those standard options which expect an argument, but are specified with
# Line 325  Line 326 
326  #     All other standard options are simply passed through to 'groff',  #     All other standard options are simply passed through to 'groff',
327  #     with no validation beforehand.  #     with no validation beforehand.
328  #  #
329        -*)  ARGLIST="$ARGLIST \"$1\"" GROFF_STYLE="$GROFF_STYLE \"$1\""        -*)  GROFF_STYLE="$GROFF_STYLE \"$1\""
330             ;;             ;;
331  #  #
332  #     All non-option arguments are considered as possible input file names,  #     All non-option arguments are considered as possible input file names,
333  #     and are passed on to 'groff', unaltered.  #     and are passed on to 'groff', unaltered.
334  #  #
335        *)   ARGLIST="$ARGLIST \"$1\""        *)   INPUT_FILES="$INPUT_FILES \"$1\""
            test -f "$1" && INPUT_FILES="$INPUT_FILES \"$1\""  
336             ;;             ;;
337      esac      esac
338      shift      shift
# Line 345  Line 345 
345    if test -n "$SHOW_VERSION"    if test -n "$SHOW_VERSION"
346    then    then
347      echo >&2 "$SHOW_VERSION"      echo >&2 "$SHOW_VERSION"
348      echo >&2; eval $GROFF $ARGLIST      echo >&2; eval $GROFF_STYLE $INPUT_FILES
349      exit $?      exit $?
350    fi    fi
351  #  #
# Line 460  Line 460 
460  #   filtering them into the reference dictionary; discard incomplete 'groff' output  #   filtering them into the reference dictionary; discard incomplete 'groff' output
461  #   at this stage.  #   at this stage.
462  #  #
463      eval $STREAM $GROFF -Z 1>$NULLDEV 2>$WRKFILE $REFCOPY $ARGLIST      eval $STREAM $GROFF_STYLE -Z 1>$NULLDEV 2>$WRKFILE $REFCOPY $INPUT_FILES
464      $AWK '/^gropdf-info:href/ {$1 = ".pdfhref D -N"; print}' $WRKFILE > $REFFILE      $AWK '/^gropdf-info:href/ {$1 = ".pdfhref D -N"; print}' $WRKFILE > $REFFILE
465    done    done
466    $SAY >&2 " done"    $SAY >&2 " done"
# Line 522  Line 522 
522    if test -n "$STYLESHEET"    if test -n "$STYLESHEET"
523    then    then
524      DOT='^\.[   ]*'      DOT='^\.[   ]*'
525        CS_MACRO=${CS_MACRO-"CS"} CE_MACRO=${CE_MACRO-"CE"}
526      $SAY >&2 $n "Formatting document ... front cover section ..$c"      $SAY >&2 $n "Formatting document ... front cover section ..$c"
527      CS_FILTER="$STREAM $SED -n '/$DOT${CS_MACRO-"CS"}/,/$DOT${CE_MACRO-"CE"}/p'"      CS_FILTER="$STREAM $SED -n '/${DOT}${CS_MACRO}/,/${DOT}${CE_MACRO}/p'"
528      eval $CS_FILTER $INPUT_FILES | eval $GROFF_STYLE $STYLESHEET - > $CS_DATA      eval $CS_FILTER $INPUT_FILES | eval $GROFF_STYLE $STYLESHEET - > $CS_DATA
529      $SAY >&2 ". done"      $SAY >&2 ". done"
530    fi    fi
# Line 534  Line 535 
535    if test -n "$TC_DATA"    if test -n "$TC_DATA"
536    then    then
537      $SAY >&2 $n "Formatting document ... table of contents ..$c"      $SAY >&2 $n "Formatting document ... table of contents ..$c"
538      eval $STREAM $GROFF $TOC_FORMAT $REFCOPY $ARGLIST > $TC_DATA      eval $STREAM $GROFF_STYLE $TOC_FORMAT $REFCOPY $INPUT_FILES > $TC_DATA
539      $SAY >&2 ". done"      $SAY >&2 ". done"
540    fi    fi
541  #  #
542  # In all cases, a final 'groff' pass is required, to format the document body.  # In all cases, a final 'groff' pass is required, to format the document body.
543  #  #
544    $SAY >&2 $n "Formatting document ... body section ..$c"    $SAY >&2 $n "Formatting document ... body section ..$c"
545    eval $STREAM $GROFF $BODY_FORMAT $REFCOPY $ARGLIST > $BD_DATA    eval $STREAM $GROFF_STYLE $BODY_FORMAT $REFCOPY $INPUT_FILES > $BD_DATA
546    $SAY >&2 ". done"    $SAY >&2 ". done"
547  #  #
548  # Finally ...  # Finally ...
# Line 568  Line 569 
569    $SAY >&2 ". done"    $SAY >&2 ". done"
570  #  #
571  # ------------------------------------------------------------------------------  # ------------------------------------------------------------------------------
572  # $Source$: end of file  # $RCSfile$ $Revision$: end of file

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26