summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-03-10 21:26:16 +0000
committerKarl Berry <karl@freefriends.org>2022-03-10 21:26:16 +0000
commitaf396b33f6d1b355d6240f7e08181ee7f8a4e462 (patch)
tree46441386e3df89674e573a63fec97d8113a83c14
parent8b4eaa6c023b9c30744144dc0844c7a59a23e951 (diff)
xsavebox (10mar22)
git-svn-id: svn://tug.org/texlive/trunk@62604 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/xsavebox/ChangeLog6
-rw-r--r--Master/texmf-dist/doc/latex/xsavebox/xsavebox.pdfbin368610 -> 378552 bytes
-rw-r--r--Master/texmf-dist/source/latex/xsavebox/xsavebox.tex15
-rw-r--r--Master/texmf-dist/tex/latex/xsavebox/xsavebox.sty73
4 files changed, 46 insertions, 48 deletions
diff --git a/Master/texmf-dist/doc/latex/xsavebox/ChangeLog b/Master/texmf-dist/doc/latex/xsavebox/ChangeLog
index b2097c7004c..040cc92a78f 100644
--- a/Master/texmf-dist/doc/latex/xsavebox/ChangeLog
+++ b/Master/texmf-dist/doc/latex/xsavebox/ChangeLog
@@ -1,3 +1,7 @@
+2022-03-10
+ * v0.17
+ * fix: content saving optimised
+
2020-03-04
* v0.16
* fix: dvisvgm-special `bbox' option `transform' added
@@ -9,7 +13,7 @@
2019-08-13
* v0.14
* fix: existing \theXXX macros, such as LaTeX counters, could accidentally
- be overwritten
+ be overwritten
2019-06-24
* v0.13
diff --git a/Master/texmf-dist/doc/latex/xsavebox/xsavebox.pdf b/Master/texmf-dist/doc/latex/xsavebox/xsavebox.pdf
index 9f8d52ba898..39e3051880c 100644
--- a/Master/texmf-dist/doc/latex/xsavebox/xsavebox.pdf
+++ b/Master/texmf-dist/doc/latex/xsavebox/xsavebox.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/xsavebox/xsavebox.tex b/Master/texmf-dist/source/latex/xsavebox/xsavebox.tex
index b7d437cfb09..0c1cbc6f68a 100644
--- a/Master/texmf-dist/source/latex/xsavebox/xsavebox.tex
+++ b/Master/texmf-dist/source/latex/xsavebox/xsavebox.tex
@@ -4,6 +4,14 @@
% http://mirrors.ctan.org/macros/latex/base/lppl.txt
% for the details of that license.
%
+\listfiles
+%%%%%%% pdfmanagement-testphase %%%%%%
+\RequirePackage{pdfmanagement-testphase} % load the package
+\DeclareDocumentMetadata % activates the PDF management interface
+{
+ %uncompress,
+}
+%%%%%% /pdfmanagement-testphase %%%%%%
\documentclass[a4paper]{article}
\frenchspacing
\usepackage[UKenglish]{babel}
@@ -33,12 +41,7 @@
pdfsubject={Documentation},
pdfauthor={Alexander Grahn},
pdfkeywords={PDF features, XObject, savebox, LaTeX, dvips, repeated content, repeated graphics, eps, PostScript, ps2pdf, XeLaTeX, pdfLaTeX, LuaLaTeX, dvipdfmx, dvisvgm},
- citebordercolor={0 0 1},
- filebordercolor={0 0 1},
- linkbordercolor={0 0 1},
- menubordercolor={0 0 1},
- pagebordercolor={0 0 1},
- urlbordercolor={0 0 1},
+ allcolors=blue,
% pdfpagelayout=SinglePage
}
diff --git a/Master/texmf-dist/tex/latex/xsavebox/xsavebox.sty b/Master/texmf-dist/tex/latex/xsavebox/xsavebox.sty
index 2f3fac684fe..36aeaaa1d0f 100644
--- a/Master/texmf-dist/tex/latex/xsavebox/xsavebox.sty
+++ b/Master/texmf-dist/tex/latex/xsavebox/xsavebox.sty
@@ -45,11 +45,11 @@
%
% The Current Maintainer of this work is A. Grahn.
-\RequirePackage{xparse}
+\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\RequirePackage{l3keys2e}
-\def\g@xsb@version@tl{0.16}
-\def\g@xsb@date@tl{2020/03/04}
+\def\g@xsb@version@tl{0.17}
+\def\g@xsb@date@tl{2022/03/10}
\ProvidesExplPackage{xsavebox}{\g@xsb@date@tl}{\g@xsb@version@tl}
{saveboxes for repeating content without code replication}
@@ -149,24 +149,21 @@
\DeclareDocumentCommand\xsavebox{smO{\width}O{c}+m}{
\xsb_check_box_name:n{#2}
\group_begin:
- \tl_set:Nn\l_xsb_content_grouped_tl{
- \group_begin:
- \cs_set:Nn\ocgxii_beginocg:nnnn{}\cs_set:Nn\ocgxii_endocg:{}
- #5
- \group_end:
- }
\xsb_push_props: %new, empty properties dict
\xsb_beginLTR:
- \IfBooleanTF{#1}{
- %later colour injection possible (pdfTeX, LuaTeX)
- \hbox_set:Nn\l_xsb_raw_box{\l_xsb_content_grouped_tl} %raw content
- \hbox_set:Nn\l_xsb_box{ %content re-aligned
- \makebox[#3][#4]{\l_xsb_content_grouped_tl}
+ \hbox_set:Nn\l_xsb_raw_box{ %raw content
+ \bool_lazy_and:nnF{
+ \tl_if_exist_p:c{xsb@\int_use:N\g_xsb_id_int}
+ }{
+ \bool_if_p:c{c_\tl_use:c{xsb@\int_use:N\g_xsb_id_int}_bool}
+ }{ %prevent unused boxes from creating OCGs/OCMDs
+ \DeclareDocumentEnvironment{ocg}{O{}mmm}{\ignorespaces}{\unskip}
+ \DeclareDocumentEnvironment{ocmd}{O{}m}{\ignorespaces}{\unskip}
}
- }{
- %the LaTeX way (no colour injection)
- \sbox\l_xsb_raw_box{\l_xsb_content_grouped_tl} %raw content
- \savebox\l_xsb_box[#3][#4]{\l_xsb_content_grouped_tl} %re-aligned
+ #5
+ }
+ \hbox_set:Nn\l_xsb_box{ %content re-aligned
+ \makebox[#3][#4]{\hbox_unpack:N\l_xsb_raw_box}
}
%process one of \l_xsb_raw_box or \l_xsb_box
\dim_compare:nTF{\box_wd:N\l_xsb_raw_box>\box_wd:N\l_xsb_box}{
@@ -176,31 +173,25 @@
%for colour injection
\hbox_set:Nn\l_xsb_box{
\makebox[\box_wd:N\l_xsb_raw_box][l]{
- \makebox[#3][s]{#5}
+ \makebox[#3][s]{\hbox_unpack:N\l_xsb_raw_box}
}
}
}{
%no colour injection
\savebox\l_xsb_box[\box_wd:N\l_xsb_raw_box][l]{
- \makebox[#3][s]{#5}
+ \makebox[#3][s]{\hbox_unpack:N\l_xsb_raw_box}
}
}
\xsb_process_box:nnnN{#2}{#3}{#4}\l_xsb_box
}{ % raw content
- \IfBooleanTF{#1}{
- \hbox_set:Nn\l_xsb_raw_box{#5}
- }{
- \sbox\l_xsb_raw_box{#5}
+ \IfBooleanF{#1}{
+ \sbox\l_xsb_raw_box{\hbox_unpack:N\l_xsb_raw_box}
}
\xsb_process_box:nnnN{#2}{#3}{#4}\l_xsb_raw_box
}
}{
- \IfBooleanTF{#1}{
- \hbox_set:Nn\l_xsb_box{ %content re-aligned
- \makebox[#3][#4]{#5}
- }
- }{
- \savebox\l_xsb_box[#3][#4]{#5} %re-aligned
+ \IfBooleanF{#1}{
+ \savebox\l_xsb_box[#3][#4]{\hbox_unpack:N\l_xsb_raw_box}
}
\xsb_process_box:nnnN{#2}{\width}{c}\l_xsb_box
}
@@ -219,7 +210,7 @@
\DeclareDocumentEnvironment{xlrbox*}{m}{
\xsb_check_box_name:n{#1}
- \xsb_xlrbox_star:
+ \xsb_xlrbox:
}{
\xsb_endxlrbox_star:n{#1}
}
@@ -243,27 +234,27 @@
\group_begin:
\xsb_push_props: %new, empty properties dict
\xsb_beginLTR:
- \hbox_set:Nw\l_xsb_box\group_begin:
+ \hbox_set:Nw\l_xsb_box
+ \bool_lazy_and:nnF{ %prevent unused boxes from creating OCGs/OCMDs
+ \tl_if_exist_p:c{xsb@\int_use:N\g_xsb_id_int}
+ }{
+ \bool_if_p:c{c_\tl_use:c{xsb@\int_use:N\g_xsb_id_int}_bool}
+ }{
+ \DeclareDocumentEnvironment{ocg}{O{}mmm}{\ignorespaces}{\unskip}
+ \DeclareDocumentEnvironment{ocmd}{O{}m}{\ignorespaces}{\unskip}
+ }
\ignorespaces
}
\cs_new_protected_nopar:Nn\xsb_endxlrbox:n{
\unskip
- \group_end:\hbox_set_end:
+ \hbox_set_end:
\sbox\l_xsb_box{\hbox_unpack_drop:N\l_xsb_box}
\xsb_process_box:nnnN{#1}{\width}{c}\l_xsb_box
\xsb_endLTR:
\group_end:
}
-\cs_new_protected:Nn\xsb_xlrbox_star:{
- \group_begin:
- \xsb_push_props: %new, empty properties dict
- \xsb_beginLTR:
- \hbox_set:Nw\l_xsb_box
- \ignorespaces
-}
-
\cs_new_protected_nopar:Nn\xsb_endxlrbox_star:n{
\unskip
\hbox_set_end: