texlive[57166] trunk: pdfxup (18dec20)
commits+karl at tug.org
commits+karl at tug.org
Fri Dec 18 23:11:58 CET 2020
Revision: 57166
http://tug.org/svn/texlive?view=revision&revision=57166
Author: karl
Date: 2020-12-18 23:11:58 +0100 (Fri, 18 Dec 2020)
Log Message:
-----------
pdfxup (18dec20)
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/pdfxup/pdfxup
trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
trunk/Master/texmf-dist/doc/man/man1/pdfxup.1
trunk/Master/texmf-dist/doc/man/man1/pdfxup.man1.pdf
trunk/Master/texmf-dist/doc/support/pdfxup/README
trunk/Master/texmf-dist/doc/support/pdfxup/RELEASES
trunk/Master/texmf-dist/doc/support/pdfxup/pdfxup.pdf
trunk/Master/texmf-dist/scripts/pdfxup/pdfxup
trunk/Master/tlpkg/libexec/ctan2tds
Added Paths:
-----------
trunk/Master/texmf-dist/tex/latex/pdfxup/
trunk/Master/texmf-dist/tex/latex/pdfxup/beamer2.xup
trunk/Master/texmf-dist/tex/latex/pdfxup/beamer4.xup
trunk/Master/texmf-dist/tex/latex/pdfxup/pdfxup-template.tex
Modified: trunk/Build/source/texk/texlive/linked_scripts/pdfxup/pdfxup
===================================================================
(Binary files differ)
Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl 2020-12-18 02:39:22 UTC (rev 57165)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl 2020-12-18 22:11:58 UTC (rev 57166)
@@ -1,12 +1,12 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 57093 2020-12-08 14:41:33Z preining $
+# $Id: tlmgr.pl 57119 2020-12-12 23:40:00Z karl $
#
# Copyright 2008-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
-my $svnrev = '$Revision: 57093 $';
-my $datrev = '$Date: 2020-12-08 15:41:33 +0100 (Tue, 08 Dec 2020) $';
+my $svnrev = '$Revision: 57119 $';
+my $datrev = '$Date: 2020-12-13 00:40:00 +0100 (Sun, 13 Dec 2020) $';
my $tlmgrrevision;
my $tlmgrversion;
my $prg;
@@ -9297,12 +9297,12 @@
(e.g., if the selected mirror is out of date), C<tlmgr> does not
downgrade. Also, packages for uninstalled platforms are not installed.
-C<tlmgr> saves a copy of the C<texlive.tlpdb> file used for an update
-with a suffix representing the repository url, as in
-C<tlpkg/texlive.tlpdb.>I<long-hash-string>. These can be useful for
-fallback information, but if you don't like them accumulating (e.g.,
-C<mirror.ctan.org> resolves to many different hosts, each resulting in
-a possibly different hash), it's harmless to delete them.
+C<tlmgr> saves one copy of the main C<texlive.tlpdb> file used for an
+update with a suffix representing the repository url, as in
+C<tlpkg/texlive.tlpdb.main.>I<long-hash-string>. Thus, even when many
+mirrors are used, only one main C<tlpdb> backup is kept. For non-main
+repositories, which do not generally have (m)any mirrors, no pruning of
+backups is done.
This action does not automatically add or remove new symlinks in system
directories; you need to run C<tlmgr> L</path> yourself if you are using
@@ -10113,7 +10113,7 @@
distribution (L<https://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
-$Id: tlmgr.pl 57093 2020-12-08 14:41:33Z preining $
+$Id: tlmgr.pl 57119 2020-12-12 23:40:00Z karl $
=cut
# test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html
Modified: trunk/Master/texmf-dist/doc/man/man1/pdfxup.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/pdfxup.1 2020-12-18 02:39:22 UTC (rev 57165)
+++ trunk/Master/texmf-dist/doc/man/man1/pdfxup.1 2020-12-18 22:11:58 UTC (rev 57166)
@@ -1,6 +1,6 @@
.\" Manpage for pdfxup.
.\" Contact pdfxup at markey.fr to correct errors or typos.
-.TH man 1 "21 october 2020" "1.61" "pdfxup man page"
+.TH man 1 "17 december 2020" "2.00" "pdfxup man page"
.SH NAME
pdfxup \- n-up tool with reduced margins
.SH SYNOPSIS
@@ -22,15 +22,27 @@
pdfxup accepts numerous options. The most important ones are:
.\" additional options should be lister here...
.TP
-\fB\-x\fR n, \fB\-\-columns\fR n
-sets the number of columns in the output file (default 2);
+\fB\-x\fR m, \fB\-\-columns\fR m
+sets the number of columns of the output file (default 2);
.TP
\fB\-y\fR n, \fB\-\-rows\fR n
-sets the number of lines in the output file (default 1);
+sets the number of lines of the output file (default 1);
.TP
-\fB\-l\fR, \fB\-\-landscape\fR
-sets orientation of paper (of final document) landscape;
+\fB\-nup\fR m\fBx\fRn, \fB\--nup\fR m\fBx\fRn
+sets the number of rows and columns of the output file (default 2x1);
.TP
+\fB\-l\fR (0|1), \fB\-\-landscape\fR, \fB\-\-portrait\fR
+sets orientation of paper (of final document);
+.TP
+\fB\-cf\fR file, \fB\-\-config \fR file, \fB\-\-mode \fR file
+reads file (with extension \fB.xup\fR) and uses options defined in that
+file (see below for details about \fB.xup\fR files).
+All options are processed in the order the appear on the command-line,
+so that it is possible to modify the options set in the configuration
+file (and it is even possible to include several configuration files, the
+later one overwriting the options set by the previous ones).
+Files are looked-up using kpsewhich (if available).
+.TP
\fB\-b\fR (le|se), \fB\-\-booklet\fR (le|se)
configure for printing as a booklet. Value 'le' (which is the default
value when \fB\-b\fR is used with no argument) means that two-sided
@@ -37,29 +49,42 @@
printing is in 'long-edge' mode (you turn from one page to the next
along the long edge of the paper). 'se' is the 'short-edge' option.
.TP
-\fB\-c\fR, \fB\-\-clip\fR
-clip pages to the computed bounding box. By default, content is not
-clipped, which may result in overlap of neighbouring pages. With this
-option, anything outside the bounding box will not be displayed.
+\fB\-c\fR, \fB\-\-clip\fR, \fB\-nc\fR, \fB\-\-no-clip\fR
+clip (or don't clip) pages to the computed bounding box. By default,
+content is clipped, to avoid overlap between neighbouring pages.
+With \fB--no-clip\fR, anything outside the bounding box will be
+displayed.
.TP
\fB\-o\fR file, \fB\-\-output\fR file
-name of output file;
+name of output file.
.TP
\fB\-i\fR
-ask before overwriting output file;
+ask before overwriting output file.
.TP
+\fB\-ow\fR
+overwrite output file without asking.
+.TP
+\fB\-ps\fR s, \fB\-\-paper\fR s
+sets paper size (default a4). The name must be known by package geometry
+(more precisely, "<s>paper" should be defined in that package).
+.TP
\fB\-fw\fR d, \fB\-\-framewidth\fR d
width of the frame around each page (default 0.4pt). Set to 0pt to have no
-frame at all;
+frame at all.
.TP
+\fB\-tf\fR [0|1], \fB\-\-tight-frame\fR [0|1]
+whether the frame should be tight around the page, leaving horizontal
+white space outside the frame, or should be wide and span the whole
+available width.
+.TP
\fB\-im\fR d, \fB\-\-innermargins\fR d
-inner margin between frame and page (default 5pt);
+inner margin between frame and page (default 5pt).
.TP
\fB\-m\fR d, \fB\-\-margins\fR d
-margin of pages of the new document (default 5pt);
+margin of pages of the new document (default 5pt).
.TP
\fB\-is\fR d, \fB\-\-intspaces\fR d
-space between different pages (default 1pt);
+space between different pages (default 1pt).
.TP
\fB\-p\fR list, \fB\-\-pages\fR list
only consider sublist of pages of input document. List is a
@@ -70,55 +95,108 @@
include only even-numbered pages.
.TP
\fB\-bb\fR list, \fB\-\-bb\fR list
-only consider sublist of pages of input document for computing bounding box;
+only consider sublist of pages of input document for computing bounding box.
.TP
\fB\-nobb\fR list, \fB\-\-no-bb\fR list
-omit list of pages of input document from computation of bounding box;
+omit list of pages of input document from computation of bounding box.
.TP
\fB\-g\fR, \fB\-\-get-bb\fR
-only compute (and output) bounding box;
+only compute (and output) bounding box. Will not produce any output file.
.TP
+\fB\-kbb\fR, \fB\-\-keep-bb\fR
+do not compute bounding box, preserve current margins.
+.TP
\fB\-s\fR x y W H, \fB\-\-set-bb\fR x y W H
-set the bounding box to the given values;
+set the bounding box to the given values. Values are in pt; the first two
+elements correspond to the lower left corner, while the last two represent
+the width and height of the part to be displayed.
.TP
\fB\-w\fR file, \fB\-\-watermark\fR file
use file as background watermark. file can be any format accepted by
pdflatex (e.g. png or pdf). If file is a multipage PDF file, page n of
the watermark file is used with page n of the input file, and the last
-page of the watermark file is repeated if the input file has more pages;
+page of the watermark file is repeated if the input file has more pages.
.TP
\fB\-wp\fR p, \fB\-\-watermark-period\fR p
-repeat the last p pages of the watermark file instead of only the last one;
+repeat the last p pages of the watermark file instead of only the last one.
.TP
\fB\-d\fR, \fB\-\-debug\fR
-debug mode: keep intermediary files;
+debug mode: keep intermediary files.
.TP
\fB\-V [0-3]\fR, \fB\-\-verbose\fR [0-3]
-select verbosity (default: 1);
+select verbosity (default: 1).
.TP
\fB\-q\fR, \fB\-\-quiet\fR
-run quietly (equiv. '-V=0');
+run quietly (equiv. '-V 0').
.TP
\fB\-v\fR, \fB\-\-version\fR
-print version number and exit;
+print version number and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
print help message and exit.
+.SH CONFIGURATION FILES
+Configuration files (extension \fB.xup\fR) are bash scripts used
+to set some variables. If option "\fB--config-file\fR <file>"
+(or equivalent) is used, <file> is looked up with kpsewhich
+first, if it contains no '/'. If kpsewhich does not find it,
+then pdfxup checks if the file exists (using 'test -e') before
+sourcing it (the \fBPATH\fR variable will not be used to find
+it).
+
+The script should only set some internal variables of pdfxup, such as
+\fBNB_ROWS\fR, \fBNB_COLUMNS\fR, \fBLANDSCAPE\fR (to set up a
+predefined layout). It can be used to set the bounding box, but it is
+often better to compute it on the first few pages of the document.
+Here are some examples of lines that can be put in a \fB.xup\fR file:
+.TP
+\fBNB_COLUMNS=1\fR
+set the number of columns to 1
+.TP
+\fBNB_ROWS=2\fR
+set the number of rows to 2
+.TP
+\fBLANDSCAPE=0\fR
+set portrait mode
+.TP
+\fBKEEP_ORIG_BBOX=1\fR
+do not crop margins
+.TP
+\fBSET_BBOX="75 47 540 755"
+set bounding box: lower left=(75,47); upper right=(540,755)
+.TP
+\fBTIGHT_FRAME=1\fR
+set tight frames around pages
+.TP
+\fBINNER_MARGINS=10pt\fR
+set margin around each page (inside the frame) to 10pt
+.TP
+\fBINTERM_SPACES=10pt\fR
+set space between pages to 10pt
+.TP
+\fBFRAME_WIDTH=2mm\fR
+set frame width to 2mm
+
+.PP
+Other available variables can be found in the \fBsetdefaultvalues\fR function.
+
.SH EXAMPLES
.TP
\fB# pdfxup file.pdf\fR
-produces 2-up pdf file from file.pdf
+produces 2-up pdf file from file.pdf.
.TP
\fB# pdfxup -bb 1-4 file.pdf\fR
same behaviour, but computes the bounding box only using the
-first 4 pages (this saves time when processing long documents)
+first 4 pages (this saves time when processing long documents).
.TP
\fB# pdfxup -b -o booklet.pdf file.pdf\fR
-same behaviour, but creates a booklet (as booklet.pdf)
+same behaviour, but creates a booklet (as booklet.pdf).
.TP
\fB# pdfxup -kbb -x1 -y2 -l0 beamer-frames.pdf\fR
-arranges 2 beamer frames per page (not reducing margins)
+arranges 2 beamer frames per page (not reducing margins).
.TP
+\fB# pdfxup --mode beamer2 beamer-frames.pdf\fR
+arranges PDF pages according to beamer2.xup configuration file.
+.TP
\fB# pdfxup -kbb -x2 -y2 -l beamer-frames.pdf:1-12,15-19\fR
arranges 4 beamer frames per page (not reducing margins), including
only frames 1 to 12 and 15 to 19.
Modified: trunk/Master/texmf-dist/doc/man/man1/pdfxup.man1.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/support/pdfxup/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/pdfxup/README 2020-12-18 02:39:22 UTC (rev 57165)
+++ trunk/Master/texmf-dist/doc/support/pdfxup/README 2020-12-18 22:11:58 UTC (rev 57166)
@@ -1,4 +1,4 @@
-PDFXUP -- v1.61 (2020/10/21)
+PDFXUP -- v2.00 (2020/12/17)
N. Markey <pdfxup at markey.fr>
@@ -18,7 +18,7 @@
-%% (c) 2020/10/21 Nicolas Markey <pdfxup at markey dot fr>
+%% (c) 2020/12/17 Nicolas Markey <pdfxup at markey dot fr>
%%
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
Modified: trunk/Master/texmf-dist/doc/support/pdfxup/RELEASES
===================================================================
--- trunk/Master/texmf-dist/doc/support/pdfxup/RELEASES 2020-12-18 02:39:22 UTC (rev 57165)
+++ trunk/Master/texmf-dist/doc/support/pdfxup/RELEASES 2020-12-18 22:11:58 UTC (rev 57166)
@@ -37,4 +37,17 @@
v1.61 (2020/10/21)
- minor bug corrected (would not clean-up with option -g)
- (thanks to Oliver Redner for pointing out the bug)
\ No newline at end of file
+ (thanks to Oliver Redner for pointing out the bug)
+
+v2.00 (2020/12/17)
+ - fixed a bug with inner margins
+ - fixed problem with ranges exceeding number of pages
+ - extracted LaTeX file from script
+ - added --tight-frame option: tells whether the frame should
+ be tight around the page (and leave horizontal white space
+ outside the frame), or as large as possible.
+ - added --config-file option: configuration files (default
+ extension .xup) can be used to define default values
+ for frequent situations.
+ - cleaned-up man page, adding some missing options (thanks
+ to Louis Gostiaux for pointing undocumented options)
\ No newline at end of file
Modified: trunk/Master/texmf-dist/doc/support/pdfxup/pdfxup.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/scripts/pdfxup/pdfxup
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/tex/latex/pdfxup/beamer2.xup
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfxup/beamer2.xup (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pdfxup/beamer2.xup 2020-12-18 22:11:58 UTC (rev 57166)
@@ -0,0 +1,31 @@
+#
+# pdfxup configuration for beamer slides (2-up, portrait)
+#
+## (c) 2020/12/17 Nicolas Markey <pdfxup at markey dot fr>
+##
+## This work may be distributed and/or modified under the conditions of
+## the LaTeX Project Public License, either version 1.3 of this license
+## or (at your option) any later version. The latest version of this
+## license is in
+##
+## http://www.latex-project.org/lppl.txt
+##
+## and version 1.3 or later is part of all distributions of LaTeX version
+## 2005/12/01 or later.
+##
+## This work has the LPPL maintenance status `maintained'.
+## The Current Maintainer of this work is Nicolas Markey.
+
+
+# number of rows
+NB_COLUMNS=1
+# number of columns
+NB_ROWS=2
+# orientation (1=landscape, 0=portrait)
+LANDSCAPE=0
+# do not crop margins
+KEEP_ORIG_BBOX=1
+# tight frame around each slide
+TIGHT_FRAME=1
+# frame width
+FRAME_WIDTH=.4pt
Added: trunk/Master/texmf-dist/tex/latex/pdfxup/beamer4.xup
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfxup/beamer4.xup (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pdfxup/beamer4.xup 2020-12-18 22:11:58 UTC (rev 57166)
@@ -0,0 +1,31 @@
+#
+# pdfxup configuration for beamer slides (2x2-up, landscape)
+#
+## (c) 2020/12/17 Nicolas Markey <pdfxup at markey dot fr>
+##
+## This work may be distributed and/or modified under the conditions of
+## the LaTeX Project Public License, either version 1.3 of this license
+## or (at your option) any later version. The latest version of this
+## license is in
+##
+## http://www.latex-project.org/lppl.txt
+##
+## and version 1.3 or later is part of all distributions of LaTeX version
+## 2005/12/01 or later.
+##
+## This work has the LPPL maintenance status `maintained'.
+## The Current Maintainer of this work is Nicolas Markey.
+
+
+# number of rows
+NB_COLUMNS=2
+# number of columns
+NB_ROWS=2
+# orientation (1=landscape, 0=portrait)
+LANDSCAPE=1
+# do not crop margins
+KEEP_ORIG_BBOX=1
+# tight frame around each slide
+TIGHT_FRAME=1
+# frame width
+FRAME_WIDTH=.4pt
Added: trunk/Master/texmf-dist/tex/latex/pdfxup/pdfxup-template.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfxup/pdfxup-template.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pdfxup/pdfxup-template.tex 2020-12-18 22:11:58 UTC (rev 57166)
@@ -0,0 +1,278 @@
+\expandafter\ifx\csname pdfxupfile\endcsname\relax
+\PackageError{pdfxup}{This file should not be compiled alone}
+ {File pdfxup-template.pdf is not meant to be compiled alone.
+ \MessageBreak
+ It should only be used via the 'pdfxup' script.}
+\fi
+
+\documentclass{minimal}
+ \usepackage[margin=0pt,\pdfxupoutputpaper paper]{geometry}
+ \ifnum\pdfxupoutputlandscape=1\relax\geometry{landscape}\fi
+ \usepackage{graphicx}
+ \IfFileExists{grffile.sty}{\usepackage{grffile}}{}
+
+ \topskip=0pt
+ \parindent=0pt
+
+ \makeatletter
+
+ %% define functions for parsing comma-separated lists of ranges of pages
+ \newcounter{result}%
+ \newif\iffound
+ \def\@parserange#1-#2-#3\@end#4\@end{%
+ \setcounter{result}{#4}%
+ \ifnum\value{result}=1\relax
+ \foundtrue
+ \setcounter{result}{#1}%
+ \else
+ \addtocounter{result}{-1}%
+ \ifx\relax#3\relax%% means that range contains no -
+ \else
+ \addtocounter{result}{#1}%
+ \ifnum#2<\value{result}\relax
+ \addtocounter{result}{-#2}%
+ \else
+ \foundtrue
+ \fi
+ \fi
+ \fi}
+ \def\parserange#1#2{\expandafter\@parserange#2-SINGLE-\@end#1\@end}
+ \def\@parsecsl#1,#2\@end#3\@end{%
+ \parserange{#3}{#1}%
+ \iffound\else
+ \ifx\relax#2\relax\else\@parsecsl#2\@end\value{result}\@end\fi\fi}
+ %% \nthvalue#1#2 looks for #1-th value in list of intervals #2
+ \def\nthvalue#1#2{\foundfalse\expandafter\@parsecsl#2,\@end#1\@end}
+ %%
+
+
+ %% perform various computations:
+ %% - width and height of image (\hresult and \vresult)
+ %% - width and height of frame containing image (\hboxsize and \vboxsize)
+ \newcounter{lastpage}
+ \newcounter{outpage}
+ \setcounter{outpage}{\pdfxupnbpages}
+ \addtocounter{outpage}{-1}
+ \divide\c at outpage by \pdfxupnbhoriz
+ \divide\c at outpage by \pdfxupnbvert
+ \ifbooklet
+ \divide\c at outpage by 2
+ \fi
+ \stepcounter{outpage}
+ \ifbooklet
+ \multiply\c at outpage by 2
+ \fi
+ \setcounter{lastpage}{\value{outpage}}
+ \multiply\c at lastpage by \pdfxupnbhoriz
+ \multiply\c at lastpage by \pdfxupnbvert
+ \makeatother
+ %
+ \newlength\outputvmargin
+ \newlength\outputhmargin
+ \setlength\outputvmargin{\pdfxupvmargin}
+ \setlength\outputhmargin{\pdfxuphmargin}
+ \newlength\innervmargin
+ \newlength\innerhmargin
+ \setlength\innervmargin{\pdfxupinnervmargin}
+ \setlength\innerhmargin{\pdfxupinnerhmargin}
+ \newlength\outputindivvmargin
+ \newlength\outputindivhmargin
+ \setlength\outputindivvmargin{\pdfxupintermvspace}
+ \setlength\outputindivhmargin{\pdfxupintermhspace}
+ %
+ \fboxsep=0pt%
+ \setlength\fboxrule{\pdfxupframewidth}
+ \newlength\hresult
+ \newlength\vresult
+ \newlength\vboxsize
+ \newlength\hboxsize
+ \hresult=\paperwidth
+ \advance\hresult by -\pdfxupnbhoriz\fboxrule
+ \advance\hresult by -\pdfxupnbhoriz\fboxrule
+ \advance\hresult by -\pdfxupnbhoriz\innerhmargin
+ \advance\hresult by -\pdfxupnbhoriz\innerhmargin
+ \vresult=\paperheight
+ \advance\vresult by -\pdfxupnbvert\fboxrule
+ \advance\vresult by -\pdfxupnbvert\fboxrule
+ \advance\vresult by -\pdfxupnbvert\innerhmargin
+ \advance\vresult by -\pdfxupnbvert\innerhmargin
+ %
+ \advance\hresult by -2\outputhmargin
+ \advance\vresult by -2\outputvmargin
+ %
+ \advance\hresult by -\pdfxupnbhoriz \outputindivhmargin
+ \advance\vresult by -\pdfxupnbvert \outputindivvmargin
+ \advance\hresult by \outputindivhmargin
+ \advance\vresult by \outputindivvmargin
+ %
+ \divide\hresult by \pdfxupnbhoriz
+ \divide\vresult by \pdfxupnbvert
+
+ \vboxsize=\vresult
+ \advance\vboxsize by 2\fboxrule
+ \advance\vboxsize by 2\innervmargin
+ \hboxsize=\hresult
+ \advance\hboxsize by 2\fboxrule
+ \advance\hboxsize by 2\innerhmargin
+
+
+ %% compute actual scale by which PDF is shrunk (or extended)
+ \ifnum\pdfxupemptybb=0\relax
+ \newcounter{origx}
+ \setcounter{origx}{\pdfxupw}
+ \addtocounter{origx}{-\pdfxupx}
+ \newcounter{origy}
+ \setcounter{origy}{\pdfxuph}
+ \addtocounter{origy}{-\pdfxupy}
+ \newlength\finalx
+ \newlength\finaly
+ \finalx=\hresult
+ \finaly=\vresult
+ \divide\finalx by \value{origx}
+ \divide\finaly by \value{origy}
+ \newwrite\scale
+ \immediate\openout\scale=\pdfxupfilename.scl
+ \ifdim\finalx>\finaly
+ \multiply\finaly by 100
+ \immediate\write\scale{\the\finaly}
+ \else
+ \multiply\finalx by 100
+ \immediate\write\scale{\the\finalx}
+ \fi
+ \immediate\closeout\scale
+ \fi
+
+
+ %% start document
+ \begin{document}
+ %\tracingoutput=1
+ %\tracingpages=1
+ %\tracingparagraphs=1
+ \makeatletter
+ \newcounter{curroutpage}
+ \setcounter{curroutpage}{1}
+ \addtocounter{curroutpage}{-1}
+ \newcounter{currpage}
+ \newcounter{currcol}
+ \newcounter{currline}
+ \newcounter{realout}
+ \newcounter{wmout}
+ \newcounter{wmoutaux}
+ \@whilenum \value{outpage}>\value{curroutpage} \do%
+ {\stepcounter{curroutpage}%
+ \setcounter{currpage}{\value{curroutpage}}%
+ \advance\c at currpage by -1%
+ \multiply\c at currpage by \pdfxupnbhoriz%
+ \multiply\c at currpage by \pdfxupnbvert%
+ \hrule \@height\z@%
+ \setcounter{currline}{0}%
+ \vskip \outputvmargin%
+ \@whilenum\value{currline}<\pdfxupnbvert \do%
+ {\hrule \@height\z@\vskip \outputindivvmargin%
+ \ifnum\value{currline}>0\vskip \outputindivvmargin\fi%
+ \global\stepcounter{currline}%
+ \setcounter{currcol}{0}%
+ \hskip \outputhmargin%
+ \@whilenum\value{currcol}<\pdfxupnbhoriz \do%
+ {\ifnum\value{currcol}>0\hskip\outputindivhmargin\fi%
+ \global\stepcounter{currcol}%
+ \global\stepcounter{currpage}%
+ \ifnum\value{currpage}>\value{lastpage}\else
+ %% computing page number corresponding to \currline and \currcol
+ \setcounter{realout}{\value{currpage}}%
+ \def\ang{0}%
+ \ifbooklet
+ \iflongedge
+ %% long edge:
+ %% 1->n, 2->1, 3->n-1 (rotated), 4->2(rotated)...
+ \ifodd\value{realout}% -> 1 or 3
+ \addtocounter{realout}{-1}%
+ \divide\c at realout by 2\relax
+ \ifodd\value{realout}% -> 3
+ \def\ang{180}%
+ \else% -> 1
+ \fi
+ \setcounter{realout}{-\value{realout}}%
+ \addtocounter{realout}{\value{outpage}}%
+ \addtocounter{realout}{\value{outpage}}%
+ \else% -> 2 or 4
+ \divide\c at realout by 2\relax
+ \ifodd\value{realout}% -> 2
+ \else% -> 4
+ \def\ang{180}%
+ \fi
+ \fi
+ \else
+ %% short edge:
+ %% 1->n, 2->1, 3->2, 4->n-1, 5->n-2, 6->3, 7->4, 8->n-3
+ \ifodd\value{realout}% -> 1 or 3
+ \addtocounter{realout}{-1}%
+ \divide\c at realout by 2\relax
+ \ifodd\value{realout}% -> 3
+ \stepcounter{realout}
+ \else% -> 1
+ \setcounter{realout}{-\value{realout}}%
+ \addtocounter{realout}{\value{outpage}}%
+ \addtocounter{realout}{\value{outpage}}%
+ \fi
+ \else% -> 2 or 4
+ \divide\c at realout by 2\relax
+ \ifodd\value{realout}% -> 2
+ \else% -> 4
+ \setcounter{realout}{-\value{realout}}%
+ \stepcounter{realout}
+ \addtocounter{realout}{\value{outpage}}%
+ \addtocounter{realout}{\value{outpage}}%
+ \fi
+ \fi
+ \fi %% \iflongedge...\else
+ \fi %% \ifbooklet
+ \ifnum\value{realout}>\pdfxupnbpages\relax
+ %% if page above nb of pages, output blank page
+ %\hskip\hresult\hskip2\fboxrule
+ \hskip\hboxsize
+ \else
+ %% otherwise compute corresponding page to display
+ %% first keep realout for watermarking...
+ \setcounter{wmoutaux}{\value{realout}}%
+ \setcounter{wmout}{\value{realout}}%
+ \nthvalue{\value{realout}}{\pdfxuppagelist}%
+ \iffound\setcounter{realout}{\value{result}}%
+ \else %% hmmm... problem
+ \message{I'm messed up counting pages...}%
+ \fi
+ %% compute watermarking page and display
+ \ifx\pdfxupwatermark\@empty\else
+ \ifnum\pdfxupnbwp<\value{wmoutaux}\relax
+ \addtocounter{wmoutaux}{-\pdfxupnbwp}%
+ \addtocounter{wmoutaux}{-1}%
+ \divide\c at wmoutaux by \pdfxupwperiod\relax
+ \stepcounter{wmoutaux}%
+ \multiply\c at wmoutaux by \pdfxupwperiod\relax
+ \addtocounter{wmout}{-\value{wmoutaux}}%
+ \fi
+ \vbox to \vboxsize{\vfill
+ \hbox to \hboxsize{\hfill
+ \includegraphics[keepaspectratio,%
+ height=\vresult,width=\hresult,angle=\ang,%
+ page=\value{wmout}\pdfxupclipopt]{\pdfxupwatermark}\hfill}\vfill}%
+ \hskip-\hboxsize\relax
+ \fi
+ %% display current page at correct size
+ \edef\pdfxupinclgr{\includegraphics[\pdfxupbbox,%
+ keepaspectratio,height=\vresult,width=\hresult,angle=\ang,%
+ page=\value{realout}\pdfxupclipopt]{\pdfxupfile}}%
+ \pdfxupwidefbox{\vbox to \vboxsize{\vfill
+ \hbox to \hboxsize{\hfill
+ \pdfxuptightfbox{\hskip\innerhmargin\relax
+ \sbox{0}{\pdfxupinclgr}%
+ \ht0=\dimexpr\ht0 + \innervmargin\relax
+ \dp0=\dimexpr\dp0 + \innervmargin\relax
+ \usebox{0}\hskip\innerhmargin\relax}%
+ \hfill}\vfill}}%
+ \fi
+ \fi}}%
+ \clearpage%
+ }%
+ \makeatother%
+ \end{document}
Property changes on: trunk/Master/texmf-dist/tex/latex/pdfxup/pdfxup-template.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2020-12-18 02:39:22 UTC (rev 57165)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2020-12-18 22:11:58 UTC (rev 57166)
@@ -2067,6 +2067,7 @@
'pdfscreen', 'overlay.*pdf|but.*pdf|left.*pdf|right\.pdf|pdfscreen.sty',
'pdfslide', '\.jpg|\.sty|\.clo|\.cfg|meta.*\.pdf',
'pdfx', '\.(def|dfu|icc|xmp)$|(glyph|Profiles).*tex|pdfx\.sty|ICC_LIC',
+ 'pdfxup', '(template\.tex|\.xup)$',
'petri-nets', 'pnets\.tex|pntext\.tex|\.sty|pndraw\.tex|pnversion\.tex|\.sty|pndraw\.tex',
'pgf-blur', 'tikzlibraryshadows.blur.code.tex',
'pgf-spectra', 'spectra.data.tex|' . $standardtex,
More information about the tex-live-commits
mailing list.