summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3backend
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-14 03:01:33 +0000
committerNorbert Preining <norbert@preining.info>2021-07-14 03:01:33 +0000
commit3303a89b11161d66ec78811056b85306f696cc09 (patch)
tree32dec4376d10f3e3aa82049a3388462e39914a70 /macros/latex/contrib/l3backend
parent4ac920a9909dd7d233ed3662bb576e1ae4ade873 (diff)
CTAN sync 202107140301
Diffstat (limited to 'macros/latex/contrib/l3backend')
-rw-r--r--macros/latex/contrib/l3backend/CHANGELOG.md9
-rw-r--r--macros/latex/contrib/l3backend/README.md2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-basics.dtx23
-rw-r--r--macros/latex/contrib/l3backend/l3backend-box.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-code.pdfbin884350 -> 887250 bytes
-rw-r--r--macros/latex/contrib/l3backend/l3backend-color.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-draw.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-graphics.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-header.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-opacity.dtx59
-rw-r--r--macros/latex/contrib/l3backend/l3backend-pdf.dtx24
-rw-r--r--macros/latex/contrib/l3backend/l3backend.ins2
12 files changed, 90 insertions, 39 deletions
diff --git a/macros/latex/contrib/l3backend/CHANGELOG.md b/macros/latex/contrib/l3backend/CHANGELOG.md
index 1ec53b4d8b..fae21bb66f 100644
--- a/macros/latex/contrib/l3backend/CHANGELOG.md
+++ b/macros/latex/contrib/l3backend/CHANGELOG.md
@@ -6,6 +6,12 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2021-07-12]
+
+### Fixed
+- GoTo link formation for Distiller-based workflows (issue #957)
+- Support transparency with Distiller
+
## [2021-05-07]
### Changed
@@ -180,7 +186,8 @@ this project uses date-based 'snapshot' version identifiers.
- Include `l3backend` in file names
- Moved backend code to internal for each 'parent' module
-[Unreleased]: https://github.com/latex3/latex3/compare/2021-05-07...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2021-07-12...HEAD
+[2021-07-12]: https://github.com/latex3/latex3/compare/2021-05-07...2021-07-12
[2021-05-07]: https://github.com/latex3/latex3/compare/2021-03-18...2021-05-07
[2021-03-18]: https://github.com/latex3/latex3/compare/2021-03-02...2021-03-18
[2021-03-02]: https://github.com/latex3/latex3/compare/2021-02-18...2021-03-02
diff --git a/macros/latex/contrib/l3backend/README.md b/macros/latex/contrib/l3backend/README.md
index b4b156dee9..fa022b27e6 100644
--- a/macros/latex/contrib/l3backend/README.md
+++ b/macros/latex/contrib/l3backend/README.md
@@ -1,7 +1,7 @@
LaTeX3 Backend Drivers
======================
-Release 2021-05-07
+Release 2021-07-12
This package forms parts of `expl3`, and contains the code used to interface
with backends (drivers) across the `expl3` codebase. The functions here are
diff --git a/macros/latex/contrib/l3backend/l3backend-basics.dtx b/macros/latex/contrib/l3backend/l3backend-basics.dtx
index 446178138e..ef02b741e0 100644
--- a/macros/latex/contrib/l3backend/l3backend-basics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
@@ -70,27 +70,27 @@
% \begin{macrocode}
\ProvidesExplFile
%<*dvipdfmx>
- {l3backend-dvipdfmx.def}{2021-05-07}{}
+ {l3backend-dvipdfmx.def}{2021-07-12}{}
{L3 backend support: dvipdfmx}
%</dvipdfmx>
%<*dvips>
- {l3backend-dvips.def}{2021-05-07}{}
+ {l3backend-dvips.def}{2021-07-12}{}
{L3 backend support: dvips}
%</dvips>
%<*dvisvgm>
- {l3backend-dvisvgm.def}{2021-05-07}{}
+ {l3backend-dvisvgm.def}{2021-07-12}{}
{L3 backend support: dvisvgm}
%</dvisvgm>
%<*luatex>
- {l3backend-luatex.def}{2021-05-07}{}
+ {l3backend-luatex.def}{2021-07-12}{}
{L3 backend support: PDF output (LuaTeX)}
%</luatex>
%<*pdftex>
- {l3backend-pdftex.def}{2021-05-07}{}
+ {l3backend-pdftex.def}{2021-07-12}{}
{L3 backend support: PDF output (pdfTeX)}
%</pdftex>
%<*xetex>
- {l3backend-xetex.def}{2021-05-07}{}
+ {l3backend-xetex.def}{2021-07-12}{}
{L3 backend support: XeTeX}
%</xetex>
% \end{macrocode}
@@ -156,7 +156,14 @@
% most up-to-date method,
% \begin{macrocode}
\cs_if_exist:NTF \@ifl@t@r
- { \cs_new_eq:NN \__kernel_backend_first_shipout:n \AtBeginDvi }
+ {
+ \@ifl@t@r \fmtversion { 2020-10-01 }
+ {
+ \cs_new_protected:Npn \__kernel_backend_first_shipout:n #1
+ { \hook_gput_code:nnn { shipout / firstpage } { l3backend } {#1} }
+ }
+ { \cs_new_eq:NN \__kernel_backend_first_shipout:n \AtBeginDvi }
+ }
{ \cs_new_eq:NN \__kernel_backend_first_shipout:n \use:n }
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/l3backend/l3backend-box.dtx b/macros/latex/contrib/l3backend/l3backend-box.dtx
index e45df7604b..7724aa7104 100644
--- a/macros/latex/contrib/l3backend/l3backend-box.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-code.pdf b/macros/latex/contrib/l3backend/l3backend-code.pdf
index c87ef2dc38..e86f472ae4 100644
--- a/macros/latex/contrib/l3backend/l3backend-code.pdf
+++ b/macros/latex/contrib/l3backend/l3backend-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3backend/l3backend-color.dtx b/macros/latex/contrib/l3backend/l3backend-color.dtx
index 7979b2d8e6..ad3075dff5 100644
--- a/macros/latex/contrib/l3backend/l3backend-color.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-color.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-draw.dtx b/macros/latex/contrib/l3backend/l3backend-draw.dtx
index 449b7f9c93..5a896469bd 100644
--- a/macros/latex/contrib/l3backend/l3backend-draw.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-draw.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-graphics.dtx b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
index 1448ecddc1..e1bd1e0921 100644
--- a/macros/latex/contrib/l3backend/l3backend-graphics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-header.dtx b/macros/latex/contrib/l3backend/l3backend-header.dtx
index 1d01b18928..b5ab577892 100644
--- a/macros/latex/contrib/l3backend/l3backend-header.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-header.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-opacity.dtx b/macros/latex/contrib/l3backend/l3backend-opacity.dtx
index a600defcc0..6017403ea0 100644
--- a/macros/latex/contrib/l3backend/l3backend-opacity.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-opacity.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
@@ -72,7 +72,14 @@
% \end{macrocode}
%
% \begin{macro}{\@@_backend_select:n,\@@_backend_select_aux:n}
-% No stack so set values directly.
+% \begin{macro}{\@@_backend_fill:n, \@@_backend_stroke:n}
+% \begin{macro}{\@@_backend:nnn, \@@_backend:xnn}
+% No stack so set values directly. The need to deal with Distiller and
+% Ghostscript separately means we use a common auxiliary: the two
+% systems require different PostScript for transparency. This is
+% of course not quite as efficient as doing one test for setting all
+% transparency, but it keeps things clearer here. Thanks to Alex Grahn
+% for the detail on testing for GhostScript.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_select:n #1
{
@@ -81,29 +88,47 @@
}
\cs_new_protected:Npn \@@_backend_select_aux:n #1
{
- \__kernel_backend_postscript:n
- { #1 ~ .setfillconstantalpha ~ #1 ~ .setstrokeconstantalpha }
+ \@@_backend:nnn {#1} { fill } { ca }
+ \@@_backend:nnn {#1} { stroke } { CA }
}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@@_backend_fill:n, \@@_backend_stroke:n}
-% \begin{macro}{\@@_backend:nn, \@@_backend:xn}
-% Similar to the above but with no stack and only adding to one or other of
-% the entries.
-% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_fill:n #1
- { \@@_backend:xn { \fp_eval:n { min(max(0,#1),1) } } { fill } }
+ {
+ \@@_backend:xnn
+ { \fp_eval:n { min(max(0,#1),1) } }
+ { fill }
+ { ca }
+ }
\cs_new_protected:Npn \@@_backend_stroke:n #1
- { \@@_backend:xn { \fp_eval:n { min(max(0,#1),1) } } { stroke } }
-\cs_new_protected:Npn \@@_backend:nn #1#2
{
- \__kernel_backend_postscript:n { #1 ~ .set #2 constantalpha }
+ \@@_backend:xnn
+ { \fp_eval:n { min(max(0,#1),1) } }
+ { stroke }
+ { CA }
}
-\cs_generate_variant:Nn \@@_backend:nn { x }
+\cs_new_protected:Npn \@@_backend:nnn #1#2#3
+ {
+ \__kernel_backend_postscript:n
+ {
+ product ~ (Ghostscript) ~ search
+ {
+ pop ~ pop ~ pop ~
+ #1 ~ .set #2 constantalpha
+ }
+ {
+ pop ~
+ mark ~
+ /#3 ~ #1
+ /SetTransparency ~
+ pdfmark
+ }
+ ifelse
+ }
+ }
+\cs_generate_variant:Nn \@@_backend:nnn { x }
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macrocode}
%</dvips>
diff --git a/macros/latex/contrib/l3backend/l3backend-pdf.dtx b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
index 11456302a2..5c7fa3b565 100644
--- a/macros/latex/contrib/l3backend/l3backend-pdf.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-07}
+% \date{Released 2021-07-12}
%
% \maketitle
%
@@ -392,8 +392,8 @@
% {
% pdf.linkdp.pad ,
% pdf.linkht.pad ,
-% pdf.llx, pdf.lly ,
-% pdf.ury, pdf.ury ,
+% pdf.llx, pdf.lly ,
+% pdf.ury, pdf.ury ,
% pdf.link.dict ,
% pdf.outerbox ,
% pdf.baselineskip
@@ -403,6 +403,10 @@
% grab the link content as a box which can then unbox: this allows the same
% interface as for \pdfTeX{}.
%
+% Notice that the link setup here uses |/Action| not |/A|. That is because
+% Distiller \emph{requires} this trigger word, rather than a \enquote{raw}
+% PDF dictionary key (Ghostscript can handle either form).
+%
% Taking the idea of |evenboxes| from \pkg{hypdvips}, we implement a minimum
% box height and depth for link placement. This means that \enquote{underlining}
% with a hyperlink will generally give an even appearance. However, to ensure
@@ -417,10 +421,13 @@
% as taken from \pkg{hypdvips}.
%
% Getting the outer dimensions of the text area may be better using a two-pass
-% approach and |\tex_savepos:D|. That plus format mode are still to re-examine.
+% approach and |\tex_savepos:D|. That plus generic mode are still to re-examine.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_link_begin_goto:nnw #1#2
- { \@@_backend_link_begin:nw { #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) >> } }
+ {
+ \@@_backend_link_begin:nw
+ { #1 /Subtype /Link /Action << /S /GoTo /D ( #2 ) >> }
+ }
\cs_new_protected:Npn \@@_backend_link_begin_user:nnw #1#2
{ \@@_backend_link_begin:nw {#1#2} }
\cs_new_protected:Npn \@@_backend_link_begin:nw #1
@@ -428,6 +435,11 @@
\bool_if:NF \g_@@_backend_link_bool
{ \@@_backend_link_begin_aux:nw {#1} }
}
+% \end{macrocode}
+% The definition of |pdf.link.dict| here is needed as there is code in the
+% PostScript headers for breaking links, and that can only work with this
+% available.
+% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_link_begin_aux:nw #1
{
\bool_gset_true:N \g_@@_backend_link_bool
@@ -1377,7 +1389,7 @@
width ~ \dim_eval:n {#1} ~
height ~ \dim_eval:n {#2} ~
depth ~ \dim_eval:n {#3} ~
- <</Type/Annot #4 >>
+ << /Type /Annot #4 >>
}
}
% \end{macrocode}
diff --git a/macros/latex/contrib/l3backend/l3backend.ins b/macros/latex/contrib/l3backend/l3backend.ins
index 5bba632ffb..8e316be0f0 100644
--- a/macros/latex/contrib/l3backend/l3backend.ins
+++ b/macros/latex/contrib/l3backend/l3backend.ins
@@ -35,7 +35,7 @@ license information is placed in the derived files.
\preamble
-Copyright (C) 1990-2021 The LaTeX Project
+Copyright (C) 2019-2021 The LaTeX Project
It may be distributed and/or modified under the conditions of
the LaTeX Project Public License (LPPL), either version 1.3c of