texlive[47535] trunk: latexpand (18apr18)

commits+karl at tug.org commits+karl at tug.org
Tue May 1 19:35:38 CEST 2018


Revision: 47535
          http://tug.org/svn/texlive?view=revision&revision=47535
Author:   karl
Date:     2018-05-01 19:35:37 +0200 (Tue, 01 May 2018)
Log Message:
-----------
latexpand (18apr18)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand
    trunk/Master/texmf-dist/doc/support/latexpand/LICENCE
    trunk/Master/texmf-dist/doc/support/latexpand/README
    trunk/Master/texmf-dist/doc/support/latexpand/version.txt
    trunk/Master/texmf-dist/scripts/latexpand/latexpand

Modified: trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand	2018-05-01 17:35:15 UTC (rev 47534)
+++ trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand	2018-05-01 17:35:37 UTC (rev 47535)
@@ -1,13 +1,13 @@
 #!/usr/bin/perl
 # Inspired by latexpand by D. Musliner, University of Michigan
-# 2012, 2013, 2014, 2015, 2016: Matthieu Moy <Matthieu.Moy at imag.fr>
+# 2012, 2013, 2014, 2015, 2016, 2017: Matthieu Moy <git at matthieu-moy.fr>
 # BSD License
 
 use strict;
 use Cwd;
 use Getopt::Long;
-use Pod::Usage;
 use IO::Handle;
+use File::Spec;
 
 my $TEXINPUTS = $ENV{'TEXINPUTS'};
 if (!$TEXINPUTS) { $TEXINPUTS = getcwd(); }
@@ -27,6 +27,7 @@
 my $fatal;
 my $version;
 my $makeatletter;
+my $inside_import;
 
 GetOptions (
 	'h' => \$help,
@@ -44,16 +45,38 @@
 	'fatal' => \$fatal,
 	'version' => \$version,
         'makeatletter' => \$makeatletter,
-) or pod2usage(2);
+) or pod2usage_wrapper(2);
 version() if $version;
-pod2usage(1) if $help;
-pod2usage(-exitstatus => 0, -verbose => 2) if $long_help;
+pod2usage_wrapper(0) if $help;
+pod2usage_wrapper(-exitstatus => 0, -output => \*STDOUT, -verbose => 2) if $long_help;
 
