⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 texi2dvi

📁 这个是LINUX下的GDB调度工具的源码
💻
📖 第 1 页 / 共 2 页
字号:
#! /bin/sh# texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.# $Id: texi2dvi,v 0.43 1999/09/28 19:36:53 karl Exp $## Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, you can either send email to this# program's maintainer or write to: The Free Software Foundation,# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.## Original author: Noah Friedman <friedman@gnu.org>.## Please send bug reports, etc. to bug-texinfo@gnu.org.# If possible, please send a copy of the output of the script called with# the `--debug' option when making a bug report.# This string is expanded by rcs automatically when this file is checked out.rcs_revision='$Revision: 0.43 $'rcs_version=`set - $rcs_revision; echo $2`program=`echo $0 | sed -e 's!.*/!!'`version="texi2dvi (GNU Texinfo 4.0) $rcs_versionCopyright (C) 1999 Free Software Foundation, Inc.There is NO warranty.  You may redistribute this softwareunder the terms of the GNU General Public License.For more information about these matters, see the files named COPYING."usage="Usage: $program [OPTION]... FILE...Run each Texinfo or LaTeX FILE through TeX in turn until allcross-references are resolved, building all indices.  The directorycontaining each FILE is searched for included files.  The suffix of FILEis used to determine its language (LaTeX or Texinfo).Makeinfo is used to perform Texinfo macro expansion before running TeXwhen needed.Options:  -@                   Use @input instead of \input; for preloaded Texinfo.  -b, --batch          No interaction.  -c, --clean          Remove all auxiliary files.  -D, --debug          Turn on shell debugging (set -x).  -e, --expand         Force macro expansion using makeinfo.  -I DIR               Search DIR for Texinfo files.  -h, --help           Display this help and exit successfully.  -l, --language=LANG  Specify the LANG of FILE: LaTeX or Texinfo.  -p, --pdf            Use pdftex or pdflatex for processing.  -q, --quiet          No output unless errors (implies --batch).  -s, --silent         Same as --quiet.  -t, --texinfo=CMD    Insert CMD after @setfilename in copy of input file.                       Multiple values accumulate.  -v, --version        Display version information and exit successfully.  -V, --verbose        Report on what is done.The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,TEX (or PDFTEX), and TEXINDEX environment variables are used to runthose commands, if they are set.Email bug reports to <bug-texinfo@gnu.org>,general questions and discussion to <help-texinfo@gnu.org>."# Initialize variables for option overriding and otherwise.# Don't use `unset' since old bourne shells don't have this command.# Instead, assign them an empty value.escape='\'batch=false     # eval for batch modeclean=debug=expand=         # t for expansion via makeinfooformat=dviset_language=miincludes=     # makeinfo include pathtextra=tmpdir=${TMPDIR:-/tmp}/t2d$$  # avoid collisions on 8.3 filesystems.txincludes=     # TEXINPUTS extensionstxiprereq=19990129 # minimum texinfo.tex version to have macro expansionquiet=          # by default let the tools' message be displayedverbose=false   # echo for verbose modeorig_pwd=`pwd`# Systems which define $COMSPEC or $ComSpec use semicolons to separate# directories in TEXINPUTS.if test -n "$COMSPEC$ComSpec"; then  path_sep=";"else  path_sep=":"fi# Save this so we can construct a new TEXINPUTS path for each file.TEXINPUTS_orig="$TEXINPUTS"# Unfortunately makeindex does not read TEXINPUTS.INDEXSTYLE_orig="$INDEXSTYLE"export TEXINPUTS INDEXSTYLE# Push a token among the arguments that will be used to notice when we# ended options/arguments parsing.# Use "set dummy ...; shift" rather than 'set - ..." because on# Solaris set - turns off set -x (but keeps set -e).# Use ${1+"$@"} rather than "$@" because Digital Unix and Ultrix 4.3# still expand "$@" to a single argument (the empty string) rather# than nothing at all.arg_sep="$$--$$"set dummy ${1+"$@"} "$arg_sep"; shift# # Parse command line arguments.while test x"$1" != x"$arg_sep"; do  # Handle --option=value by splitting apart and putting back on argv.  case "$1" in    --*=*)      opt=`echo "$1" | sed -e 's/=.*//'`      val=`echo "$1" | sed -e 's/[^=]*=//'`      shift      set dummy "$opt" "$val" ${1+"$@"}; shift      ;;  esac  # This recognizes --quark as --quiet.  So what.  case "$1" in    -@ ) escape=@;;    # Silently and without documentation accept -b and --b[atch] as synonyms.    -b | --b*) batch=eval;;    -q | -s | --q* | --s*) quiet=t; batch=eval;;    -c | --c*) clean=t;;    -D | --d*) debug=t;;    -e | --e*) expand=t;;    -h | --h*) echo "$usage"; exit 0;;    -I | --I*)      shift      miincludes="$miincludes -I $1"      txincludes="$txincludes$path_sep$1"      ;;    -l | --l*) shift; set_language=$1;;    -p | --p*) oformat=pdf;;    -t | --t*) shift; textra="$textra\\$1";;    -v | --vers*) echo "$version"; exit 0;;    -V | --verb*) verbose=echo;;    --) # What remains are not options.      shift      while test x"$1" != x"$arg_sep"; do        set dummy ${1+"$@"} "$1"; shift        shift      done      break;;    -*)      echo "$0: Unknown or ambiguous option \`$1'." >&2      echo "$0: Try \`--help' for more information." >&2      exit 1;;    *) set dummy ${1+"$@"} "$1"; shift;;   esac   shiftdone# Pop the tokenshift# Interpret remaining command line args as filenames.if test $# = 0; then  echo "$0: Missing file arguments." >&2  echo "$0: Try \`--help' for more information." >&2  exit 2fi# Prepare the temporary directory.  Remove it at exit, unless debugging.if test -z "$debug"; then  trap "cd / && rm -rf $tmpdir" 0 1 2 15fi# Create the temporary directory with strict rights(umask 077 && mkdir $tmpdir) || exit 1# Prepare the tools we might need.  This may be extra work in some# cases, but improves the readibility of the script.utildir=$tmpdir/utilsmkdir $utildir || exit 1# A sed script that preprocesses Texinfo sources in order to keep the# iftex sections only.  We want to remove non TeX sections, and# comment (with `@c texi2dvi') TeX sections so that makeinfo does not# try to parse them.  Nevertheless, while commenting TeX sections,# don't comment @macro/@end macro so that makeinfo does propagate# them.  Unfortunately makeinfo --iftex --no-ifhtml --no-ifinfo# doesn't work well enough (yet) to use that, so work around with sed.comment_iftex_sed=$utildir/comment.sedcat <<EOF >$comment_iftex_sed/^@tex/,/^@end tex/{  s/^/@c texi2dvi/}/^@iftex/,/^@end iftex/{  s/^/@c texi2dvi/  /^@c texi2dvi@macro/,/^@c texi2dvi@end macro/{    s/^@c texi2dvi//  }}/^@html/,/^@end html/d/^@ifhtml/,/^@end ifhtml/d/^@ifnottex/,/^@end ifnottex/d/^@ifinfo/,/^@end ifinfo/{  /^@node/p  /^@menu/,/^@end menu/p  d}EOF# Uncommenting is simple: Remove any leading `@c texi2dvi'.uncomment_iftex_sed=$utildir/uncomment.sedcat <<EOF >$uncomment_iftex_seds/^@c texi2dvi//EOF# A shell script that computes the list of xref files.# Takes the filename (without extension) of which we look for xref# files as argument.  The index files must be reported last.get_xref_files=$utildir/get_xref.shcat <<\EOF >$get_xref_files#! /bin/sh# Get list of xref files (indexes, tables and lists).# Find all files having root filename with a two-letter extension,# saves the ones that are really Texinfo-related files.  .?o? catches# LaTeX tables and lists.for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do  # If file is empty, skip it.  test -s "$this_file" || continue  # If the file is not suitable to be an index or xref file, don't  # process it.  The file can't be if its first character is not a  # backslash or single quote.  first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file`  if test "x$first_character" = "x\\" \     || test "x$first_character" = "x'"; then    xref_files="$xref_files ./$this_file"  fidoneecho "$xref_files"EOFchmod 500 $get_xref_files# File descriptor usage:# 0 standard input# 1 standard output (--verbose messages)# 2 standard error# 3 some systems may open it to /dev/tty# 4 used on the Kubota Titan# 5 tools output (turned off by --quiet)# Tools' output.  If quiet, discard, else redirect to the message flow.if test "$quiet" = t; then  exec 5>/dev/nullelse  exec 5>&1fi# Enable tracingtest "$debug" = t && set -x# # TeXify files.for command_line_filename in ${1+"$@"}; do  $verbose "Processing $command_line_filename ..."  # If the COMMAND_LINE_FILENAME is not absolute (e.g., --debug.tex),  # prepend `./' in order to avoid that the tools take it as an option.  echo "$command_line_filename" | egrep '^(/|[A-z]:/)' >/dev/null \  || command_line_filename="./$command_line_filename"  # See if the file exists.  If it doesn't we're in trouble since, even  # though the user may be able to reenter a valid filename at the tex  # prompt (assuming they're attending the terminal), this script won't  # be able to find the right xref files and so forth.  if test ! -r "$command_line_filename"; then    echo "$0: Could not read $command_line_filename, skipping." >&2    continue

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -