# Main program main loop - TeXify each file in turn. for command_line_filename do verbose "Processing $command_line_filename ..." input_file_name_decode # `texinfo' or `latex'? in_lang=`compute_language "$command_line_filename"` # An auxiliary directory used for all the auxiliary tasks involved # in compiling this document. case $build_dir in '' | . ) t2ddir=$out_noext.t2d ;; *) # Avoid collisions between multiple occurrences of the same # file, so depend on the output path. Remove leading `./', # at least to avoid creating a file starting with `.!', i.e., # an invisible file. The sed expression is fragile if the cwd # has active characters. Transform / into ! so that we don't # need `mkdir -p'. It might be something to reconsider. t2ddir=$build_dir/`echo "$out_dir_abs/$out_noext.t2d" | $SED "s,^$orig_pwd/,,;s,^\./,,;s,/,!,g"` esac # Remove it at exit if clean mode. trap "cleanup" 0 1 2 15 ensure_dir "$build_dir" "$t2ddir" # Sometimes there are incompatibilities between auxiliary files for # DVI and PDF. The contents can also change whether we work on PDF # and/or DVI. So keep separate spaces for each. workdir=$t2ddir/`out_lang_tex` ensure_dir "$workdir" # _build. In a tidy build, where the auxiliary files are output. if $tidy; then work_build=$workdir/build else work_build=. fi # _bak. Copies of the previous auxiliary files (another round is # run if they differ from the new ones). work_bak=$workdir/bak # Make those directories. ensure_dir "$work_build" "$work_bak" # Decide how to find auxiliary files created by TeX. decide_aux_files_method case $action in compile) # Compile the document. compile cleanup ;; mostly-clean) xref_files_new=`generated_files_get` mostly_clean ;; esac done + for command_line_filename in '"$@"' + verbose 'Processing foo.tex ...' + false + input_file_name_decode + case $command_line_filename in + case $command_line_filename in + echo foo.tex + LC_ALL=C + egrep '^(/|[A-Za-z]:/)' + command_line_filename=./foo.tex + test -r ./foo.tex func_dirname "$command_line_filename" ++ func_dirname ./foo.tex ++ dirname ./foo.tex + in_dir=. basename "$command_line_filename" ++ basename ./foo.tex + in_base=foo.tex noext "$in_base" ++ noext foo.tex ++ echo foo.tex ++ sed -e 's/\.[^/.][^/.]*$//' + in_noext=foo + in_input=./foo.tex + test x '!=' x out_lang_ext ++ out_lang_ext ++ case $out_lang in ++ echo pdf + out_name=foo.pdf func_dirname "$out_name" ++ func_dirname foo.pdf ++ dirname foo.pdf + out_dir=. absolute "$out_dir" ++ absolute . ++ case $1 in echo "$1" | $SED -n 's,.*[^/]\(/*\)$,\1,p' +++ echo . +++ sed -n 's,.*[^/]\(/*\)$,\1,p' ++ absolute_slashes= func_dirname "$1" +++ func_dirname . +++ dirname . ++ absolute_rel=/tmp/foo/. ++ test -d /tmp/foo/. ++ cd /tmp/foo/. pwd +++ pwd basename "$1" +++ basename . ++ absolute_name=/tmp/foo/. ++ echo /tmp/foo/. + out_dir_abs=/tmp/foo/. basename "$out_name" ++ basename foo.pdf + out_base=foo.pdf noext "$out_base" ++ noext foo.pdf ++ echo foo.pdf ++ sed -e 's/\.[^/.][^/.]*$//' + out_noext=foo compute_language "$command_line_filename" ++ compute_language ./foo.tex ++ test -n '' ++ sed 1q ./foo.tex ++ grep 'input texinfo' ++ case $1 in ++ echo latex + in_lang=latex + case $build_dir in echo "$out_dir_abs/$out_noext.t2d" | $SED "s,^$orig_pwd/,,;s,^\./,,;s,/,!,g" ++ echo /tmp/foo/./foo.t2d ++ sed 's,^/tmp/foo/,,;s,^\./,,;s,/,!,g' + t2ddir=/tmp/bar/foo.t2d + trap cleanup 0 1 2 15 + ensure_dir /tmp/bar /tmp/bar/foo.t2d + for dir in '"$@"' + test -d /tmp/bar + for dir in '"$@"' + test -d /tmp/bar/foo.t2d out_lang_tex ++ out_lang_tex ++ case $out_lang in ++ echo pdf + workdir=/tmp/bar/foo.t2d/pdf + ensure_dir /tmp/bar/foo.t2d/pdf + for dir in '"$@"' + test -d /tmp/bar/foo.t2d/pdf + mkdir /tmp/bar/foo.t2d/pdf + true + work_build=/tmp/bar/foo.t2d/pdf/build + work_bak=/tmp/bar/foo.t2d/pdf/bak + ensure_dir /tmp/bar/foo.t2d/pdf/build /tmp/bar/foo.t2d/pdf/bak + for dir in '"$@"' + test -d /tmp/bar/foo.t2d/pdf/build + mkdir /tmp/bar/foo.t2d/pdf/build + for dir in '"$@"' + test -d /tmp/bar/foo.t2d/pdf/bak + mkdir /tmp/bar/foo.t2d/pdf/bak + decide_aux_files_method + test -n '' + TEXI2DVI_USE_RECORDER=nomaybe + case $TEXI2DVI_USE_RECORDER in + check_openout_in_log_support + verbose 'Checking TeX \openout in log support...' + false + make_openout_test '' log + ensure_dir /tmp/bar/foo.t2d/pdf/check_recorder + for dir in '"$@"' + test -d /tmp/bar/foo.t2d/pdf/check_recorder + mkdir /tmp/bar/foo.t2d/pdf/check_recorder + cd_dir /tmp/bar/foo.t2d/pdf/check_recorder + cd /tmp/bar/foo.t2d/pdf/check_recorder echo "$1" | $SED -e 's/[^/\][^/\]*/../g' -e 's/[/\]$//' ++ echo /tmp/bar/foo.t2d/pdf/check_recorder ++ sed -e 's/[^/\][^/\]*/../g' -e 's/[/\]$//' + cdd_prefix=/../../../../.. + for cdd_dir in '$path_vars' + eval 'case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac' case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac ++ case "17650cdd_dir" in ++ eval 'work_build=/../../../../../$work_build' work_build=/../../../../../$work_build +++ work_build=/../../../../..//tmp/bar/foo.t2d/pdf/build + for cdd_dir in '$path_vars' + eval 'case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac' case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac ++ case "17650cdd_dir" in ++ eval 'workdir=/../../../../../$workdir' workdir=/../../../../../$workdir +++ workdir=/../../../../..//tmp/bar/foo.t2d/pdf + for cdd_dir in '$path_vars' + eval 'case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac' case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac ++ case "17650cdd_dir" in ++ eval 't2ddir=/../../../../../$t2ddir' t2ddir=/../../../../../$t2ddir +++ t2ddir=/../../../../..//tmp/bar/foo.t2d + for cdd_dir in '$path_vars' + eval 'case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac' case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac ++ case "17650cdd_dir" in ++ eval 'work_bak=/../../../../../$work_bak' work_bak=/../../../../../$work_bak +++ work_bak=/../../../../..//tmp/bar/foo.t2d/pdf/bak + for cdd_dir in '$path_vars' + eval 'case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac' case "17650cdd_dir" in [\/]* | ?:[\/]*) ;; # absolute path - do nothing ?*) eval "$cdd_dir=$cdd_prefix/\$$cdd_dir" ;; esac ++ case "17650cdd_dir" in ++ eval 'in_input=/../../../../../$in_input' in_input=/../../../../../$in_input +++ in_input=/../../../../.././foo.tex + cat + recorder_option_maybe= + save_batch=false + batch=true + make_tex_cmd + case $in_lang:$latex2html:`out_lang_tex` in out_lang_tex ++ out_lang_tex ++ case $out_lang in ++ echo pdf + tex=pdflatex + case $in_lang:$tidy in + sed -n 's|^[ ]*\\include{\(.*\)/.*}.*|\1|p' /../../../../.././foo.tex + sort -u + read d sed: can't read /../../../../.././foo.tex: No such file or directory + tex_cmd=pdflatex + true + test '' '!=' set + tex_help_dir=/../../../../..//tmp/bar/foo.t2d/tex_help + ensure_dir /../../../../..//tmp/bar/foo.t2d/tex_help + for dir in '"$@"' + test -d /../../../../..//tmp/bar/foo.t2d/tex_help cd "$tex_help_dir" >&6 && $tex --help &1 || true ++ cd /../../../../..//tmp/bar/foo.t2d/tex_help ++ pdflatex --help + tex_help='Usage: pdftex [OPTION]... [TEXNAME[.tex]] [COMMANDS] or: pdftex [OPTION]... \FIRST-LINE or: pdftex [OPTION]... &FMT ARGS Run pdfTeX on TEXNAME, usually creating TEXNAME.pdf. Any remaining COMMANDS are processed as pdfTeX input, after TEXNAME is read. If the first line of TEXNAME is %&FMT, and FMT is an existing .fmt file, use it. Else use `NAME.fmt'\'', where NAME is the program invocation name, most commonly `pdftex'\''. Alternatively, if the first non-option argument begins with a backslash, interpret all non-option arguments as a line of pdfTeX input. Alternatively, if the first non-option argument begins with a &, the next word is taken as the FMT to read, overriding all else. Any remaining arguments are processed as above. If no arguments or options are specified, prompt for input. -draftmode switch on draft mode (generates no output PDF) -enc enable encTeX extensions such as \mubyte -etex enable e-TeX extensions [-no]-file-line-error disable/enable file:line:error style messages -fmt=FMTNAME use FMTNAME instead of program name or a %& line -halt-on-error stop processing at the first error -ini be pdfinitex, for dumping formats; this is implicitly true if the program name is `pdfinitex'\'' -interaction=STRING set interaction mode (STRING=batchmode/nonstopmode/ scrollmode/errorstopmode) -ipc send DVI output to a socket as well as the usual output file -ipc-start as -ipc, and also start the server at the other end -jobname=STRING set the job name to STRING -kpathsea-debug=NUMBER set path searching debugging flags according to the bits of NUMBER [-no]-mktex=FMT disable/enable mktexFMT generation (FMT=tex/tfm/pk) -mltex enable MLTeX extensions such as \charsubdef -output-comment=STRING use STRING for DVI file comment instead of date (no effect for PDF) -output-directory=DIR use existing DIR as the directory to write files in -output-format=FORMAT use FORMAT for job output; FORMAT is `dvi'\'' or `pdf'\'' [-no]-parse-first-line disable/enable parsing of first line of input file -progname=STRING set program (and fmt) name to STRING -recorder enable filename recorder [-no]-shell-escape disable/enable \write18{SHELL COMMAND} -shell-restricted enable restricted \write18 -src-specials insert source specials into the DVI file -src-specials=WHERE insert source specials in certain places of the DVI file. WHERE is a comma-separated value list: cr display hbox math par parend vbox -synctex=NUMBER generate SyncTeX data for previewers if nonzero -translate-file=TCXNAME use the TCX file TCXNAME -8bit make all characters printable by default -help display this help and exit -version output version information and exit Email bug reports to address@hidden' + case $tex_help in + tex_cmd='pdflatex --file-line-error' + tex_cmd='pdflatex --file-line-error' + test -n '' + test -n '' + test -n '' + true + tex_cmd='pdflatex --file-line-error /dev/null ; then # If the filename has funny characters, change the TeX category codes of # some characters within a group, and use \expandafter to input the file # outside of the group. # Make > an end group character, as it's unlikely to appear in # a filename. tex_cmd="$tex_cmd '${escape}bgroup${escape}catcode62=2'" # make letter { } $ # ~ ^ & for w in 123 125 36 35 126 136 26; do # TODO: check if letter actually in filename in order # to simplifiy TeX command line. tex_cmd="$tex_cmd '${escape}catcode$w=11${escape}relax'" done # Set \toks0 to "\input FILENAME\relax" tex_cmd="$tex_cmd'${escape}toks0${escape}bgroup" tex_cmd="$tex_cmd${escape}input $in_input${escape}relax>" tex_cmd="$tex_cmd${escape}expandafter${escape}egroup" tex_cmd="$tex_cmd${escape}the${escape}toks0${escape}relax'" else # In the case of a simple filename, just pass the filename # with no funny tricks. tex_cmd="$tex_cmd '${escape}input' '$in_input'" fi echo "$tex_cmd") ++ LC_ALL=C ++ echo /../../../../.././foo.tex ++ grep '[^a-zA-Z0-9/.]' ++ tex_cmd='pdflatex --file-line-error '\''\input'\'' '\''/../../../../.././foo.tex'\''' ++ echo 'pdflatex --file-line-error '\''\input'\'' '\''/../../../../.././foo.tex'\''' + tex_cmd='pdflatex --file-line-error '\''\input'\'' '\''/../../../../.././foo.tex'\''' + verbose '/usr/bin/texi2dvi: Running pdflatex --file-line-error '\''\input'\'' '\''/../../../../.././foo.tex'\'' ...' + false + eval 'pdflatex --file-line-error '\''\input'\'' '\''/../../../../.././foo.tex'\''' pdflatex --file-line-error '\input' '/../../../../.././foo.tex' ++ pdflatex --file-line-error '\input' /../../../../.././foo.tex + error 1 'pdflatex exited with bad status, quitting.' + error_status=1 + shift + report 'pdflatex exited with bad status, quitting.' + for i in '"$@"' + echo '/usr/bin/texi2dvi: pdflatex exited with bad status, quitting.' /usr/bin/texi2dvi: pdflatex exited with bad status, quitting. + test 1 '!=' 0 + exit 1 cleanup + cleanup + case $clean:$tidy in