+sub pod2usage_wrapper
+{
+	# Like pod2usage, but fall back to a simpler implem in case
+	# pod2usage can't be found.
+	if  (eval {require Pod::Usage;1;} ne 1) {
+		print "Please install perldoc and Pod::Usage to get proper help.\n";
+		my $started = 0;
+		open (my $in, '<', "$0") or die $!;
+		while (<$in>) {
+			if ($started) {
+				print;
+			}
+			if (/^__END__$/) {
+				$started = 1;
+			}
+		}
+	} else {
+		Pod::Usage->import();
+		pod2usage(@_);
+	}
+}
+
 sub get_version
 {
 	# $VERSION's value will be substituted by 'make dist', but the
 	# next line won't (the string has to be broken to avoid it).
-	my $VERSION = 'v1.3';
+	my $VERSION = 'v1.4-1-gb32a776';
 	if ($VERSION eq '@LATEXPAND' . '_VERSION@') {
 		my($vol,$dir,$file) = File::Spec->splitpath($0);
 		chdir($dir);
@@ -97,6 +120,7 @@
 	say "processing $file\n";
 	$makeatletter_found = 0;
 	$in_preamble = 1;
+        $inside_import = "";
 	process_file($file, "  ");
 }
 
@@ -106,14 +130,15 @@
 	my $prefix = (shift || "");
 	my $in_comment = 0;
 	open(my $FILE, "<", $file) or die "could not open input file '$file'\n";
+	my $commented_newline = 0;
 	while (my $line = <$FILE>) {
 		if ($line =~ /^[ \t]*\\endinput/) {
 			$line =~ s/(\\endinput.*)\n/% $1/;
 			$in_comment = 1;
-			process_line($line, $prefix);
+			process_line($line, $prefix, \$commented_newline);
 			last;
 		}
-		process_line($line, $prefix, $file);
+		process_line($line, $prefix, \$commented_newline, $file);
 		if ($line =~ /^%.*[^\n]\z/ || $line =~ /[^\\]%.*[^\n]\z/) {
 			# file ends with a comment not ending with a newline
 			print "\n";
@@ -132,8 +157,22 @@
 
 sub process_line
 {
-	my ($line, $prefix, $file) = @_;
+	my ($line, $prefix, $commented_newline, $file) = @_;
 	$_ = $line;
+	if ($$commented_newline && /^\s*$/) {
+		# Deal with:
+		#
+		# Line 1 % comment
+		#
+		# Line 2
+		#
+		# The newline after Line 1 is commented, but we still
+		# want a new paragraph. We strip the comment together
+		# with its newline, but re-add a newline to chnge
+		# paragraph here if needed:
+		print "\n";
+	}
+	$$commented_newline = 0;
 	# Consider \makeatletter only in preamble, because we do want
 	# to warn on \someCommand{\makeatletter\command at with@arobase}.
 	if ($in_preamble && /^[^%]*\\makeatletter/) {
@@ -154,10 +193,14 @@
 			# comments at end of files
 
 			# remove comments + whitespace-only lines completely
-			s/^\s*%.*\n//;
+			if (s/^\s*%.*\n//) {
+				$$commented_newline = 1;
+			}
 
 			# remove only the comment if the line has actual content
-			s/([^\\])%.*\n/$1\n/;
+			if (s/([^\\])%.*\n/$1/) {
+				$$commented_newline = 1;
+			}
 		}
 		# Apply the "empty comments" treatment unconditionally
 		# for end-of-files comments not matched above (it
@@ -189,6 +232,9 @@
 			}
 		} elsif (my ($before, $ignored, $full_filename, $after)
 			 = /^(([^%]|[^\\]%)*)\\input[{\s]+(.*?)[\s}](.*)$/) {
+                        if ($inside_import) {
+                              $full_filename = $inside_import . $full_filename;
+                        }
 			$full_filename = find_tex_file($full_filename, ":.tex");
 			if ($full_filename) {
 				say $prefix . "Found input for file: $full_filename\n";
@@ -208,6 +254,71 @@
 				}
 				$_ = "";
 			}
+		} elsif (my ($before, $ignored, $dir, $full_filename, $after)
+			 = /^(([^%]|[^\\]%)*)\\(?:sub)?import[{\s]+(.*?)[\s}][{\s]+(.*?)[\s}](.*)$/) {
+                        if ($explain) {
+                              print "% dir " . $dir ."\n";
+                              print "% full_filename " . $full_filename ."\n";
+                              print "% after " . $after ."\n";
+                              print "% inside_import $inside_import\n";
+                        }
+                        $full_filename = $dir . $full_filename;
+                        if ($inside_import) {
+                              $full_filename = $inside_import . $full_filename;
+                        }
+                        print "% cat(inside_import,dir,full_filename) " . $full_filename ."\n" if ($explain);
+			$full_filename = find_tex_file($full_filename, ":.tex");
+			if ($full_filename) {
+				say $prefix . "Found input for file: $full_filename\n";
+				print $before . $nl;
+				print "% start input $full_filename\n" if ($explain);
+                                my $previous_import_dir = $inside_import;
+                                $inside_import = $inside_import . $dir;
+				my $in_comment = process_file($full_filename, $prefix . "  ");
+                                $inside_import = $previous_import_dir;
+				if ($explain) {
+				    print " % end input $full_filename\n";
+				} elsif ($in_comment) {
+				    print "\n";
+				}
+				if ($after =~ /[^\s]/) {
+				    # LaTeX produces this space, so let's do it also
+				    print " " . $nl . $after . "\n";
+				} else {
+				    print " ";
+				}
+				$_ = "";
+			}
+		} elsif (my ($before, $ignored, $args, $full_filename, $after)
+			 = /^(([^%]|[^\\]%)*)\\includegraphics[\[\s]+(.*?)[\s\]][{\s]+(.*?)[\s}](.*)$/) {
+                        if ($explain) {
+                                print "% inside_import " . $inside_import ."\n";
+                                print "% before " . $before ."\n";
+                                print "% ignored " . $ignored ."\n";
+                                print "% args " . $args ."\n";
+                                print "% full_filename " . $full_filename ."\n";
+                                print "% after " . $after ."\n";
+                        }
+                        if ($inside_import) {
+                                $full_filename = $inside_import . $full_filename;
+                                print "$before\\includegraphics[$args]{$full_filename}$after\n";
+                                $_ = "";
+                        }
+		} elsif (my ($before, $ignored, $args, $full_filename, $after)
+			 = /^(([^%]|[^\\]%)*)\\lstinputlisting[\[\s]+(.*?)[\s\]][{\s]+(.*?)[\s}](.*)$/) {
+                        if ($explain) {
+                                print "% inside_import " . $inside_import ."\n";
+                                print "% before " . $before ."\n";
+                                print "% ignored " . $ignored ."\n";
+                                print "% args " . $args ."\n";
+                                print "% full_filename " . $full_filename ."\n";
+                                print "% after " . $after ."\n";
+                        }
+                        if ($inside_import) {
+                                $full_filename = $inside_import . $full_filename;
+                                print "$before\\lstinputlisting[$args]{$full_filename}$after\n";
+                                $_ = "";
+                        }
 		}
 	}
 	if ($expand_usepackage) {
@@ -219,6 +330,9 @@
 				say $prefix . "Found package file: $full\n";
 				process_file($full, $prefix . "  ");
 				$_ = "";
+				# Forget about any commented newline
+				# before the \usepackage:
+				$$commented_newline = 0;
 			} else {
 				say $prefix . "Not including external package $package_name\n";
 			}
