[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: temporary l3ref style (b0587ca)

Ulrike Fischer fischer at troubleshooting-tex.de
Sat Dec 26 21:56:14 CET 2020


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/b0587ca34aa10c108e75c87a0b4e62f06e3f21ee

>---------------------------------------------------------------

commit b0587ca34aa10c108e75c87a0b4e62f06e3f21ee
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Dec 26 21:56:14 2020 +0100

    temporary l3ref style


>---------------------------------------------------------------

b0587ca34aa10c108e75c87a0b4e62f06e3f21ee
 l3ref-tmp.sty | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 121 insertions(+)

diff --git a/l3ref-tmp.sty b/l3ref-tmp.sty
new file mode 100644
index 0000000..1ea86d3
--- /dev/null
+++ b/l3ref-tmp.sty
@@ -0,0 +1,121 @@
+%%
+%% This is file `l3ref-tmp.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3ref.dtx  (with options: `package')
+%%
+%% Copyright (C) 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:
+%%
+%%    http://www.latex-project.org/lppl.txt
+%%
+%% This file is part of the "l3ref bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% File: l3ref.dtx
+\ProvidesExplPackage{l3ref-tmp}{2020-12-26}{}
+  {L3 Experimental cross-referencing -- temporary version!}
+\cs_new_protected:Npn \ref_attribute_gset:nnnn #1#2#3#4
+  {
+    \exp_args:Nx \__ref_attribute_gset:nnnn { \tl_to_str:n {#1} }
+      {#2} {#3} {#4}
+  }
+\cs_new_protected:Npn \__ref_attribute_gset:nnnn #1#2#3#4
+  {
+    \cs_gset:cpn { __ref_attribute_ #1 : } {#4}
+    \tl_gclear_new:c { g__ref_default_ #1 _tl }
+    \tl_gset:cn { g__ref_default_ #1 _tl } {#2}
+    \bool_if_exist:cF { g__ref_shipout_ #1 _tl }
+      { \bool_new:c { g__ref_shipout_ #1 _tl } }
+    \str_case:nnF {#3}
+      {
+        { now } { { \bool_gset_false:c { g__ref_shipout_ #1 _tl } } }
+        { shipout }
+          { \bool_gset_true:c { g__ref_shipout_ #1 _tl } }
+      }
+      { \msg_error:nnnn { ref } { unknown-setpoint } {#1} {#3} }
+  }
+\cs_new_protected:Npn \ref_label:nN #1#2
+  { \ref_label:nV {#1} #2 }
+\cs_new_protected:Npn \ref_label:nn #1#2
+  { \exp_args:Nx \__ref_label:nn { \tl_to_str:n {#1} } {#2} }
+\cs_generate_variant:Nn \ref_label:nn { nV }
+\cs_new_protected:Npn \__ref_label:nn #1#2
+  {
+    \legacy_if:nT { @filesw }
+      {
+        \iow_shipout_x:Nx \@auxout
+          {
+            \token_to_str:N \newlabeldata
+              {#1}
+              { \clist_map_function:nN {#2} \__ref_label_attribute:n }
+          }
+      }
+  }
+\cs_new:Npn \__ref_label_attribute:n #1
+  { \exp_args:Ne \__ref_label_attribute_aux:n { \tl_to_str:n {#1} } }
+\cs_new:Npn \__ref_label_attribute_aux:n #1
+  {
+    \cs_if_exist:cTF { __ref_attribute_ #1 : }
+      {
+        {#1}
+        {
+          \bool_if:cTF { g__ref_shipout_ #1 _tl }
+            { \exp_not:c }
+            { \use:c }
+              { __ref_attribute_ #1 : }
+        }
+      }
+      { \msg_expandable_error:nnn { ref } { attribute-not-defined } {#1} }
+  }
+\cs_new:Npn \ref_value:nn #1#2
+  {
+    \exp_args:Nee \__ref_value:nn { \tl_to_str:n {#1} } { \tl_to_str:n {#2} }
+  }
+\cs_new:Npn \__ref_value:nn #1#2
+  {
+    \tl_if_exist:cTF { g__ref_label_ #1 _ #2 _tl }
+      { \tl_use:c { g__ref_label_ #1 _ #2 _tl } }
+      {
+        \tl_if_exist:cTF { g__ref_default_ #2 _tl }
+          { \tl_use:c { g__ref_default_ #2 _tl } }
+          { \exp_not:n { \textbf { ?? } } }
+      }
+  }
+\cs_new_protected:Npn \newlabeldata #1#2
+  {
+    \__ref_data:nnn {#1} #2 { \q_recursion_tail } { ? } \q_recursion_stop
+  }
+\cs_new_protected:Npn \__ref_data:nnn #1#2#3
+  {
+    \quark_if_recursion_tail_stop:n {#2}
+    \tl_gclear_new:c { g__ref_label_ #1 _ #2 _tl }
+    \tl_gset:cn { g__ref_label_ #1 _ #2 _tl } {#3}
+    \__ref_data:nnn {#1}
+  }
+\ref_attribute_gset:nnnn { abspage } { 0 } { shipout }
+  { \int_use:N \g_shipout_readonly_int }
+\ref_attribute_gset:nnnn { page } { 0 } { shipout } { \thepage }
+\clist_new:N \g_ref_main_clist
+\clist_gput_right:Nn \g_ref_main_clist { page }
+\msg_new:nnnn { ref } { attribute-not-defined }
+  { Attribute~'#1'~not~defined. }
+  {
+    LaTeX~has~been~asked~to~use~attribute~'#1',~but~this~
+    name~has~not~been~defined.
+  }
+\msg_new:nnnn { ref } { unknown-setpoint }
+  { Unknown~keyword~'#3'~for~setting~attribute~'#1'. }
+  {
+    LaTeX~has~been~asked~to~set~the~attribute~'#1',~but~the~keyword~
+    '#3'~is~not~one~of~the~two~known~values:~'now'~or~'shipout'.
+  }
+%%
+%%
+%% End of file `l3ref.sty'.





More information about the latex3-commits mailing list.