summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-11-22 22:19:22 +0000
committerKarl Berry <karl@freefriends.org>2020-11-22 22:19:22 +0000
commitd21f0a146ce9ce0249c46751cdb849738768e38c (patch)
tree838bff9d089df460ba9ef8fb2c9d3977543960d0 /Master/texmf-dist/tex
parent04277ac5c3816f69a3699299d9f5fc7fb1a5a01d (diff)
hyperxmp (22nov20)
git-svn-id: svn://tug.org/texlive/trunk@56984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty32
1 files changed, 27 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
index 46cc9c97564..0c4ca2de09d 100644
--- a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
+++ b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{hyperxmp}
- [2020/11/01 v5.7 Store hyperref metadata in XMP format]
+ [2020/11/22 v5.9 Store hyperref metadata in XMP format]
\edef\hyxmp@dq@code{\the\catcode`\"}
\catcode`\"=12
\@ifundefined{AtEndDocument}{%
@@ -505,11 +505,33 @@
\RequirePackage{totpages}
\fi
\ifLuaTeX
- \edef\hyxmp@prev@pdf@size{%
- \luadirect{%
-local nbytes = lfs.attributes("\hyxmp@jobname.pdf", "size")
+ \begin{luacode*}
+function get_pdf_size (bname)
+ local odir = ""
+ for _, opt in ipairs(arg) do
+ local m = string.match(opt, "%-output%-d.-=(.*)")
+ if m then
+ odir = m
+ end
+ end
+ local sep = "/"
+ if os.type == "windows" or os.type == "msdos" then
+ sep = "\\\\"
+ end
+ local dlast = string.sub(odir, -1)
+ if odir == "" or dlast == sep or (dlast == ":" and sep == "\\\\") then
+ sep = ""
+ end
+ local fname = odir .. sep .. bname .. ".pdf"
+ local nbytes = lfs.attributes(fname, "size")
+ return nbytes
+end
+ \end{luacode*}
+ \xdef\hyxmp@prev@pdf@size{%
+ \luadirect{
+nbytes = get_pdf_size("\hyxmp@jobname")
if nbytes then
- tex.write(nbytes)
+ tex.write(nbytes)
end
}%
}%