@@ -226,7 +340,7 @@
 	}
 	if ($expand_bbl) {
 		if (my ($before, $bib_name, $after)
-			 = /^(.*)\\bibliography\{([^\}]*)\}(.*)$/) {
+			 = /^(.*)\\(?:bibliography|bibselect)\{([^\}]*)\}(.*)$/) {
 			# The BBL file is not necessarily $bib_name.
 			# Take it from the command-line.
 			print $before . $nl;
@@ -238,7 +352,11 @@
 	}
 	if ($show_graphics) {
 		if (/\\includegraphics(\[[^\]]*\])?{([^}]*)}/) {
-			my $full = find_tex_file($2, $graphics_extensions);
+                        my $full_filename = $2;
+                        if ($inside_import) {
+                                $full_filename = $inside_import . $full_filename;
+                        }
+			my $full = find_tex_file($full_filename, $graphics_extensions);
 			say $prefix . "needs graphics file: ";
 			print STDERR "$full\n";
 		}
@@ -258,7 +376,7 @@
 	my $file = shift;
 	my $extensions = (shift || ":");
 	foreach my $ext (split(':', $extensions, -1)) {
-		my $full = find_file($file . $ext, $TEXINPUTS);
+		my $full = find_file_global($file . $ext);
 		if ($full) {
 			return $full;
 		}
@@ -271,6 +389,20 @@
 	}
 }
 
