[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: grr (a61bc84)
Ulrike Fischer
fischer at troubleshooting-tex.de
Wed Feb 10 16:28:47 CET 2021
Repository : https://github.com/latex3/pdfresources
On branch : reworking-annot
Link : https://github.com/latex3/pdfresources/commit/a61bc84fffb9c9d6750ad417e6e25aec7a3b5a1c
>---------------------------------------------------------------
commit a61bc84fffb9c9d6750ad417e6e25aec7a3b5a1c
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Wed Feb 10 16:28:47 2021 +0100
grr
>---------------------------------------------------------------
a61bc84fffb9c9d6750ad417e6e25aec7a3b5a1c
newpackages/new-attachfile.sty | 812 +++++++++++++++++++++++++++++++++++++++++
newpackages/new-bookmark.sty | 670 ++++++++++++++++++++++++++++++++++
newpackages/new-hyperxmp.sty | 110 ++++++
newpackages/new-pdflscape.sty | 54 +++
4 files changed, 1646 insertions(+)
diff --git a/newpackages/new-attachfile.sty b/newpackages/new-attachfile.sty
new file mode 100644
index 0000000..73a5b29
--- /dev/null
+++ b/newpackages/new-attachfile.sty
@@ -0,0 +1,812 @@
+%%
+%% This is file `new-attachfile.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%%
+%% This is a generated file.
+%%
+%% Project: new-attachfile,
+%% Version: 2020-04-29, 0.1
+%%
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://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".
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{new-attachfile}%
+ [2020/06/26 v0.2 Attach files into PDF (HO/UF)]%
+\RequirePackage{pdfmanagement}
+\RequirePackage{iftex}[2019/11/07]
+\RequirePackage{keyval}
+\RequirePackage{color}
+\RequirePackage{infwarerr}[2010/04/08]
+\RequirePackage{ltxcmds}[2010/04/26]
+\RequirePackage{kvoptions}[2009/07/21]
+\RequirePackage{pdftexcmds}[2010/04/01]
+\RequirePackage{pdfescape}[2007/11/11]
+\RequirePackage{hyperref}
+\RequirePackage{hycolor}[2008/07/29]
+\RequirePackage{l3color,l3draw,l3pdffile,bitset,xparse}
+
+
+% pattern matching removed. Perhaps later with regex ...
+
+% setup commands / options
+%document options, handle later
+\SetupKeyvalOptions{%
+ family=AtFi,%
+ prefix=atfi@%
+}
+\DeclareBoolOption{draft}
+\DeclareComplementaryOption{final}{draft}
+
+% need a
+\DeclareRobustCommand{\atfi at pdfstringdef}[2]{%
+ \pdfstringdef\atfi at temp@string{#2}%
+ \edef#1{\atfi at temp@string}%
+}
+
+
+% keyval setup is stored in a list. It should be executed locally to be
+% able to change the dictionaries in a group
+
+\ExplSyntaxOn
+% message
+\cs_new:Npn \__atfi_clist_display:n #1 {*~#1\\}
+\msg_new:nnn
+ { atfi }
+ { unknown-choice }
+ {
+ Value~'#3'~is~invalid~for~key~'#1'.\\
+ The~key~accepts~only~the~choices\\
+ \clist_map_function:nN { #2 }\__atfi_clist_display:n
+ An~empty~value~removes~the~setting.
+ }
+
+\msg_new:nnn
+ { atfi }
+ { no-bool }
+ {
+ Value~'#2'~is~invalid~for~key~'#1'.\\
+ The~key~accepts~only~the~choices\\
+ *~true\\
+ *~false \\
+ No~value~is~equivalent~to~using~`true`.
+ }
+
+\msg_new:nnn
+ { atfi }
+ { file-name-exist }
+ {
+ The name~#1~has~already~been~used.\\
+ File~\tl_to_str:n{#2}~will~not~be~embedded.\\
+ }
+% variables
+% probably generic ....
+\pdfdict_new:nn {l} {annot/FileAttachment}
+\pdfdict_put:nnn {annot/FileAttachment}{Subtype}{/FileAttachment}
+\pdfdict_new:nn {l} {annot/FileAttachment/AP} % appearance
+
+%
+\color_set:nnn {__atfi_annot_color}{rgb}{1,0.9255,0.7765}
+\bitsetReset {__atfi_annotFlags} %
+
+\tl_new:N \l__atfi_tmpa_tl
+% key-val
+
+\tl_new:N \l__atfi_setup_keys_tl
+\tl_new:N \l__atfi_filename_tl
+
+\tl_new:N \l__atfi_annot_icon_tl
+\tl_new:N \l__atfi_annot_color_tl
+\clist_new:N \g__atfi_file_afrelationship_clist
+\clist_gset:Nn \g__atfi_file_afrelationship_clist
+ {
+ Source, Data, Alternative, Supplement,
+ EncryptedPayload, FormData, Schema,
+ Unspecified (default)
+ }
+\fp_new:N \l__atfi_annot_scale_fp
+\bool_new:N \l__atfi_annot_print_bool
+\bool_new:N \l__atfi_annot_appearance_bool
+\bool_set_true:N \l__atfi_annot_appearance_bool
+
+\NewDocumentCommand\attachfilesetup { m }
+ {
+ \tl_put_right:Nn \l__atfi_setup_keys_tl {, #1 }
+ }
+
+% defaults:
+
+\attachfilesetup
+ {
+ ,icon=PushPin
+ ,date=\file_timestamp:n{\jobname.log}
+ }
+
+% replace later
+\cs_new_protected:Npn \atfi at setup #1
+ {
+ \keys_set:nn {atfi} { #1 }
+ }
+
+
+\keys_define:nn { atfi }
+ {
+ ,mimetype .code:n =
+ {
+ \tl_if_empty:nTF { #1 }
+ {
+ \pdfdict_remove:nn {file}{Subtype}
+ }
+ {
+ \pdfdict_put:nnx {file}{Subtype}{\pdf_text_convert:nn {name}{#1} }
+ }
+ }
+ ,mimetype .groups:n = { embed }
+ ,filename .code:n =
+ {
+ \tl_if_empty:nF { #1 }
+ {
+ \pdf_text_convert:nnN {string-hex-print} { #1 } \l__atfi_filename_tl %variable
+ \pdfdict_put:nnx { file/FileSpec } {F} { \l__atfi_filename_tl }
+ \pdfdict_put:nnx { file/FileSpec } {UF} { \l__atfi_filename_tl }
+ }
+ }
+ ,filename .groups:n = {embed}
+ ,afrelationship .choices:nn =
+ {Source, Data, Alternative, Supplement, EncryptedPayload, FormData, Schema, Unspecified }
+ {
+ \pdfdict_put:nnx { file/FileSpec } {AFRelationship } { \pdf_text_convert:nn {name} {#1} }
+ }
+ ,afrelationship .default:n = { Unspecified }
+ ,afrelationship / .code:n =
+ {
+ \pdfdict_remove:nn { file/FileSpec } {AFRelationship }
+ }
+ ,afrelationship / unknown .code:n =
+ {
+ \msg_warning:nnxxx { atfi } { unknown-choice }
+ { afrelationship }
+ { \g__atfi_file_afrelationship_clist }
+ { \exp_not:n {#1} }
+ }
+ ,new-afrelationship .code:n =
+ {
+ \clist_gput_right:Nn \g__atfi_file_afrelationship_clist { #1~(user~defined) }
+ \keys_define:nn { atfi }
+ {
+ afrelationship / #1 .code:n =
+ {
+ \pdfdict_put:nnx
+ { file/FileSpec }
+ {AFRelationship }
+ { \pdf_text_convert:nn {name} {#1} }
+ }
+ }
+ }
+ %ucfilespec -> embed step
+ %checksum -> bool to suppress the checksum
+ %creationdate ->additional /CreationDate in FileSpec-dict
+ %moddate -> boolean to suppress /ModDate in FileSpec
+ ,moddate .code:n =
+ {
+ \tl_if_empty:nTF { #1 }
+ {
+ \pdfdict_remove:nn {file/FileSpec}{ModDate}
+ }
+ {
+ \pdfdict_put:nnx {file}{ModDate}{\pdf_text_convert:nnN {string-lit}{#1} } %or print??
+ }
+ }
+ ,moddate .groups:n = { embed }
+ ,icon .choices:nn =
+ { Data, Graph, PushPin, Tag }
+ {
+ \tl_set:Nn \l__atfi_annot_icon_tl { #1 }
+ \pdfdict_put:nnn { annot/FileAttachment }{ Name }{ #1 }
+ }
+ ,icon / unknown .code:n =
+ {
+ \msg_warning:nnxxx { atfi } { unknown-choice }
+ { icon }
+ { Data, Graph, PushPin, Tag }
+ { \exp_not:n {#1} }
+ }
+ ,icon .groups:n = { annot }
+ % initial: PushPin, but should be set only in the command
+ ,color .tl_set:N = \l__atfi_annot_color_tl
+ ,color .groups:n = { annot }
+ ,color .initial:n = { __atfi_annot_color }
+ %color -> attach step, affects icon
+ % decide allowed syntax of expressions ...
+ % initial: 1 0.9255 0.7765
+
+ %% annotation dict (attach step)
+ ,date .code:n =
+ { % escaping??
+ \pdfdict_put:nnn {annot/FileAttachment}{M}{(#1)}
+ }
+ %annotname /NM (..) (unique name)
+ % no initial value
+ ,annotname .code:n =
+ {
+ %code to sanitize the value
+ %need an expl3 variant ...
+ \atfi at pdfstringdef\l__atfi_tmpa_tl { #1 }
+ \pdfdict_put:nnx {annot/FileAttachment}{NM}{(\l__atfi_tmpa_tl)}
+ }
+ ,annotname .groups:n = { annot }
+ % no initial value
+ ,author .code:n =
+ {
+ %code to sanitize the value
+ %need an expl3 variant ...
+ \atfi at pdfstringdef\l__atfi_tmpa_tl { #1 }
+ \pdfdict_put:nnx {annot/FileAttachment}{T}{(\l__atfi_tmpa_tl)}
+ }
+ ,author .groups:n = { annot }
+ % no initial value
+
+ % description /Contents
+ ,description .code:n =
+ {
+ %code to sanitize the value
+ %need an expl3 variant ...
+ \atfi at pdfstringdef\l__atfi_tmpa_tl { #1 }
+ \pdfdict_put:nnx {annot/FileAttachment}{Contents}{(\l__atfi_tmpa_tl)}
+ }
+ ,description .groups:n = { annot }
+
+ ,subject .code:n =
+ {
+ %code to sanitize the value
+ %need an expl3 variant ...
+ \atfi at pdfstringdef\l__atfi_tmpa_tl { #1 }
+ \pdfdict_put:nnn {annot/FileAttachment}{Subj}{(\l__atfi_tmpa_tl)}
+ }
+ ,subject .groups:n = { annot }
+ ,appearance .bool_set:N = \l__atfi_annot_appearance_bool
+ ,appearance .groups:n = { annot }
+ % appearance: decides if the appearance dict is insert. drop?
+ ,print .choice:
+ ,print / false .code:n =
+ {
+ \bool_set_false:N \__atfi_annot_print_bool
+ \bitsetClear { __atfi_annotFlags }{\prop_item:Nn\c_pdfannot_annot_flags_prop {Print}}
+ \pdfdict_put:nnx {annot/FileAttachment}{F}{\bitsetGetDec { __atfi_annotFlags }}
+ }
+ ,print / true .code:n =
+ {
+ \bool_set_true:N \__atfi_annot_print_bool
+ \bitsetSet { __atfi_annotFlags }{\prop_item:Nn\c_pdfannot_annot_flags_prop {Print}}
+ \pdfdict_put:nnx {annot/FileAttachment}{F}{\bitsetGetDec { __atfi_annotFlags }}
+ }
+ ,print .default:n = true
+ ,print / unknown .code:n =
+ {
+ \msg_warning:nnxx { atfi} { no-bool }
+ { print }
+ { \exp_not:n {#1} }
+ }
+ ,print .groups:n = { annot }
+ % print: sets /F flag, also boolean used in the no-XXX command
+ ,zoom .choice:
+ ,zoom / false .code:n =
+ {
+ \bool_set_false:N \__atfi_annot_zoom_bool
+ \bitsetSet { __atfi_annotFlags }{\prop_item:Nn\c_pdfannot_annot_flags_prop {NoZoom}}
+ \pdfdict_put:nnx {annot/FileAttachment}{F}{\bitsetGetDec { __atfi_annotFlags }}
+ }
+ ,zoom / true .code:n =
+ {
+ \bool_set_true:N \__atfi_annot_zoom_bool
+ \bitsetClear { __atfi_annotFlags }{\prop_item:Nn\c_pdfannot_annot_flags_prop {NoZoom}}
+ \pdfdict_put:nnx {annot/FileAttachment}{F}{\bitsetGetDec { __atfi_annotFlags }}
+ }
+ ,zoom / unknown .code:n =
+ {
+ \msg_warning:nnxx { atfi} { no-bool }
+ { zoom }
+ { \exp_not:n {#1} }
+ }
+ ,print .groups:n = { annot }
+ ,scale .fp_set:N = \l__atfi_annot_scale_fp
+ ,scale .initial:n = 1
+ }
+
+
+\ExplSyntaxOff
+
+% more colors?
+%\define at key{AtFi}{color}{%
+% \HyColor at AttachfileColor{#1}%
+% \atfi at color@tex\atfi at color@inline\atfi at color@annot
+% {attachfile2}{color}%
+%}
+
+
+\ProcessKeyvalOptions*
+%\def\atfi at DisableOption{%
+% \DisableKeyvalOption[action=error,package=attachfile2]{AtFi}%
+%}
+
+\ExplSyntaxOn
+\NewDocumentCommand \notextattachfile { O{} m }
+ {
+ \group_begin:
+ % groups?
+ \keys_set:no {atfi} { \l__atfi_setup_keys_tl }
+ \keys_set:n {atfi} { #1 }
+ \bool_if:NTF \l__atfi_annot_print_bool
+ {
+ \mode_leave_vertical:
+ \group_begin:
+ \exp_args:NV \color_select:n \l__atfi_annot_color_tl
+ #2\strut
+ \group_end:
+ }
+ {
+ \phantom{#2\strut}
+ }
+ \group_end:
+ }
+\ExplSyntaxOff
+%\atfi at DisableOption{draft}%
+%\atfi at DisableOption{final}%
+\ifatfi at draft
+ \def\atfi at dummy@pushpin{%
+ \raisebox{-1.25bp}{\parbox[b][14bp]{24bp}{}}%
+ }%
+ \DeclareRobustCommand{\textattachfile}[3][]{%
+ \notextattachfile[{#1}]{#3}%
+ }%
+ \DeclareRobustCommand{\noattachfile}[1][]{%
+ \notextattachfile[{#1}]{\atfi at dummy@pushpin}%
+ }%
+ \DeclareRobustCommand{\attachfile}[2][]{%
+ \noattachfile[{#1}]%
+ }%
+ \expandafter\endinput
+\fi
+
+\ExplSyntaxOn
+% embed the file and create the filespec dictionary:
+\cs_new_protected:Npn \__atfi_file_embed:nnn #1 #2 #3 % #1 keys, #2 symbolic name, #3 file name
+ {
+ \pdf_object_if_exist:nTF { g__atfi_file_obj_#2 }
+ {
+ % message ...
+ \msg_warning:nnnn {atfi}{name-exist}{#2}{#3}
+ }
+ {
+ \group_begin:
+ %keys for dict entries ...
+ \keys_set_groups:nnV {atfi}{embed} \l__atfi_setup_keys_tl
+ \keys_set_groups:nnn {atfi}{embed} {#1}
+ \pdffile_embed_file:nnN { g__atfi_file_obj_#2 }{ #3 } %!!!!!!!!!!!syntax
+ \group_end:
+ }
+ }
+
+% create the appearance xform:
+\cs_new_protected:Npn \__atfi_annot_xform_appearance:n #1
+ {
+ \pdf_xform_if_exist:nF { g__atfi_annot_iconxform_#1 }
+ {
+ \pdf_xform_new:nnn
+ { g__atfi_annot_iconxform_#1 }
+ { } % attributes?
+ { \use:c { __atfi_annot_print_icon_#1 } }
+ }
+ }
+
+
+\cs_new_protected:Npn \__atfi_annot:n #1 {}%#1 symbolic object name from
+\def\atfi at insert@file at annot#1
+ {
+ \rule{0pt}{0pt}%
+ \pdfdict_put:nnx
+ { annot/FileAttachment }
+ {FS}
+ {\pdf_object_ref:n{g__atfi_file_obj_#1}}
+ \bool_if:NT \l__atfi_annot_appearance_bool
+ {
+ \pdfdict_put:nnx
+ { annot/FileAttachment/AP }
+ { N }
+ { \pdf_xform_ref:n { g__atfi_annot_iconxform_\l__atfi_annot_icon_tl } }
+ \pdfdict_put:nnx
+ { annot/FileAttachment/AP }
+ { R }
+ { \pdf_xform_ref:n { g__atfi_annot_iconxform_\l__atfi_annot_icon_tl } }
+ \pdfdict_put:nnx
+ { annot/FileAttachment/AP }
+ { D }
+ { \pdf_xform_ref:n { g__atfi_annot_iconxform_\l__atfi_annot_icon_tl } }
+ }
+ \pdfannot_box:nnnn
+ {
+ \fp_to_dim:n
+ {
+ \l__atfi_annot_scale_fp *
+ \pdf_xform_wd:n{g__atfi_annot_iconxform_\l__atfi_annot_icon_tl}
+ }
+ }
+ {
+ \fp_to_dim:n
+ {
+ \l__atfi_annot_scale_fp *
+ \pdf_xform_ht:n{g__atfi_annot_iconxform_\l__atfi_annot_icon_tl}
+ }
+ }
+ {
+ \fp_to_dim:n
+ {
+ \l__atfi_annot_scale_fp *
+ \pdf_xform_dp:n{g__atfi_annot_iconxform_\l__atfi_annot_icon_tl}
+ }
+ }
+ {
+ \pdfdict_use:n {annot/FileAttachment}
+ \bool_if:NT \l__atfi_annot_appearance_bool
+ {
+ /AF
+ <<
+ \pdfdict_use:n {annot/FileAttachment/AF}
+ >>
+ }
+
+ /FS~ \pdf_object_ref:n{atfi at fileobj@#1}%
+ }%
+ }
+\ExplSyntaxOff
+
+\newcommand*{\attachfile at file}[2][]{%
+ \EdefUnescapeHex\atfi at filename{#2}%
+ \ifx\atfi at filename\ltx at empty
+ \PackageError{attachfile2}{Empty file name}\@ehc
+ \else
+ \@namedef{atfi at file@\atfi at filename}{#1}%
+ \fi
+}
+
+
+
+
+\def\atfi at attachfile#1#2{%
+ \atfi at setup{#1}%
+ \atfi at embedfile{#2}%
+
+ %\atfi at flags@to at int %flags are set in setup
+ \atfi at insert@file at annot{#2}%
+ \endgroup
+}
+
+\ExplSyntaxOn
+
+\def\atfi at textattachfile#1#2{%
+ \endgroup
+ \atfi at textattachfile@i{#1}{#2}%
+}
+\def\atfi at textattachfile@i#1#2#3{%
+ \atfi at setup{#1}%
+ \atfi at embedfile{#2}%
+ \atfi at set@appearance{%
+ \leavevmode
+ \begingroup
+ \HyColor at UseColor\atfi at color@tex
+ #3\strut
+ \endgroup
+ }%
+ %\atfi at flags@to at int
+ \atfi at insert@file at annot{#2}%
+ \endgroup
+}
+\DeclareRobustCommand{\attachfile}[2][]
+ {
+ \group_begin:
+ % keys #1
+ %\tl_to_str for #2?? file_name??
+ \atfi at attachfile{}{#2}%
+ \group_end
+ }
+
+\DeclareRobustCommand{\textattachfile}[3][]
+ {
+ \group_begin:
+ % keys #1
+ \atfi at textattachfile{#2}{#3}%
+ \group_end:
+ }
+
+\DeclareRobustCommand{\noattachfile}[1][]
+ {
+ \group_begin:
+ % key #1
+ \__atfi_annot_store_appearancebox: %????
+ \bool_if:NTF \l__atfi_annot_print_bool
+ {
+ \pdf_xform_use:n { atfi at appearancebox\l__atfi_annot_icon_tl } %icon, is use meant here??
+ }
+ {
+ \makebox[\atfi at appearancewidth]{}% \strut?
+ }
+ \group_end:
+ }
+
+%data for the icons
+
+
+%\cs_new_protected:Npn \__atfi_color_to_rgb_seq:nN #1 #2 % #1 name #2 seq
+% {
+% %\tl_set_eq:NN \l__color_ori_fixed_model_tl \l_color_fixed_model_tl
+% %\tl_set:Nn \l_color_fixed_model_tl {rgb}
+% %\color_parse:nN {#1}\l_tmpa_tl
+% \color_export:nnN {red}{space-sep-rgb}\l_tmpa_tl
+% \seq_set_split:NnV #2 { ~ }\l_tmpa_tl
+% %\seq_pop_left:NN #2 \l_tmpa_tl
+% %\tl_set_eq:NN \l_color_fixed_model_tl \l__color_ori_fixed_model_tl
+% }
+%\cs_generate_variant:Nn \__atfi_color_to_rgb_seq:nN {oN}
+%\cs_new:Npn \__atfi_arg_braced:n #1 {{#1}}
+
+\cs_new_protected:Npn \l__atfi_annot_icon_Graph_tl
+ {
+ \__draw_backend_scope_begin:
+ \__draw_backend_color_fill_gray:n {0.5}
+ \__draw_backend_rectangle:nnnn {1.1133bp}{0bp}{20.7202bp}{18.2754bp}
+ \__draw_backend_fill:
+ \__draw_backend_literal:x {0~i} %???
+ \__draw_backend_linewidth:n {0.5bp}
+ \__draw_backend_miterlimit:n {4bp}
+
+ \__draw_backend_color_fill_gray:n {1}
+ %\__draw_backend_color_stroke_gray:n {0}
+ \__draw_backend_rectangle:nnnn {0.25bp} {1.6453bp} {20.145bp} {17.7715bp}
+ \__draw_backend_fillstroke:
+
+ \__draw_backend_color_fill_gray:n {0}
+ \__draw_backend_rectangle:nnnn {2.7319bp}{4.1367bp}{3.9571bp}{13.8867bp}
+ \__draw_backend_fill:
+ \__draw_backend_rectangle:nnnn {8.7031bp}{4.1367bp}{3.9571bp}{9.8867bp}
+ \__draw_backend_fill:
+ \__draw_backend_rectangle:nnnn {14.7471bp}{4.1367bp}{3.9571bp}{11.8867bp}
+ \__draw_backend_fill:
+
+ \exp_args:No\color_export:nnN {\l__atfi_annot_color_tl}{space-sep-rgb}\l_tmpa_tl
+ \exp_args:No \__draw_backend_color_fill_rgb:n {\l_tmpa_tl}
+ \__draw_backend_rectangle:nnnn {1.689bp}{3.0938bp}{3.9571bp}{13.8867bp}
+ \__draw_backend_fill:
+ \__draw_backend_rectangle:nnnn {7.6602bp}{3.0938bp}{3.9571bp}{9.8867bp}
+ \__draw_backend_fill:
+ \__draw_backend_rectangle:nnnn {13.7041bp}{3.0938bp}{3.9571bp}{11.8867bp}
+ \__draw_backend_fill:
+ \__draw_backend_scope_end:
+ }
+
+\cs_new_protected:Npn {\l__atfi_annot_icon_Paperclip_tl}
+ {
+ \__draw_backend_scope_begin:
+ \__draw_backend_color_stroke_gray:n {0.75}
+ \__draw_backend_literal:x {0~i} %???
+ \__draw_backend_linewidth:n {2.5bp}
+ \__draw_backend_cap_round:
+ \__draw_backend_miterlimit:n {4}
+ \__draw_backend_moveto:nn {1.9619bp} {11.7559bp}
+ \__draw_backend_literal:x {1.9619~3.3037~1.9619~2.5059~v}
+ \__draw_backend_literal:x {1.9619~1.707~4.0947~1.25~y}
+ \__draw_backend_lineto:nn {7.4141bp} {1.25bp}
+ \__draw_backend_literal:x {9.4292~1.8223~9.4292~3.3066~v}
+ \__draw_backend_literal:x {9.4292~4.79~9.4292~16.8945~y}
+ \__draw_backend_literal:x {9.7852~18.1514~8.481~18.1514~v}
+ \__draw_backend_literal:x {7.1768~18.1514~5.1616~18.1514~y}
+ \__draw_backend_literal:x {3.8574~17.9209~3.8574~16.8945~v}
+ \__draw_backend_literal:x {3.8574~15.8652~3.8574~6.6172~y}
+ \__draw_backend_literal:x {4.3325~5.418~5.1025~5.418~v}
+ \__draw_backend_literal:x {5.8726~5.418~6.5845~5.418~y}
+ \__draw_backend_literal:x {7.6812~5.6455~7.6812~6.4736~v}
+ \__draw_backend_literal:x {7.6812~7.3027~7.6812~11.5264~y}
+ \__draw_backend_stroke:
+ \__draw_backend_color_stroke_gray:n {0}
+ \__draw_backend_moveto:nn {1.2495bp} {12.4404bp}
+ \__draw_backend_literal:x {1.2495~3.9883~1.2495~3.1895~v}
+ \__draw_backend_literal:x {1.2495~2.3906~3.3833~1.9326~y}
+ \__draw_backend_lineto:nn {6.7026bp}{1.9326bp}
+ \__draw_backend_literal:x {8.7178~2.5068~8.7178~3.9902~v}
+ \__draw_backend_literal:x {8.7178~5.4736~8.7178~17.5781~y}
+ \__draw_backend_literal:x {9.0732~18.834~7.769~18.834~v}
+ \__draw_backend_literal:x {6.4653~18.834~4.4497~18.834~y}
+ \__draw_backend_literal:x {3.146~18.6055~3.146~17.5781~v}
+ \__draw_backend_literal:x {3.146~16.5498~3.146~7.3018~y}
+ \__draw_backend_literal:x {3.6201~6.1016~4.3911~6.1016~v}
+ \__draw_backend_literal:x {5.1611~6.1016~5.873~6.1016~y}
+ \__draw_backend_literal:x {6.9692~6.3301~6.9692~7.1572~v}
+ \__draw_backend_literal:x {6.9692~7.9863~6.9692~12.21~y}
+ \__draw_backend_stroke:
+ \exp_args:No\color_export:nnN {\l__atfi_annot_color_tl}{space-sep-rgb}\l_tmpa_tl
+ \exp_args:No \__draw_backend_color_stroke_rgb:n {\l_tmpa_tl}
+ \__draw_backend_linewidth:n {1bp}
+ \__draw_backend_moveto:nn {1.2495bp} {12.4404bp}
+ \__draw_backend_literal:x {1.2495~3.9883~1.2495~3.1895~v}
+ \__draw_backend_literal:x {1.2495~2.3906~3.3833~1.9326~y}
+ \__draw_backend_lineto:nn {6.7026bp}{1.9326bp}
+ \__draw_backend_literal:x {8.7178~2.5068~8.7178~3.9902~v}
+ \__draw_backend_literal:x {8.7178~5.4736~8.7178~17.5781~y}
+ \__draw_backend_literal:x {9.0732~18.834~7.769~18.834~v}
+ \__draw_backend_literal:x {6.4653~18.834~4.4497~18.834~y}
+ \__draw_backend_literal:x {3.146~18.6055~3.146~17.5781~v}
+ \__draw_backend_literal:x {3.146~16.5498~3.146~7.3018~y}
+ \__draw_backend_literal:x {3.6201~6.1016~4.3911~6.1016~v}
+ \__draw_backend_literal:x {5.1611~6.1016~5.873~6.1016~y}
+ \__draw_backend_literal:x {6.9692~6.3301~6.9692~7.1572~v}
+ \__draw_backend_literal:x {6.9692~7.9863~6.9692~12.21~y}
+ \__draw_backend_stroke:
+ \__draw_backend_scope_end:
+ }
+
+
+
+\cs_new_protected:Npn \l__atfi_annot_icon_PushPin_tl
+ {
+ \__draw_backend_scope_begin:
+ \__draw_backend_linewidth:n {1bp}
+ \__draw_backend_moveto:nn {1bp} {6bp}
+ \__draw_backend_lineto:nn {11bp}{6bp}
+ \__draw_backend_lineto:nn {11bp}{13bp}
+ \__draw_backend_lineto:nn {12bp}{13bp}
+ \__draw_backend_lineto:nn {14bp}{11bp}
+ \__draw_backend_lineto:nn {21bp}{11bp}%
+ \__draw_backend_lineto:nn {22bp}{12bp}
+ \__draw_backend_lineto:nn {23bp}{12bp}
+ \__draw_backend_lineto:nn {23bp}{2bp}
+ \__draw_backend_lineto:nn {22bp}{2bp}
+ \__draw_backend_lineto:nn {21bp}{3bp}
+ \__draw_backend_lineto:nn {14bp}{3bp}
+ \__draw_backend_lineto:nn {12bp}{1bp}
+ \__draw_backend_lineto:nn {11bp}{1bp}
+ \__draw_backend_lineto:nn {11bp}{6bp}
+ \exp_args:No\color_export:nnN {\l__atfi_annot_color_tl}{space-sep-rgb}\l_tmpa_tl
+ \exp_args:No \__draw_backend_color_fill_rgb:n {\l_tmpa_tl}
+ \__draw_backend_color_stroke_gray:n {0}
+ \__draw_backend_fillstroke:
+ \__draw_backend_color_stroke_gray:n {0.5}
+ \__draw_backend_moveto:nn {0bp} {7bp}
+ \__draw_backend_lineto:nn {10bp}{7bp}
+ \__draw_backend_lineto:nn {10bp}{8bp}
+ \__draw_backend_lineto:nn {1bp}{8bp}
+ \__draw_backend_stroke:
+ \__draw_backend_color_stroke_gray:n {1}
+ \__draw_backend_moveto:nn {12bp} {12bp}
+ \__draw_backend_lineto:nn {14bp}{10bp}
+ \__draw_backend_lineto:nn {22bp}{10bp}
+ \__draw_backend_lineto:nn {22bp}{11bp}
+ \__draw_backend_stroke:
+ \__draw_backend_scope_end:
+ }
+
+\cs_new_protected:Npn \l__atfi_annot_icon_Tag_tl
+ {
+ \__draw_backend_scope_begin:
+ \__draw_backend_color_fill_gray:n {0.5}
+ \__draw_backend_moveto:nn {10.0542bp} {14.9873bp}
+ \__draw_backend_lineto:nn {24.27bp}{14.9873bp}
+ \__draw_backend_lineto:nn {25.252bp}{14.0059bp}
+ \__draw_backend_lineto:nn {25.252bp}{1.1455bp}
+ \__draw_backend_lineto:nn {24.1064bp}{0bp}
+ \__draw_backend_lineto:nn {9.9609bp}{0bp}
+ \__draw_backend_lineto:nn {6.0327bp}{6.0088bp}
+ \__draw_backend_lineto:nn {6.0327bp}{9.002bp}
+ \__draw_backend_lineto:nn {10.0542bp}{14.9873bp}
+ \__draw_backend_moveto:nn {9.3994bp} {9.376bp}
+ \__draw_backend_curveto:nnnnnn{8.5215bp}{9.376bp}{7.8096bp}{8.5596bp}{7.8096bp}{7.5527bp}
+ \__draw_backend_curveto:nnnnnn{7.8096bp}{6.5449bp}{8.5215bp}{5.7285bp}{9.3994bp}{5.7285bp}
+ \__draw_backend_curveto:nnnnnn{10.2778bp}{5.7285bp}{10.9897bp}{6.5449bp}{10.9897bp}{7.5527bp}
+ \__draw_backend_curveto:nnnnnn{10.9897bp}{8.5596bp}{10.2778bp}{9.376bp}{9.3994bp}{9.376bp}
+ \__draw_backend_closepath:
+ \__draw_backend_fill:
+ \__draw_backend_literal:x {0~i} %???
+ \__draw_backend_linewidth:n {0.5bp}
+ \__draw_backend_miterlimit:n {4}
+ \__draw_backend_join_round:
+ \__draw_backend_moveto:nn {8.5107bp} {16.5313bp}
+ \__draw_backend_lineto:nn {22.7266bp}{16.5313bp}
+ \__draw_backend_lineto:nn {23.7085bp}{15.5488bp}
+ \__draw_backend_lineto:nn {23.7085bp}{2.6895bp}
+ \__draw_backend_lineto:nn {22.563bp}{1.543bp}
+ \__draw_backend_lineto:nn {8.4175bp}{1.543bp}
+ \__draw_backend_lineto:nn {4.4893bp}{7.5527bp}
+ \__draw_backend_lineto:nn {4.4893bp}{10.5449bp}
+ \__draw_backend_lineto:nn {8.5107bp}{16.5313bp}
+ \__draw_backend_moveto:nn {7.856bp}{10.9199bp}
+ \__draw_backend_curveto:nnnnnn{6.978bp}{10.9199bp}{6.2661bp}{10.1035bp}{6.2661bp}{9.0957bp}
+ \__draw_backend_curveto:nnnnnn{6.2661bp}{8.0879bp}{6.978bp}{7.2715bp}{7.856bp}{7.2715bp}
+ \__draw_backend_curveto:nnnnnn{8.7344bp}{7.2715bp}{9.4463bp}{8.0879bp}{9.4463bp}{9.0957bp}
+ \__draw_backend_curveto:nnnnnn{9.4463bp}{10.1035bp}{8.7344bp}{10.9199bp}{7.856bp}{10.9199bp}
+ \__draw_backend_closepath:
+ \exp_args:No\color_export:nnN {\l__atfi_annot_color_tl}{space-sep-rgb}\l_tmpa_tl
+ \exp_args:No \__draw_backend_color_fill_rgb:n {\l_tmpa_tl}
+ \__draw_backend_color_stroke_gray:n {0}
+ \__draw_backend_fillstroke:
+ \__draw_backend_linewidth:n {1bp}
+ \__draw_backend_moveto:nn{12.3291bp}{12.2656bp}
+ \__draw_backend_lineto:nn{21.1206bp}{12.2656bp}
+ \__draw_backend_stroke:
+ \__draw_backend_moveto:nn{12.3291bp}{9.1797bp}
+ \__draw_backend_lineto:nn{21.1206bp}{9.1797bp}
+ \__draw_backend_stroke:
+ \__draw_backend_moveto:nn{12.3291bp}{6.1875bp}
+ \__draw_backend_lineto:nn{21.1206bp}{6.1875bp}
+ \__draw_backend_stroke:
+ \__draw_backend_linewidth:n {0.5bp}
+ \__draw_backend_moveto:nn{0bp}{9.0488bp}
+ \__draw_backend_lineto:nn{6.2661bp}{9.0957bp}
+ \__draw_backend_stroke:
+ \__draw_backend_moveto:nn {1.4028bp}{5.2148bp}
+ \__draw_backend_lineto:nn {1.4028bp}{9.6094bp}
+ \__draw_backend_literal:x {1.6831~10.6387~2.4316~10.6387~v}
+ \__draw_backend_literal:x {3.6475~10.6387~3.5542~9.0488~y}
+ \__draw_backend_stroke:
+ \__draw_backend_scope_end:
+ }
+
+\cs_new_protected:Npn \__atfi_annot_print_icon_Graph:
+ {
+ \raisebox{-1.5bp}
+ {
+ \parbox[b][20bp]{22bp}
+ {
+ \rule{0pt}{0pt}\l__atfi_annot_icon_Graph_tl
+ }
+ }
+ }
+
+\cs_new_protected:Npn \__atfi_annot_print_icon_Paperclip:
+ {
+ \raisebox{-1.25bp}
+ {
+ \parbox[b][21bp]{12bp}
+ {
+ \rule{0pt}{0pt}\l__atfi_annot_icon_Paperclip_tl
+ }
+ }
+ }
+
+\cs_new_protected:Npn \__atfi_annot_print_icon_PushPin:
+ {
+ \raisebox{-1.25bp}
+ {
+ \parbox[b][14bp]{24bp}
+ {
+ \rule{0pt}{0pt}\l__atfi_annot_icon_PushPin_tl
+ }
+ }
+ }
+
+
+\cs_new_protected:Npn \__atfi_annot_print_icon_Tag:
+ {
+ \raisebox{-1.6bp}
+ {
+ \parbox[b][17bp]{25bp}
+ {
+ \rule{0pt}{0pt}\l__atfi_annot_icon_Tag_tl
+ }
+ }
+ }
+
+
+\endinput
+%%
+%% End of file `new-attachfile.sty'.
diff --git a/newpackages/new-bookmark.sty b/newpackages/new-bookmark.sty
new file mode 100644
index 0000000..654e29f
--- /dev/null
+++ b/newpackages/new-bookmark.sty
@@ -0,0 +1,670 @@
+%%
+%% This is file `bookmark.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% bookmark.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Project: bookmark
+%% Version: 2019/12/03 v1.28
+%%
+%% Copyright (C)
+%% 2007-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://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 Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/bookmark/issues
+%%
+%%
+%% This work consists of the main source file bookmark.dtx
+%% and the derived files
+%% bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv,
+%% bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def,
+%% bkm-textures.def, bkm-pdftex.def, bkm-vtex.def,
+%% bookmark-example.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{new-bookmark}%
+ [2020-03-25 experimental version of v1.28 PDF bookmarks (HO)]%
+%etex is fine ...
+\def\BKM at CalcExpr#1#2#3#4{%
+ \edef#1{%
+ \the\numexpr#2#3#4\relax
+ }%
+ }%
+\def\BKM at EscapeName#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeName#1#1%
+ \fi
+}%
+\def\BKM at EscapeString#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeString#1#1%
+ \fi
+}%
+\def\BKM at EscapeHex#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeHex#1#1%
+ \fi
+}%
+\def\BKM at UnescapeHex#1{%
+ \EdefUnescapeHex#1#1%
+}%
+\RequirePackage{hyperref}[2010/06/18]
+\SetupKeyvalOptions{family=BKM,prefix=BKM@}
+\DeclareLocalOptions{%
+ atend,%
+ bold,%
+ color,%
+ depth,%
+ dest,%
+ draft,%
+ final,%
+ gotor,%
+ italic,%
+ keeplevel,%
+ level,%
+ named,%
+ numbered,%
+ open,%
+ openlevel,%
+ page,%
+ rawaction,%
+ rellevel,%
+ srcfile,%
+ srcline,%
+ startatroot,%
+ uri,%
+ view,%
+}
+\newcommand*{\bookmarksetup}{\kvsetkeys{BKM}}
+\def\BKM at setup#1{%
+ \bookmarksetup{#1}%
+ \ifx\BKM at HookNext\ltx at empty
+ \else
+ \expandafter\bookmarksetup\expandafter{\BKM at HookNext}%
+ \BKM at HookNextClear
+ \fi
+ \BKM at hook
+ \ifBKM at keeplevel
+ \else
+ \xdef\BKM at currentlevel{\BKM at level}%
+ \fi
+}
+\newcommand*{\bookmarksetupnext}[1]{%
+ \ltx at GlobalAppendToMacro\BKM at HookNext{,#1}%
+}
+\def\BKM at HookNextClear{%
+ \global\let\BKM at HookNext\ltx at empty
+}
+\BKM at HookNextClear
+\DeclareBoolOption{draft}
+\DeclareComplementaryOption{final}{draft}
+\def\BKM at DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{draft}%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{final}%
+}
+\DeclareBoolOption[\ifHy at bookmarksopen true\else false\fi]{open}
+\def\bookmark at open{%
+ \ifBKM at open\ltx at one\else\ltx at zero\fi
+}
+\DeclareStringOption[\maxdimen]{openlevel}
+\edef\BKM at openlevel{\number\@bookmarksopenlevel}
+\ltx at IfUndefined{Hy at bookmarksdepth}{%
+ \def\BKM at depth{\c at tocdepth}%
+}{%
+ \let\BKM at depth\Hy at bookmarksdepth
+}
+\define at key{BKM}{depth}[]{%
+ \edef\BKM at param{#1}%
+ \ifx\BKM at param\@empty
+ \def\BKM at depth{\c at tocdepth}%
+ \else
+ \ltx at IfUndefined{toclevel@\BKM at param}{%
+ \@onelevel at sanitize\BKM at param
+ \edef\BKM at temp{\expandafter\@car\BKM at param\@nil}%
+ \ifcase 0\expandafter\ifx\BKM at temp-1\fi
+ \expandafter\ifnum\expandafter`\BKM at temp>47 %
+ \expandafter\ifnum\expandafter`\BKM at temp<58 %
+ 1%
+ \fi
+ \fi
+ \relax
+ \PackageWarning{bookmark}{%
+ Unknown document division name (\BKM at param)\MessageBreak
+ for option `depth'%
+ }%
+ \else
+ \BKM at SetDepthOrLevel\BKM at depth\BKM at param
+ \fi
+ }{%
+ \BKM at SetDepthOrLevel\BKM at depth{%
+ \csname toclevel@\BKM at param\endcsname
+ }%
+ }%
+ \fi
+}
+\def\bookmark at depth{\BKM at depth}
+\def\BKM at SetDepthOrLevel#1#2{%
+ \begingroup
+ \setbox\z@=\hbox{%
+ \count@=#2\relax
+ \expandafter
+ }%
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{\the\count@}%
+}
+\DeclareStringOption[\BKM at currentlevel]{level}[\BKM at currentlevel]
+\define at key{BKM}{level}{%
+ \edef\BKM at param{#1}%
+ \ifx\BKM at param\BKM at MacroCurrentLevel
+ \let\BKM at level\BKM at param
+ \else
+ \ltx at IfUndefined{toclevel@\BKM at param}{%
+ \@onelevel at sanitize\BKM at param
+ \edef\BKM at temp{\expandafter\@car\BKM at param\@nil}%
+ \ifcase 0\expandafter\ifx\BKM at temp-1\fi
+ \expandafter\ifnum\expandafter`\BKM at temp>47 %
+ \expandafter\ifnum\expandafter`\BKM at temp<58 %
+ 1%
+ \fi
+ \fi
+ \relax
+ \PackageWarning{bookmark}{%
+ Unknown document division name (\BKM at param)\MessageBreak
+ for option `level'%
+ }%
+ \else
+ \BKM at SetDepthOrLevel\BKM at level\BKM at param
+ \fi
+ }{%
+ \BKM at SetDepthOrLevel\BKM at level{%
+ \csname toclevel@\BKM at param\endcsname
+ }%
+ }%
+ \fi
+}
+\def\BKM at MacroCurrentLevel{\BKM at currentlevel}
+\DeclareBoolOption{keeplevel}
+\DeclareBoolOption{startatroot}
+\def\BKM at startatrootfalse{%
+ \global\let\ifBKM at startatroot\iffalse
+}
+\def\BKM at startatroottrue{%
+ \global\let\ifBKM at startatroot\iftrue
+}
+\define at key{BKM}{rellevel}{%
+ \BKM at CalcExpr\BKM at level{#1}+\BKM at currentlevel
+}
+\def\bookmark at level{\BKM at level}
+\def\BKM at currentlevel{0}
+\DeclareBoolOption[%
+ \ifHy at bookmarksnumbered true\else false\fi
+]{numbered}
+\g at addto@macro\BKM at numberedtrue{%
+ \let\ifHy at bookmarksnumbered\iftrue
+}
+\g at addto@macro\BKM at numberedfalse{%
+ \let\ifHy at bookmarksnumbered\iffalse
+}
+\g at addto@macro\Hy at bookmarksnumberedtrue{%
+ \let\ifBKM at numbered\iftrue
+}
+\g at addto@macro\Hy at bookmarksnumberedfalse{%
+ \let\ifBKM at numbered\iffalse
+}
+\def\bookmark at numbered{%
+ \ifBKM at numbered\ltx at one\else\ltx at zero\fi
+}
+\def\BKM at PatchHyperrefOption#1{%
+ \expandafter\BKM@@PatchHyperrefOption\csname KV at Hyp@#1\endcsname%
+}
+\def\BKM@@PatchHyperrefOption#1{%
+ \expandafter\BKM@@@PatchHyperrefOption#1{##1}\BKM at nil#1%
+}
+\def\BKM@@@PatchHyperrefOption#1\BKM at nil#2#3{%
+ \def#2##1{%
+ #1%
+ \bookmarksetup{#3={##1}}%
+ }%
+}
+\BKM at PatchHyperrefOption{bookmarksopen}{open}
+\BKM at PatchHyperrefOption{bookmarksopenlevel}{openlevel}
+\BKM at PatchHyperrefOption{bookmarksdepth}{depth}
+\bitsetReset{BKM at FontStyle}%
+\define at key{BKM}{italic}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM at FontStyle}{0}%
+ \else
+ \bitsetClear{BKM at FontStyle}{0}%
+ \fi
+}%
+\define at key{BKM}{bold}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM at FontStyle}{1}%
+ \else
+ \bitsetClear{BKM at FontStyle}{1}%
+ \fi
+}%
+\def\bookmark at italic{%
+ \ifnum\bitsetGet{BKM at FontStyle}{0}=1 \ltx at one\else\ltx at zero\fi
+}
+\def\bookmark at bold{%
+ \ifnum\bitsetGet{BKM at FontStyle}{1}=1 \ltx at one\else\ltx at zero\fi
+}
+\def\BKM at PrintStyle{%
+ \bitsetGetDec{BKM at FontStyle}%
+}%
+\define at key{BKM}{color}{%
+ \HyColor at BookmarkColor{#1}\BKM at color{bookmark}{color}%
+}
+\let\BKM at color\@empty
+\def\bookmark at color{\BKM at color}
+\def\BKM at temp#1{%
+ \DeclareStringOption{#1}%
+ \expandafter\edef\csname bookmark@#1\endcsname{%
+ \expandafter\noexpand\csname BKM@#1\endcsname
+ }%
+}
+\BKM at temp{dest}
+\BKM at temp{named}
+\BKM at temp{uri}
+\BKM at temp{gotor}
+\BKM at temp{rawaction}
+\define at key{BKM}{page}{%
+ \def\BKM at page{#1}%
+ \ifx\BKM at page\@empty
+ \else
+ \edef\BKM at page{\number\BKM at page}%
+ \ifnum\BKM at page>\z@
+ \else
+ \PackageError{bookmark}{Page must be positive}\@ehc
+ \def\BKM at page{1}%
+ \fi
+ \fi
+}
+\let\BKM at page\@empty
+\def\bookmark at page{\BKM@@page}
+\define at key{BKM}{view}{%
+ \BKM at CheckView{#1}%
+}
+\let\BKM at view\@empty
+\def\bookmark at view{\BKM at view}
+\def\BKM at CheckView#1{%
+ \BKM at CheckViewType#1 \@nil
+}
+\def\BKM at CheckViewType#1 #2\@nil{%
+ \def\BKM at type{#1}%
+ \@onelevel at sanitize\BKM at type
+ \BKM at TestViewType{Fit}{}%
+ \BKM at TestViewType{FitB}{}%
+ \BKM at TestViewType{FitH}{%
+ \BKM at CheckParam#2 \@nil{top}%
+ }%
+ \BKM at TestViewType{FitBH}{%
+ \BKM at CheckParam#2 \@nil{top}%
+ }%
+ \BKM at TestViewType{FitV}{%
+ \BKM at CheckParam#2 \@nil{bottom}%
+ }%
+ \BKM at TestViewType{FitBV}{%
+ \BKM at CheckParam#2 \@nil{bottom}%
+ }%
+ \BKM at TestViewType{FitR}{%
+ \BKM at CheckRect{#2}{ }%
+ }%
+ \BKM at TestViewType{XYZ}{%
+ \BKM at CheckXYZ{#2}{ }%
+ }%
+ \@car{%
+ \PackageError{bookmark}{%
+ Unknown view type `\BKM at type',\MessageBreak
+ using `FitH' instead%
+ }\@ehc
+ \def\BKM at view{FitH}%
+ }%
+ \@nil
+}
+\def\BKM at TestViewType#1{%
+ \def\BKM at temp{#1}%
+ \@onelevel at sanitize\BKM at temp
+ \ifx\BKM at type\BKM at temp
+ \let\BKM at view\BKM at temp
+ \expandafter\@car
+ \else
+ \expandafter\@gobble
+ \fi
+}
+\def\BKM at CheckParam#1 #2\@nil#3{%
+ \def\BKM at param{#1}%
+ \ifx\BKM at param\@empty
+ \PackageWarning{bookmark}{%
+ Missing parameter (#3) for `\BKM at type',\MessageBreak
+ using 0%
+ }%
+ \def\BKM at param{0}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+}
+\def\BKM at CheckRect#1#2{%
+ \BKM@@CheckRect#1#2#2#2#2\@nil
+}
+\def\BKM@@CheckRect#1 #2 #3 #4 #5\@nil{%
+ \def\BKM at temp{0}%
+ \def\BKM at param{#1}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#2}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#3}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#4}%
+ \ifx\BKM at param\@empty
+ \def\BKM at param{0}%
+ \def\BKM at temp{1}%
+ \else
+ \BKM at CalcParam
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \ifnum\BKM at temp>\z@
+ \PackageWarning{bookmark}{Missing parameters for `\BKM at type'}%
+ \fi
+}
+\def\BKM at CheckXYZ#1#2{%
+ \BKM@@CheckXYZ#1#2#2#2\@nil
+}
+\def\BKM@@CheckXYZ#1 #2 #3 #4\@nil{%
+ \def\BKM at param{#1}%
+ \let\BKM at temp\BKM at param
+ \@onelevel at sanitize\BKM at temp
+ \ifx\BKM at param\@empty
+ \let\BKM at param\BKM at null
+ \else
+ \ifx\BKM at temp\BKM at null
+ \else
+ \BKM at CalcParam
+ \fi
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#2}%
+ \let\BKM at temp\BKM at param
+ \@onelevel at sanitize\BKM at temp
+ \ifx\BKM at param\@empty
+ \let\BKM at param\BKM at null
+ \else
+ \ifx\BKM at temp\BKM at null
+ \else
+ \BKM at CalcParam
+ \fi
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+ \def\BKM at param{#3}%
+ \ifx\BKM at param\@empty
+ \let\BKM at param\BKM at null
+ \fi
+ \edef\BKM at view{\BKM at view\space\BKM at param}%
+}
+\def\BKM at null{null}
+\@onelevel at sanitize\BKM at null
+\def\BKM at CalcParam{%
+ \begingroup
+ \let\calc\@firstofone
+ \expandafter\BKM@@CalcParam\BKM at param\@empty\@empty\@nil
+}
+\def\BKM@@CalcParam#1#2#3\@nil{%
+ \ifx\calc#1%
+ \@ifundefined{calc at assign@dimen}{%
+ \@ifundefined{dimexpr}{%
+ \setlength{\dimen@}{#2}%
+ }{%
+ \setlength{\dimen@}{\dimexpr#2\relax}%
+ }%
+ }{%
+ \setlength{\dimen@}{#2}%
+ }%
+ \dimen at .99626\dimen@
+ \edef\BKM at param{\strip at pt\dimen@}%
+ \expandafter\endgroup
+ \expandafter\def\expandafter\BKM at param\expandafter{\BKM at param}%
+ \else
+ \endgroup
+ \fi
+}
+\DeclareBoolOption{atend}
+\g at addto@macro\BKM at DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{atend}%
+}
+\newcommand*{\bookmarkdefinestyle}[2]{%
+ \@ifundefined{BKM at style@#1}{%
+ }{%
+ \PackageInfo{bookmark}{Redefining style `#1'}%
+ }%
+ \@namedef{BKM at style@#1}{#2}%
+}
+\define at key{BKM}{style}{%
+ \BKM at StyleCall{#1}%
+}
+\newif\ifBKM at ok
+\def\BKM at StyleCall#1{%
+ \@ifundefined{BKM at style@#1}{%
+ \PackageWarning{bookmark}{%
+ Ignoring unknown style `#1'%
+ }%
+ }{%
+ \BKM at oktrue
+ \edef\BKM at StyleCurrent{#1}%
+ \@onelevel at sanitize\BKM at StyleCurrent
+ \let\BKM at StyleEntry\BKM at StyleEntryCheck
+ \BKM at StyleStack
+ \ifBKM at ok
+ \expandafter\@firstofone
+ \else
+ \PackageError{bookmark}{%
+ Ignoring recursive call of style `\BKM at StyleCurrent'%
+ }\@ehc
+ \expandafter\@gobble
+ \fi
+ {%
+ \let\BKM at StyleEntry\relax
+ \edef\BKM at StyleStack{%
+ \BKM at StyleEntry{\BKM at StyleCurrent}%
+ \BKM at StyleStack
+ }%
+ \expandafter\expandafter\expandafter\bookmarksetup
+ \expandafter\expandafter\expandafter{%
+ \csname BKM at style@\BKM at StyleCurrent\endcsname
+ }%
+ \BKM at StyleStackPop
+ }%
+ }%
+}
+\def\BKM at StyleStackPop{%
+ \let\BKM at StyleEntry\relax
+ \edef\BKM at StyleStack{%
+ \expandafter\@gobbletwo\BKM at StyleStack
+ }%
+}
+\def\BKM at StyleEntryCheck#1{%
+ \def\BKM at temp{#1}%
+ \ifx\BKM at temp\BKM at StyleCurrent
+ \BKM at okfalse
+ \fi
+}
+\def\BKM at StyleStack{}
+\DeclareStringOption{srcline}
+\DeclareStringOption{srcfile}
+\def\BKM at hook{}
+\define at key{BKM}{addtohook}{%
+ \ltx at LocalAppendToMacro\BKM at hook{#1}%
+}
+\newcommand*{\bookmarkget}[1]{%
+ \romannumeral0%
+ \ltx at ifundefined{bookmark@#1}{%
+ \ltx at space
+ }{%
+ \expandafter\expandafter\expandafter\ltx at space
+ \csname bookmark@#1\endcsname
+ }%
+}
+\def\BKM at DefineDriverKey#1{%
+ \define at key{BKM}{#1}[]{%
+ \def\BKM at driver{#1}%
+ }%
+ \g at addto@macro\BKM at DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{#1}%
+ }%
+}
+\define at key{BKM}{dvipdfmx-outline-open}[true]{%
+ \expandafter\ifx\csname if#1\expandafter\endcsname
+ \csname iftrue\endcsname
+ \chardef\SpecialDvipdfmxOutlineOpen\@ne
+ \else
+ \chardef\SpecialDvipdfmxOutlineOpen\z@
+ \fi
+}
+\g at addto@macro\BKM at DisableOptions{%
+ \DisableKeyvalOption{BKM}{dvipdfmx-outline-open}%
+}
+\InputIfFileExists{bookmark.cfg}{}{}
+\ifpdf
+ \ifx\pdfoutline\@undefined
+ \ifx\pdfextension\@undefined\else
+ \protected\def\pdfoutline{\pdfextension outline }
+ \fi
+ \fi
+\fi
+\ProcessKeyvalOptions*
+\BKM at DisableOptions
+\ifBKM at draft
+ \PackageWarningNoLine{bookmark}{Draft mode on}%
+ \let\bookmarksetup\ltx at gobble
+ \let\BookmarkAtEnd\ltx at gobble
+ \let\bookmarkdefinestyle\ltx at gobbletwo
+ \let\bookmarkget\ltx at gobble
+ \let\pdfbookmark\ltx at undefined
+ \newcommand*{\pdfbookmark}[3][]{}%
+ \let\currentpdfbookmark\ltx at gobbletwo
+ \let\subpdfbookmark\ltx at gobbletwo
+ \let\belowpdfbookmark\ltx at gobbletwo
+ \newcommand*{\bookmark}[2][]{}%
+ \renewcommand*{\Hy at writebookmark}[5]{}%
+ \let\ReadBookmarks\relax
+ \let\BKM at DefGotoNameAction\ltx at gobbletwo % package `hypdestopt'
+ \expandafter\endinput
+\fi
+\newif\ifBKM at DvipdfmxOutlineOpen
+\ltx at IfUndefined{SpecialDvipdfmxOutlineOpen}{%
+ \ifxetex
+ \ifdim\number\XeTeXversion\XeTeXrevision in<0.9995in %
+ \else
+ \chardef\SpecialDvipdfmxOutlineOpen\ltx at one
+ \BKM at DvipdfmxOutlineOpentrue
+ \fi
+ \fi
+}{%
+ \ifnum\SpecialDvipdfmxOutlineOpen>\z@
+ \BKM at DvipdfmxOutlineOpentrue
+ \fi
+}
+
+\InputIfFileExists{bkm-generic.def}{}{}
+
+\let\pdfbookmark\ltx at undefined
+\newcommand*{\pdfbookmark}[3][0]{%
+ \bookmark[level=#1,dest={#3.#1}]{#2}%
+ \hyper at anchorstart{#3.#1}\hyper at anchorend
+}
+\def\currentpdfbookmark{%
+ \pdfbookmark[\BKM at currentlevel]%
+}
+\def\subpdfbookmark{%
+ \BKM at CalcExpr\BKM at CalcResult\BKM at currentlevel+1%
+ \expandafter\pdfbookmark\expandafter[\BKM at CalcResult]%
+}
+\def\belowpdfbookmark#1#2{%
+ \xdef\BKM at gtemp{\number\BKM at currentlevel}%
+ \subpdfbookmark{#1}{#2}%
+ \global\let\BKM at currentlevel\BKM at gtemp
+}
+\def\Hy at writebookmark#1#2#3#4#5{%
+ \ifnum#4>\BKM at depth\relax
+ \else
+ \def\BKM at type{#5}%
+ \ifx\BKM at type\Hy at bookmarkstype
+ \begingroup
+ \ifBKM at numbered
+ \let\numberline\Hy at numberline
+ \let\booknumberline\Hy at numberline
+ \let\partnumberline\Hy at numberline
+ \let\chapternumberline\Hy at numberline
+ \else
+ \let\numberline\@gobble
+ \let\booknumberline\@gobble
+ \let\partnumberline\@gobble
+ \let\chapternumberline\@gobble
+ \fi
+ \bookmark[level=#4,dest={#3}]{#2}%
+ \endgroup
+ \fi
+ \fi
+}
+\let\ReadBookmarks\relax
+\ifBKM at atend
+\else
+ \newcommand{\BookmarkAtEnd}[1]{%
+ \PackageWarning{bookmark}{%
+ Ignored, because option `atend' is missing%
+ }%
+ }%
+ \expandafter\endinput
+\fi
+\newcommand*{\BookmarkAtEnd}{%
+ \g at addto@macro\BKM at EndHook
+}
+\let\BKM at EndHook\@empty
+
+\endinput
+%%
+%% End of file `bookmark.sty'.
diff --git a/newpackages/new-hyperxmp.sty b/newpackages/new-hyperxmp.sty
new file mode 100644
index 0000000..04290e8
--- /dev/null
+++ b/newpackages/new-hyperxmp.sty
@@ -0,0 +1,110 @@
+%% This is file `new-hyperxmp.sty',
+% Copyright (C) 2019-2020 The LaTeX3 Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% https://www.latex-project.org/lppl.txt
+%
+% This file is part of the "pdfmanagement bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/pdfresources
+%
+% for those people who are interested.
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesPackage{new-hyperxmp}
+ [2021/02/09 v0.3 Store hyperref metadata in XMP format / testing pdfresource management ...UF]
+
+\RequirePackage{hyperxmp}
+
+\ExplSyntaxOn
+
+\cs_if_exist:NT \pdfmanagement_add:nnn
+ {
+ \pdfmanagement_if_active:T
+ {
+ \renewcommand\hyxmp at embed@packet{\hyxmp at embed@packet at generic}
+ }
+ }
+
+%
+\newcommand*{\hyxmp at embed@packet at generic}
+ {%
+ \typeout{}
+ \typeout{!!~new-hyperxmp--generic~packet~command~used!!}{}
+ \typeout{}
+ \hyxmp at construct@packet
+ %or some other command to write a object:
+ \exp_args:Nnx
+ \pdf_object_now:nn{stream}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp at xml}}%
+ % reference in the Catalog:
+ \pdfmanagement_add:nnx {Catalog} {Metadata}{\pdf_object_last:}
+ }
+
+\cs_new_protected:Npn \__hyxmp_get_metadata:
+ {
+ \clist_map_inline:nn
+ {
+ % hyperxmp keys:
+ ,pdfcopyright
+ ,pdftype
+ ,pdflicenseurl
+ ,pdfauthortitle
+ ,pdfcaptionwriter
+ ,pdfmetalang
+ ,pdfapart
+ ,pdfaconformance
+ ,pdfuapart
+ ,pdfxstandard
+ ,pdfsource
+ ,pdfdocumentid
+ ,pdfinstanceid
+ ,pdfversionid
+ ,pdfrendition
+ ,pdfpublication
+ ,pdfpubtype
+ ,pdfbytes
+ ,pdfnumpages
+ ,pdfissn
+ ,pdfeissn
+ ,pdfisbn
+ ,pdfbookedition
+ ,pdfpublisher
+ ,pdfvolumenum
+ ,pdfissuenum
+ ,pdfpagerange
+ ,pdfdoi
+ ,pdfurl
+ ,pdfidentifier
+ ,pdfsubtitle
+ ,pdfpubstatus
+ ,pdfcontactaddress
+ ,pdfcontactcity
+ ,pdfcontactregion
+ ,pdfcontactpostcode
+ ,pdfcontactcountry
+ ,pdfcontactphone
+ ,pdfcontactemail
+ ,pdfcontacturl
+ ,pdfdate
+ %hyperref
+ ,pdfauthor %??
+ ,pdftitle
+ ,pdfsubject
+ ,pdfkeywords
+ }
+ {\tl_set:cx {@##1}{\GetDocumentMetadata{hyp/##1}}}
+ }
+\AtEndDocument{\__hyxmp_get_metadata:}
+\ExplSyntaxOff
+\DeclareHookRule{enddocument}{newhyperxmp}{before}{hyperxmp}
+
+
+\endinput
diff --git a/newpackages/new-pdflscape.sty b/newpackages/new-pdflscape.sty
new file mode 100644
index 0000000..50f60df
--- /dev/null
+++ b/newpackages/new-pdflscape.sty
@@ -0,0 +1,54 @@
+%%
+%% This is file `new-pdflscape.sty',
+%%
+%% Project: new-pdflscape
+%% Version: 2020/11/18 v0.2
+%%
+%% Copyright (C) 2020 The LaTeX3 Project
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://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 Maintainers of this work are
+%% The LaTeX3 Project
+%%
+%%
+%% This work consists of the main source file new-lscape.sty
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesExplPackage {new-pdflscape}{2020/11/18}{v0.2}
+ {Display of landscape pages in PDF - UF}
+\RequirePackage{pdfmanagement}
+\RequirePackage{lscape}
+% this always turns in the same direction as pdflscape did too.
+% left and right would need
+% \pdfmanagement_add:nnn{ThisPage}{Rotate}{..}
+% on every page (e.g. in a shipout hook) and some option to control the wanted
+% orientation.
+\tl_new:N\g__pdflscape_saverotate_tl
+\hook_gput_code:nnn {env/landscape/begin}{pdflscape}
+ {
+ \pdfmanagement_get:nnN {Page}{Rotate}\l_tmpa_tl
+ \tl_gset_eq:NN\g__pdflscape_saverotate_tl\l_tmpa_tl
+ \clearpage
+ \pdfmanagement_add:nnn{Page}{Rotate}{90}
+ }
+\hook_gput_code:nnn {env/landscape/after}{pdflscape}
+ {
+ \quark_if_no_value:NTF\g__pdflscape_saverotate_tl
+ {\pdfmanagement_remove:nn{Page}{Rotate}}
+ {\pdfmanagement_add:nnx{Page}{Rotate}{\g__pdflscape_saverotate_tl}}
+ }
+
+\endinput
+%%
+%% End of file `new-pdflscape.sty'.
More information about the latex3-commits
mailing list.