0
     ?ˆÙØâ484×¿à ä    ?‹      ½”]oÚ0†ïû+Î|±;rH “Ö:žA*_¢LÓ4íÂ$Nbld›2úëg+t‚mÕ¦]Å‰Ÿ¼>Ïqbú*wgŸ'=ø0`òñý ßÒ@üÔê"&³¤žhÍ±7"@JçV7ˆ›Í&Ø´m
œM±tËª�Ö™º saWt÷Œ]-Ïü¨“®¬¯2ñt¨×ÎÊL´qmÚ’��Z	©r�F¥ÃÎRøDŽwB¹uºØR¬3|*bé\gÛÝjá_&û€}‘|¾_`74Œºx%§W„Q¹,Àš4&(S­,Î+®A!s¼r1ùÒïŽ¿z]¹{›Q¥yLÞuãÑí8Nñ¥ ÈÏ3CÏtpë`©3™K‘]„ïkø^>^Lj&65rå¤VG½â©jª+»âÞõÚ”æ”ª‘ìwÝàé³fL:ÓÞh–ô§uK²]Ä±ºìa?«$ÒˆÔi³=XÔ‘¯ÕÜ®nÜÂ¡Æ}a 8K¾@l­JoÔ©›ïÛY«�^Kû «Jøm|Ÿ–ûS}Q3zÓ›�è-„áM+¸ ¶‚æÝjåd*ªJvÿ‘(¸þ…È~�xøU)î� Šõ�ó‡¤¢‚Ó    7   Aˆl–ßi~” ”Ð?Je@‚ãn\ªbÑ¿�þY�bY¹G$}¢·)üÿä„nº÷ãÀá =¢    A#!/usr/bin/perl
# Debian required shebang above
# Original shebang below
# #!/usr/bin/env perl
# $Id: texfot,v 1.48 2022/12/16 02:15:30 karl Exp $
# Invoke a TeX command, filtering all but interesting terminal output;
# do not look at the log or check any output files.
# Exit status is that of the subprogram.
# Tee the complete (unfiltered) standard output and standard error to
# (by default) /tmp/fot.$UID.
# 
# Public domain.  Originally written 2014 by Karl Berry.

my $ident = '$Id: texfot,v 1.48 2022/12/16 02:15:30 karl Exp $';
(my $prg = $0) =~ s,^.*/,,;
select STDERR; $| = 1;  # no buffering
select STDOUT; $| = 1;

use IPC::Open3; # control what happens with stderr from the child.
use IO::File;   # use new_tmpfile for that stderr.

# require_order because we don't want getopt to permute anything;
# arguments to the tex invocation must remain in order, not handled by us.
use Getopt::Long qw(:config require_order);
use Pod::Usage;

my @opt_accept = ();
my $opt_debug = 0;
my @opt_ignore = ();
my $opt_interactive = 0;
my $opt_quiet = 0;
my $opt_stderr = 1;
my $opt_tee = ($ENV{"TMPDIR"} || $ENV{"TMP"} || "/tmp") . "/fot.$>";
my $opt_version = 0;
my $opt_help = 0;

exit (&main ());


# 
sub main {
  my $ret = GetOptions (
    "accept=s"     => \@opt_accept,
    "debug!"       => \$opt_debug,
    "ignore=s"     => \@opt_ignore,
    "interactive!" => \$opt_interactive,
    "quiet!"       => \$opt_quiet,
    "stderr!"	   => \$opt_stderr,
    "tee=s"        => \$opt_tee,
    "version"      => \$opt_version,
    "help|?"       => \$opt_help) || pod2usage (2);

  # --help, --version
  pod2usage ("-exitstatus" => 0, "-verbose" => 2)
    if $opt_help;
  #
  if ($opt_version) {
    print "$ident\n";
    return 0;
  }
  
  die "$prg: missing TeX command, i.e., a non-option argument\n"
      . "Try --help if you need it."
    if ! @ARGV;

  # guess we're going to run something.  typically no interaction.
  close (STDIN) unless $opt_interactive;

  local *FOTTMP;
  $FOTTMP = ">$opt_tee";
  open (FOTTMP) || die "$prg: aborting, open($FOTTMP) failed: $!";

  # We need to separate stderr from stdout.  Otherwise they are randomly
  # merged, not always at line breaks, hence we can lose useful messages.
  print "$0: invoking: @ARGV\n" unless $opt_quiet;

  # In order to avoid deadlock when there is lots of stuff on stderr,
  # we must write it to a temporary file
  # http://perldoc.perl.org/perlfaq8.html#How-can-I-capture-STDERR-from-an-external-command 
  local *TEXERR = IO::File->new_tmpfile
  || die "IO::File->new_tmpfile failed: $!";
  
  # But we can process stdout as it comes.
  local *TEXOUT;
  my $pid = open3 (undef, \*TEXOUT, ">&TEXERR", @ARGV)
            || die "$prg: fork(TeX) failed: $! [cmd=@ARGV]\n";
  &debug ("open3() returned pid $pid [cmd=@ARGV]");
  
  # It's not ideal to read all of stdout and then all of stderr; it would
  # be better to intermix them in the original order of child output.
  # But this is simpler than other ways of avoiding possible deadlock (such
  # as select, sysread, etc.).
  &debug ("processing stdout from child");
  &process_output (\*TEXOUT, "");
  
  # Be sure everything is drained.
  &debug ("starting waitpid() for $pid")  ;
  waitpid ($pid, 0) || die "$prg: waitpid($pid) failed: $!\n";
  my $child_exit_status = $? >> 8;
  &debug ("child exit status = $child_exit_status\n");

  &debug ("processing stderr from child");
  seek (TEXERR, 0, 0) || warn "seek(stderr) failed: $!";
  &process_output (\*TEXERR, "[stderr] 