+sub find_file_global
+{
+	my $file = shift;
+	if (open(my $fh, "-|", "kpsewhich", $file)) {
+		my $full = <$fh>;
+		chomp($full);
+		close($fh);
+		if ($full) {
+			return $full;
+		}
+	}
+	return find_file($file, $TEXINPUTS);
+}
+
 sub find_file
 {
 	my ($file, $path) = @_;
@@ -356,9 +488,6 @@
 
   https://gitlab.com/latexpand/latexpand/issues
 
-Alternatively, you may email directly the author: Matthieu Moy
-<Matthieu.Moy at imag.fr>.
-
 =head2 Known bugs
 
 =head3 Verbatim
@@ -419,4 +548,4 @@
 
 =head1 VERSION
 
-This is latexpand version v1.3.
+This is latexpand version v1.4-1-gb32a776.

Modified: trunk/Master/texmf-dist/doc/support/latexpand/LICENCE
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexpand/LICENCE	2018-05-01 17:35:15 UTC (rev 47534)
+++ trunk/Master/texmf-dist/doc/support/latexpand/LICENCE	2018-05-01 17:35:37 UTC (rev 47535)
@@ -1,5 +1,5 @@
 Copyright (c) 2012, 2013, 2014, 2015, 2016,
-              Matthieu Moy <Matthieu.Moy at grenoble-inp.fr>
+              Matthieu Moy <git at matthieu-moy.fr>
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without

Modified: trunk/Master/texmf-dist/doc/support/latexpand/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexpand/README	2018-05-01 17:35:15 UTC (rev 47534)
+++ trunk/Master/texmf-dist/doc/support/latexpand/README	2018-05-01 17:35:37 UTC (rev 47535)
@@ -57,9 +57,6 @@
 
       https://gitlab.com/latexpand/latexpand/issues
 
-    Alternatively, you may email directly the author: Matthieu Moy
-    <Matthieu.Moy at imag.fr>.
-
   Known bugs
    Verbatim
     latexpand currently ignores \begin{verbatim} ... \end{verbatim}, and
@@ -114,5 +111,5 @@
     https://lacl.fr/~caubert/notes/portabilite-du-tex.html#dependances
 
 VERSION
-    This is latexpand version v1.3.
+    This is latexpand version v1.4-1-gb32a776.
 

Modified: trunk/Master/texmf-dist/doc/support/latexpand/version.txt
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexpand/version.txt	2018-05-01 17:35:15 UTC (rev 47534)
+++ trunk/Master/texmf-dist/doc/support/latexpand/version.txt	2018-05-01 17:35:37 UTC (rev 47535)
@@ -1,2 +1,2 @@
-latexpand version v1.3 (4a4dec71711857554c0b6f5531a5147a47ff2cae).
-Committed on Sat Aug 13 19:51:30 2016 +0200.
+latexpand version v1.4-1-gb32a776 (b32a776232b22f2ece1ca41628273e16022129d9).
+Committed on Wed Apr 18 15:44:06 2018 +0200.

Modified: trunk/Master/texmf-dist/scripts/latexpand/latexpand
===================================================================
--- trunk/Master/texmf-dist/scripts/latexpand/latexpand	2018-05-01 17:35:15 UTC (rev 47534)
+++ trunk/Master/texmf-dist/scripts/latexpand/latexpand	2018-05-01 17:35:37 UTC (rev 47535)
@@ -1,13 +1,13 @@
 #!/usr/bin/perl
 # Inspired by latexpand by D. Musliner, University of Michigan
-# 2012, 2013, 2014, 2015, 2016: Matthieu Moy <Matthieu.Moy at imag.fr>
+# 2012, 2013, 2014, 2015, 2016, 2017: Matthieu Moy <git at matthieu-moy.fr>
 # BSD License
 
 use strict;
 use Cwd;
 use Getopt::Long;
-use Pod::Usage;
 use IO::Handle;
+use File::Spec;
 
 my $TEXINPUTS = $ENV{'TEXINPUTS'};
 if (!$TEXINPUTS) { $TEXINPUTS = getcwd(); }
@@ -27,6 +27,7 @@
 my $fatal;
 my $version;
 my $makeatletter;
+my $inside_import;
 
 GetOptions (
 	'h' => \$help,
@@ -44,16 +45,38 @@
 	'fatal' => \$fatal,
 	'version' => \$version,
         'makeatletter' => \$makeatletter,
-) or pod2usage(2);
+) or pod2usage_wrapper(2);
 version() if $version;
-pod2usage(1) if $help;
-pod2usage(-exitstatus => 0, -verbose => 2) if $long_help;
+pod2usage_wrapper(0) if $help;
+pod2usage_wrapper(-exitstatus => 0, -output => \*STDOUT, -verbose => 2) if $long_help;
 
