diff options
author | Norbert Preining <preining@logic.at> | 2016-04-10 01:00:21 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2016-04-10 01:00:21 +0000 |
commit | f5dba868509ddefa62cf86140c3ac80141aa11fe (patch) | |
tree | b5ea523583dc2cf85926ec7c578a9295864c43f6 /Master | |
parent | b035d1d5ec1ffb1c431719cb5c12d59cf758e0ba (diff) |
fix TLPaper for 2016 pdftexconfig.dat
git-svn-id: svn://tug.org/texlive/trunk@40377 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPaper.pm | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/Master/tlpkg/TeXLive/TLPaper.pm b/Master/tlpkg/TeXLive/TLPaper.pm index 56a359fa75d..0b81e4e2f4b 100644 --- a/Master/tlpkg/TeXLive/TLPaper.pm +++ b/Master/tlpkg/TeXLive/TLPaper.pm @@ -62,7 +62,7 @@ our %paper = ( "pdftex" => { sub => \&paper_pdftex, default_component => "tex/generic/config", - default_file => "pdftexconfig.tex", + default_file => "pdftexconfig.dat", pkg => "pdftex", }, "dvips" => { @@ -295,13 +295,11 @@ sub paper_xdvi { } -# pdftex pdftexconfig.tex format +# pdftex pdftexconfig.dat format # /--- pdftexconfig.tex --- # |... -# |\ifx\pdfpagewidth\undefined\else \pdfpagewidth=210 true mm \fi -# |\ifx\pagewidth\undefined\else \pagewidth=210 true mm \fi -# |\ifx\pdfpageheight\undefined\else \pdfpageheight=297 true mm \fi -# |\ifx\pageheight\undefined\else \pageheight=297 true mm \fi +# |pageheight = 297 true mm +# |pagewidth = 210 true mm # |... # \------------------------ # @@ -329,21 +327,21 @@ sub paper_pdftex { # read the lines and the last pdfpageswidth/height wins for my $idx (0..$#lines) { my $l = $lines[$idx]; - if ($l =~ m/\\(pdf|luatex|)pagewidth\s*=?\s*([0-9.,]+\s*true\s*[^\s]*)/) { - if (defined($cpw) && $cpw ne $2) { + if ($l =~ m/^\s*pagewidth\s*=\s*([0-9.,]+\s*true\s*[^\s]*)/) { + if (defined($cpw) && $cpw ne $1) { tl_warn("TLPaper: inconsistent paper sizes in $inp for page width! Please fix that.\n"); return $F_ERROR; } - $cpw = $2; + $cpw = $1; push @cpwidx, $idx; next; } - if ($l =~ m/\\(pdf|luatex|)pageheight\s*=?\s*([0-9.,]+\s*true\s*[^\s]*)/) { - if (defined($cph) && $cph ne $2) { + if ($l =~ m/^\s*pageheight\s*=\s*([0-9.,]+\s*true\s*[^\s]*)/) { + if (defined($cph) && $cph ne $1) { tl_warn("TLPaper: inconsistent paper sizes in $inp for page height! Please fix that.\n"); return $F_ERROR; } - $cph = $2; + $cph = $1; push @cphidx, $idx; next; } @@ -395,13 +393,11 @@ sub paper_pdftex { for my $idx (@cpwidx) { ddebug("TLPaper: before line: $lines[$idx]"); ddebug("TLPaper: replacement: $newwidth\n"); - $lines[$idx] =~ s/pagewidth\s*=\s*[0-9.,]+\s*true\s*[^\s]*/pagewidth=$newwidth/; + $lines[$idx] =~ s/^\s*pagewidth\s*=\s*[0-9.,]+\s*true\s*[^\s]*/pagewidth = $newwidth/; ddebug("TLPaper: after line : $lines[$idx]"); } } else { - my $addlines = '\ifx\pdfpagewidth\undefined\else \pdfpagewidth=' . $newwidth . ' \fi' . "\n"; - $addlines .= '\ifx\luatexpagewidth\undefined\else \luatexpagewidth=' . $newwidth . ' \fi' . "\n"; - $addlines .= '\ifx\pagewidth\undefined\else \pagewidth=' . $newwidth . ' \fi' . "\n"; + my $addlines = "pagewidth = $newwidth\n"; if (defined($endinputidx)) { $lines[$endinputidx] = $addlines . $lines[$endinputidx]; } else { @@ -412,13 +408,11 @@ sub paper_pdftex { for my $idx (@cphidx) { ddebug("TLPaper: before line: $lines[$idx]"); ddebug("TLPaper: replacement: $newheight\n"); - $lines[$idx] =~ s/pageheight\s*=\s*[0-9.,]+\s*true\s*[^\s]*/pageheight=$newheight/; + $lines[$idx] =~ s/pageheight\s*=\s*[0-9.,]+\s*true\s*[^\s]*/pageheight = $newheight/; ddebug("TLPaper: after line : $lines[$idx]"); } } else { - my $addlines = '\ifx\pdfpageheight\undefined\else \pdfpageheight=' . $newheight . ' \fi' . "\n"; - $addlines .= '\ifx\luatexpageheight\undefined\else \luatexpageheight=' . $newheight . ' \fi' . "\n"; - $addlines .= '\ifx\pageheight\undefined\else \pageheight=' . $newheight . ' \fi' . "\n"; + my $addlines = "pageheight = $newheight"; if (defined($endinputidx)) { $lines[$endinputidx] = $addlines . $lines[$endinputidx]; } else { |