Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for latexpand for compatibility with new perl version : #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bin/latexpand
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ sub process_file

sub process_line
{
my ($_, $prefix) = @_;
my ($filename, $prefix) = @_;
$_ = $filename;
unless ($keep_comments) {
if ($empty_comments) {
s/^%.*$/%/;
Expand Down Expand Up @@ -127,7 +128,7 @@ sub process_line
if ($expand_usepackage) {
# Don't bother with before and after text, we just require the
# usepackage to be alone on its line.
if (my ($package_name) = /^\s*\\usepackage{([^}]*)}\s*$/) {
if (my ($package_name) = /^\s*\\usepackage[{]([^}]*)[}]\s*$/) {
my $full = find_file($package_name . ".sty", $TEXINPUTS);
if ($full) {
say $prefix . "Found package file: $full\n";
Expand All @@ -140,7 +141,7 @@ sub process_line
}
if ($expand_bbl) {
if (my ($before, $bib_name, $after)
= /^(.*)\\bibliography{([^}]*)}(.*)$/) {
= /^(.*)\\bibliography[{]([^}]*)[}](.*)$/) {
# The BBL file is not necessarily $bib_name.
# Take it from the command-line.
print $before . $nl;
Expand All @@ -151,7 +152,7 @@ sub process_line
}
}
if ($show_graphics) {
if (/\\includegraphics{([^}]*)}/) {
if (/\\includegraphics[{]([^}]*)[}]/) {
my $full = find_tex_file($1, $graphics_extensions);
say $prefix . "needs graphics file: ";
print STDERR "$full\n";
Expand Down