+sub pod2usage_wrapper
+{
+	# Like pod2usage, but fall back to a simpler implem in case
+	# pod2usage can't be found.
+	if  (eval {require Pod::Usage;1;} ne 1) {
+		print "Please install perldoc and Pod::Usage to get proper help.\n";
+		my $started = 0;
+		open (my $in, '<', "$0") or die $!;
+		while (<$in>) {
+			if ($started) {
+				print;
+			}
+			if (/^__END__$/) {
+				$started = 1;
+			}
+		}
+	} else {
+		Pod::Usage->import();
+		pod2usage(@_);
+	}
+}
+
 sub get_version
 {
 	# $VERSION's value will be substituted by 'make dist', but the
 	# next line won't (the string has to be broken to avoid it).
-	my $VERSION = 'v1.3';
+	my $VERSION = 'v1.4-1-gb32a776';
 	if ($VERSION eq '@LATEXPAND' . '_VERSION@') {
 		my($vol,$dir,$file) = File::Spec->splitpath($0);
 		chdir($dir);
@@ -97,6 +120,7 @@
 	say "processing $file\n";
 	$makeatletter_found = 0;
 	$in_preamble = 1;
+        $inside_import = "";
 	process_file($file, "  ");
 }
 
@@ -106,14 +130,15 @@
 	my $prefix = (shift || "");
 	my $in_comment = 0;
 	open(my $FILE, "<", $file) or die "could not open input file '$file'\n";
+	my $commented_newline = 0;
 	while (my $line = <$FILE>) {
 		if ($line =~ /^[ \t]*\\endinput/) {
 			$line =~ s/(\\endinput.*)\n/% $1/;
 			$in_comment = 1;
-			process_line($line, $prefix);
+			process_line($line, $prefix, \$commented_newline);
 			last;
 		}
-		process_line($line, $prefix, $file);
+		process_line($line, $prefix, \$commented_newline, $file);
 		if ($line =~ /^%.*[^\n]\z/ || $line =~ /[^\\]%.*[^\n]\z/) {
 			# file ends with a comment not ending with a newline
 			print "\n";
@@ -132,8 +157,22 @@
 
 sub process_line
 {
-	my ($line, $prefix, $file) = @_;
+	my ($line, $prefix, $commented_newline, $file) = @_;
 	$_ = $line;
+	if ($$commented_newline && /^\s*$/) {
+		# Deal with:
+		#
+		# Line 1 % comment
+		#
+		# Line 2
+		#
+		# The newline after Line 1 is commented, but we still
+		# want a new paragraph. We strip the comment together
+		# with its newline, but re-add a newline to chnge
+		# paragraph here if needed:
+		print "\n";
+	}
+	$$commented_newline = 0;
 	# Consider \makeatletter only in preamble, because we do want
 	# to warn on \someCommand{\makeatletter\command at with@arobase}.
 	if ($in_preamble && /^[^%]*\\makeatletter/) {
@@ -154,10 +193,14 @@
 			# comments at end of files
 
 			# remove comments + whitespace-only lines completely
-			s/^\s*%.*\n//;
+			if (s/^\s*%.*\n//) {
+				$$commented_newline = 1;
+			}
 
 			# remove only the comment if the line has actual content
-			s/([^\\])%.*\n/$1\n/;
+			if (s/([^\\])%.*\n/$1/) {
+				$$commented_newline = 1;
+			}
 		}
 		# Apply the "empty comments" treatment unconditionally
 		# for end-of-files comments not matched above (it
@@ -189,6 +232,9 @@
 			}
 		} elsif (my ($before, $ignored, $full_filename, $after)
 			 = /^(([^%]|[^\\]%)*)\\input[{\s]+(.*?)[\s}](.*)$/) {
+                        if ($inside_import) {
+                              $full_filename = $inside_import . $full_filename;
+                        }
 			$full_filename = find_tex_file($full_filename, ":.tex");
 			if ($full_filename) {
 				say $prefix . "Found input for file: $full_filename\n";
@@ -208,6 +254,71 @@
 				}
 				$_ = "";
 			}
+		} elsif (my ($before, $ignored, $dir, $full_filename, $after)
+			 = /^(([^%]|[^\\]%)*)\\(?:sub)?import[{\s]+(.*?)[\s}][{\s]+(.*?)[\s}](.*)$/) {
+                        if ($explain) {
+                              print "% dir " . $dir ."\n";
+                              print "% full_filename " . $full_filename ."\n";
+                              print "% after " . $after ."\n";
+                              print "% inside_import $inside_import\n";
+                        }
+                        $full_filename = $dir . $full_filename;
+                        if ($inside_import) {
+                              $full_filename = $inside_import . $full_filename;
+                        }
+                        print "% cat(inside_import,dir,full_filename) " . $full_filename ."\n" if ($explain);
+			$full_filename = find_tex_file($full_filename, ":.tex");
+			if ($full_filename) {
+				say $prefix . "Found input for file: $full_filename\n";
+				print $before . $nl;
+				print "% start input $full_filename\n" if ($explain);
+                                my $previous_import_dir = $inside_import;
+                                $inside_import = $inside_import . $dir;
+				my $in_comment = process_file($full_filename, $prefix . "  ");
+                                $inside_import = $previous_import_dir;
+				if ($explain) {
+				    print " % end input $full_filename\n";
+				} elsif ($in_comment) {
+				    print "\n";
+				}
+				if ($after =~ /[^\s]/) {
+				    # LaTeX produces this space, so let's do it also
+				    print " " . $nl . $after . "\n";
+				} else {
+				    print " ";
+				}
+				$_ = "";
+			}
+		} elsif (my ($before, $ignored, $args, $full_filename, $after)
+			 = /^(([^%]|[^\\]%)*)\\includegraphics[\[\s]+(.*?)[\s\]][{\s]+(.*?)[\s}](.*)$/) {
+                        if ($explain) {
+                                print "% inside_import " . $inside_import ."\n";
+                                print "% before " . $before ."\n";
+                                print "% ignored " . $ignored ."\n";
+                                print "% args " . $args ."\n";
+                                print "% full_filename " . $full_filename ."\n";
+                                print "% after " . $after ."\n";
+                        }
+                        if ($inside_import) {
+                                $full_filename = $inside_import . $full_filename;
+                                print "$before\\includegraphics[$args]{$full_filename}$after\n";
+                                $_ = "";
+                        }
+		} elsif (my ($before, $ignored, $args, $full_filename, $after)
+			 = /^(([^%]|[^\\]%)*)\\lstinputlisting[\[\s]+(.*?)[\s\]][{\s]+(.*?)[\s}](.*)$/) {
+                        if ($explain) {
+                                print "% inside_import " . $inside_import ."\n";
+                                print "% before " . $before ."\n";
+                                print "% ignored " . $ignored ."\n";
+                                print "% args " . $args ."\n";
+                                print "% full_filename " . $full_filename ."\n";
+                                print "% after " . $after ."\n";
+                        }
+                        if ($inside_import) {
+                                $full_filename = $inside_import . $full_filename;
+                                print "$before\\lstinputlisting[$args]{$full_filename}$after\n";
+                                $_ = "";
+                        }
 		}
 	}
 	if ($expand_usepackage) {
@@ -219,6 +330,9 @@
 				say $prefix . "Found package file: $full\n";
 				process_file($full, $prefix . "  ");
 				$_ = "";
+				# Forget about any commented newline
+				# before the \usepackage:
+				$$commented_newline = 0;
 			} else {
 				say $prefix . "Not including external package $package_name\n";
 			}
@@ -226,7 +340,7 @@
 	}
 	if ($expand_bbl) {
 		if (my ($before, $bib_name, $after)
-			 = /^(.*)\\bibliography\{([^\}]*)\}(.*)$/) {
+			 = /^(.*)\\(?:bibliography|bibselect)\{([^\}]*)\}(.*)$/) {
 			# The BBL file is not necessarily $bib_name.
 			# Take it from the command-line.
 			print $before . $nl;
@@ -238,7 +352,11 @@
 	}
 	if ($show_graphics) {
 		if (/\\includegraphics(\[[^\]]*\])?{([^}]*)}/) {
-			my $full = find_tex_file($2, $graphics_extensions);
+                        my $full_filename = $2;
+                        if ($inside_import) {
+                                $full_filename = $inside_import . $full_filename;
+                        }
+			my $full = find_tex_file($full_filename, $graphics_extensions);
 			say $prefix . "needs graphics file: ";
 			print STDERR "$full\n";
 		}
@@ -258,7 +376,7 @@
 	my $file = shift;
 	my $extensions = (shift || ":");
 	foreach my $ext (split(':', $extensions, -1)) {
-		my $full = find_file($file . $ext, $TEXINPUTS);
+		my $full = find_file_global($file . $ext);
 		if ($full) {
 			return $full;
 		}
@@ -271,6 +389,20 @@
 	}
 }
 
+sub find_file_global
+{
+	my $file = shift;
+	if (open(my $fh, "-|", "kpsewhich", $file)) {
+		my $full = <$fh>;
+		chomp($full);
+		close($fh);
+		if ($full) {
+			return $full;
+		}
+	}
+	return find_file($file, $TEXINPUTS);
+}
+
 sub find_file
 {
 	my ($file, $path) = @_;
@@ -356,9 +488,6 @@
 
   https://gitlab.com/latexpand/latexpand/issues
 
-Alternatively, you may email directly the author: Matthieu Moy
-<Matthieu.Moy at imag.fr>.
-
 =head2 Known bugs
 
 =head3 Verbatim
@@ -419,4 +548,4 @@
 
 =head1 VERSION
 
-This is latexpand version v1.3.
+This is latexpand version v1.4-1-gb32a776.



More information about the tex-live-commits mailing list