texlive[73596] Master/texmf-dist: citation-style-language (25jan25)

commits+karl at tug.org commits+karl at tug.org
Sat Jan 25 22:22:52 CET 2025


Revision: 73596
          https://tug.org/svn/texlive?view=revision&revision=73596
Author:   karl
Date:     2025-01-25 22:22:52 +0100 (Sat, 25 Jan 2025)
Log Message:
-----------
citation-style-language (25jan25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/citation-style-language/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/citation-style-language/citation-style-language-doc.pdf
    trunk/Master/texmf-dist/doc/latex/citation-style-language/citation-style-language-doc.tex
    trunk/Master/texmf-dist/doc/man/man1/citeproc-lua.1
    trunk/Master/texmf-dist/doc/man/man1/citeproc-lua.man1.pdf
    trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-engine.lua
    trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-manager.lua
    trunk/Master/texmf-dist/scripts/citation-style-language/citeproc.lua
    trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty
    trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty
    trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty
    trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty
    trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty
    trunk/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl

Modified: trunk/Master/texmf-dist/doc/latex/citation-style-language/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/citation-style-language/CHANGELOG.md	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/doc/latex/citation-style-language/CHANGELOG.md	2025-01-25 21:22:52 UTC (rev 73596)
@@ -7,6 +7,12 @@
 
 ## [Unreleased]
 
+## [0.6.8] - 2025-01-25
+
+### Fixed
+
+- Fix links to excluded entries in bibliography ([#82](https://github.com/zepinglee/citeproc-lua/issues/82)).
+
 ## [0.6.7] - 2025-01-10
 
 ### Added
@@ -265,7 +271,8 @@
 
 - Initial CTAN release.
 
-[Unreleased]: https://github.com/zepinglee/citeproc-lua/compare/v0.6.7...HEAD
+[Unreleased]: https://github.com/zepinglee/citeproc-lua/compare/v0.6.8...HEAD
+[0.6.8]: https://github.com/zepinglee/citeproc-lua/compare/v0.6.7...v0.6.8
 [0.6.7]: https://github.com/zepinglee/citeproc-lua/compare/v0.6.6...v0.6.7
 [0.6.6]: https://github.com/zepinglee/citeproc-lua/compare/v0.6.5...v0.6.6
 [0.6.5]: https://github.com/zepinglee/citeproc-lua/compare/v0.6.4...v0.6.5

Modified: trunk/Master/texmf-dist/doc/latex/citation-style-language/citation-style-language-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/citation-style-language/citation-style-language-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/citation-style-language/citation-style-language-doc.tex	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/doc/latex/citation-style-language/citation-style-language-doc.tex	2025-01-25 21:22:52 UTC (rev 73596)
@@ -51,7 +51,7 @@
   }%
 }
 
-\date{2025-01-10 v0.6.7}
+\date{2025-01-25 v0.6.8}
 
 \maketitle
 

Modified: trunk/Master/texmf-dist/doc/man/man1/citeproc-lua.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/citeproc-lua.1	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/doc/man/man1/citeproc-lua.1	2025-01-25 21:22:52 UTC (rev 73596)
@@ -1,4 +1,4 @@
-.TH citeproc-lua 1 "0.6.7"
+.TH citeproc-lua 1 "0.6.8"
 .SH NAME
 citeproc-lua \- make CSL citations and bibliography for LaTeX
 .SH SYNOPSIS

Modified: trunk/Master/texmf-dist/doc/man/man1/citeproc-lua.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-engine.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-engine.lua	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-engine.lua	2025-01-25 21:22:52 UTC (rev 73596)
@@ -468,8 +468,9 @@
   self.registry.maxoffset = 0
 
   local ids = self:_get_sorted_refs()
+  local excluded_ids
   if bibsection then
-    ids = self:_filter_with_bibsection(ids, bibsection)
+    ids, excluded_ids = self:_filter_with_bibsection(ids, bibsection)
   end
   for _, id in ipairs(ids) do
     local str = self.style.bibliography:build_bibliography_str(id, self)
@@ -494,7 +495,8 @@
     widest_label = self.registry.widest_label,
     bibstart = bib_start,
     bibend = bib_end,
-    entry_ids = util.clone(self.registry.reflist),
+    entry_ids = ids,
+    excluded_ids = excluded_ids,
   }
 
   return {params, res}
@@ -945,6 +947,10 @@
   return self.registry.reflist
 end
 
+--- at param ids CiteId[]
+--- at param bibsection any
+--- at return CiteId[]
+--- at return CiteId[]
 function CiteProc:_filter_with_bibsection(ids, bibsection)
   if bibsection.quash then
     return self:filter_quash(ids, bibsection)
@@ -955,7 +961,7 @@
   elseif bibsection.exclude then
     return self:filter_exclude(ids, bibsection)
   else
-    return ids
+    return ids, {}
   end
 end
 
@@ -994,6 +1000,7 @@
 function CiteProc:filter_select(ids, bibsection)
   -- Include the item if, and only if, all of the objects match.
   local res = {}
+  local excluded_ids = {}
   for _, id in ipairs(ids) do
     local item = self.registry.registry[id]
     local match = true
@@ -1005,14 +1012,17 @@
     end
     if match then
       table.insert(res, id)
+    else
+      table.insert(excluded_ids, id)
     end
   end
-  return res
+  return res, excluded_ids
 end
 
 function CiteProc:filter_include(ids, bibsection)
   -- Include the item if any of the objects match.
   local res = {}
+  local excluded_ids = {}
   for _, id in ipairs(ids) do
     local item = self.registry.registry[id]
     local match = false
@@ -1024,14 +1034,17 @@
     end
     if match then
       table.insert(res, id)
+    else
+      table.insert(excluded_ids, id)
     end
   end
-  return res
+  return res, excluded_ids
 end
 
 function CiteProc:filter_exclude(ids, bibsection)
   -- Include the item if none of the objects match.
   local res = {}
+  local excluded_ids = {}
   for _, id in ipairs(ids) do
     local item = self.registry.registry[id]
     local match = false
@@ -1043,14 +1056,17 @@
     end
     if not match then
       table.insert(res, id)
+    else
+      table.insert(excluded_ids, id)
     end
   end
-  return res
+  return res, excluded_ids
 end
 
 function CiteProc:filter_quash(ids, bibsection)
   -- Skip the item if all of the objects match.
   local res = {}
+  local excluded_ids = {}
   for _, id in ipairs(ids) do
     local item = self.registry.registry[id]
     local match = true
@@ -1062,9 +1078,11 @@
     end
     if not match then
       table.insert(res, id)
+    else
+      table.insert(excluded_ids, id)
     end
   end
-  return res
+  return res, excluded_ids
 end
 
 function CiteProc:set_output_format(format)

Modified: trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-manager.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-manager.lua	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/scripts/citation-style-language/citeproc-manager.lua	2025-01-25 21:22:52 UTC (rev 73596)
@@ -782,6 +782,8 @@
     ["entry-spacing"] = "entryspacing",
     ["line-spacing"] = "linespacing",
     ["widest-label"] = "widest_label",
+    ["entry-ids"] = "entry_ids",
+    ["excluded-ids"] = "excluded_ids",
   }
   local bib_option_order = {
     "index",
@@ -790,8 +792,21 @@
     "line-spacing",
     "entry-spacing",
     "widest-label",
+    -- "entry-ids",
+    -- "excluded-ids",
   }
 
+  local bib_lines = {}
+
+  if #params.entry_ids > 0 then
+    local entry_ids_line = string.format("\\csloptions{%d}{entry-ids = {%s}}", self.ref_section.index, table.concat(params.entry_ids, ", "))
+    table.insert(bib_lines, entry_ids_line)
+  end
+  if #params.excluded_ids > 0 then
+    local excluded_ids_line = string.format("\\csloptions{%d}{excluded-ids = {%s}}", self.ref_section.index, table.concat(params.excluded_ids, ", "))
+    table.insert(bib_lines, excluded_ids_line)
+  end
+
   for option, param in pairs(bib_option_map) do
     if params[param] then
       bib_options[option] = params[param]
@@ -801,14 +816,20 @@
   local bib_option_list = {}
   for _, option in ipairs(bib_option_order) do
     local value = bib_options[option]
-    if value and value ~= "" then
-      table.insert(bib_option_list, string.format("%s = %s", option, tostring(value)))
+    if value then
+      if type(value) == "table" then
+        value = "{" .. table.concat(value, ", ") .. "}"
+      else
+        value = tostring(value)
+      end
+      if value ~= "" then
+        table.insert(bib_option_list, string.format("%s = %s", option, value))
+      end
     end
   end
   local bib_options_str = table.concat(bib_option_list, ", ")
 
   local bibstart = string.format("\\begin{thebibliography}{%s}\n", bib_options_str)
-  local bib_lines = {}
   table.insert(bib_lines, bibstart)
 
   for _, bib_item in ipairs(bib_items) do

Modified: trunk/Master/texmf-dist/scripts/citation-style-language/citeproc.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/citation-style-language/citeproc.lua	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/scripts/citation-style-language/citeproc.lua	2025-01-25 21:22:52 UTC (rev 73596)
@@ -17,7 +17,7 @@
   util = require("citeproc.util")
 end
 
-citeproc.__VERSION__ = "0.6.7"
+citeproc.__VERSION__ = "0.6.8"
 
 citeproc.new = engine.CiteProc.new
 citeproc.util = util

Modified: trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty	2025-01-25 21:22:52 UTC (rev 73596)
@@ -101,10 +101,6 @@
   }
 
 
-% Used for debugging and testing
-\clist_new:N \g__csl_bib_items_clist
-
-
 \cs_new:Npn \__csl_write_aux_bibliography:n #1
   {
     \if at filesw
@@ -126,7 +122,7 @@
 \bool_new:N \l__csl_second_field_align_margin_bool
 \tl_new:N \l__csl_line_spacing_tl
 \tl_new:N \l__csl_entry_spacing_tl
-\tl_new:N \l__csl_bib_wides_label_tl
+\tl_new:N \l__csl_bib_widest_label_tl
 
 \keys_define:nn { csl / bib-options }
   {
@@ -150,7 +146,7 @@
     hanging-indent .bool_set:N = \l__csl_hanging_indent_bool ,
     line-spacing   .tl_set:N   = \l__csl_line_spacing_tl ,
     entry-spacing  .tl_set:N   = \l__csl_entry_spacing_tl ,
-    widest-label   .tl_set:N   = \l__csl_bib_wides_label_tl ,
+    widest-label   .tl_set:N   = \l__csl_bib_widest_label_tl ,
   }
 
 \keys_set:nn { csl / bib-options }
@@ -176,7 +172,7 @@
       \l__csl_bib_font_tl
       \list { }
         {
-          \__csl_set_bib_label_spacing:n { \l__csl_bib_wides_label_tl }
+          \__csl_set_bib_label_spacing:n { \l__csl_bib_widest_label_tl }
           \__csl_set_bib_item_sep:
         }
       \sloppy
@@ -183,7 +179,6 @@
       \__csl_set_bib_page_break:
       \frenchspacing
       \__csl_bib_url_setup:
-      \clist_gclear:N \g__csl_bib_items_clist
   }
   {
       \tl_set:Nn \@noitemerr
@@ -268,7 +263,6 @@
 
 \cs_new:Npn \__csl_lbibitem_plain:nn [#1]#2
   {
-    \clist_gput_right:Nn \g__csl_bib_items_clist {#2}
     \item [ \@biblabel {#1} \hfill ]
     \ignorespaces
   }
@@ -341,7 +335,6 @@
 
 \cs_new:Npn \__csl_bibitem_plain:n #1
   {
-    \clist_gput_right:Nn \g__csl_bib_items_clist {#1}
     \item
     \ignorespaces
   }
@@ -436,6 +429,7 @@
       {
         \__csl_get_style_class:
       }
+    \__csl_read_entry_ids:
   }
 
 \cs_set_eq:NN \newrefsection \refsection
@@ -446,6 +440,7 @@
       \int_gzero:N \g__csl_ref_section_index_int
       \sys_if_engine_luatex:T
         { \lua_now:n { csl_citation_manager:end_ref_section() } }
+      \__csl_read_entry_ids:
     }
 }
 

Modified: trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty	2025-01-25 21:22:52 UTC (rev 73596)
@@ -373,12 +373,11 @@
 
 \tl_new:N \l__csl_back_ref_tl
 \prop_new:N \g__csl_back_ref_info_prop
-\prop_new:N \l__csl_back_ref_section_pop
 
 % Provide empty \@currentHref when hyperref is not loaded.
 % LaTeX2e 2023-06-01 defines `\@currentHref` in the kernel.
 \cs_if_exist:NF \@currentHref
-  { \cs_new:Npn \@currentHref {} }
+  { \cs_new:Npn \@currentHref { } }
 
 % TODO: write backref info to .brf file or .aux file
 \cs_new:Npn \__csl_add_back_ref_info:
@@ -602,7 +601,7 @@
   {
     \G at refundefinedtrue
     % The warning message is read by latexmk.
-    \@latex at warning {Citation~ `#1'~ on~ page~ \thepage \space undefined}
+    \@latex at warning { Citation~ `#1'~ on~ page~ \thepage \space undefined }
   }
 
 
@@ -660,7 +659,7 @@
 
 % Used in aux files to register cite items.
 % #1: a citation object
-\cs_set:Npn \csl at aux@cite #1#2
+\cs_new:Npn \csl at aux@cite #1#2
   {
     \sys_if_engine_luatex:T
       { \lua_now:e { csl_citation_manager:register_citation_info(#1, "\lua_escape:n {#2}") } }

Modified: trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty	2025-01-25 21:22:52 UTC (rev 73596)
@@ -97,15 +97,53 @@
 
 % ### `hyperref`
 
-\cs_set:Npn \__csl_hyperref_cite_item:nn #1#2
+% The hyperref package also patches \bibcite but it cannot provide hyperlinks
+% when used with csl.
+\bool_new:N \l__csl_hyperref_loaded_bool
+\hook_gput_code:nnn { package / hyperref / after } { . }
   {
-    \hyper@@link [ cite ] { }
-      { cite \int_use:N \g__csl_ref_section_index_int . #1 \@extra at b@citeb } { #2 }
+    \bool_set_true:N \l__csl_hyperref_loaded_bool
+    % Pakcage "hyperref" redefines \@lbibitem and \bibitem and we need to
+    % recover them.
+    % In non-implicit mode (e.g., loaded by `beamer`), hyperref stops early
+    % (`\MaybeStopEarly`) and it doesn't redefine the cite internal commands.
+    \cs_if_exist:NT \@extra at b@citeb
+      {
+        \cs_gset_eq:NN \cslcite \__csl_hyperref_cite_item:nn
+        \cs_gset_eq:NN \@lbibitem \__csl_lbibitem:
+        \cs_gset_eq:NN \@bibitem \__csl_bibitem:
+        \cs_gset_eq:NN \__csl_lbibitem_plain:nn \__csl_hyperref_lbibitem:nn
+        \cs_gset_eq:NN \__csl_bibitem_plain:n \__csl_hyperref_bibitem:n
+        \cs_gset_eq:NN \__csl_process_entry_ids:n \__csl_hyperref_process_entry_ids:n
+        \cs_gset_eq:NN \__csl_process_excluded_ids:n \__csl_hyperref_process_excluded_ids:n
+        \cs_gset_eq:NN \__csl_read_entry_ids: \__csl_hyperref_read_entry_ids:
+      }
   }
 
+\clist_new:N \l__csl_ref_section_entry_ids_clist
+\clist_new:N \l__csl_ref_section_excluded_ids_clist
+
+\cs_new:Npn \__csl_hyperref_cite_item:nn #1#2
+  {
+    % \clist_show:N \l__csl_ref_section_excluded_ids_clist
+    % \clist_show:N \l__csl_ref_section_entry_ids_clist
+    \clist_if_in:NnTF \l__csl_ref_section_excluded_ids_clist {#1}
+      {
+        \clist_if_in:NnTF \l__csl_ref_section_entry_ids_clist {#1}
+          {
+            \hyper@@link [ cite ] { }
+              { cite \int_use:N \g__csl_ref_section_index_int . #1 \@extra at b@citeb } {#2}
+          }
+          {#2}
+      }
+      {
+        \hyper@@link [ cite ] { }
+          { cite \int_use:N \g__csl_ref_section_index_int . #1 \@extra at b@citeb } {#2}
+      }
+  }
+
 \cs_new:Npn \__csl_hyperref_lbibitem:nn [#1]#2
   {
-    \clist_gput_right:Nn \g__csl_bib_items_clist {#2}
     \@skiphyperreftrue
     \H at item
       [
@@ -131,7 +169,6 @@
 
 \cs_new:Npn \__csl_hyperref_bibitem:n #1
   {
-    \clist_gput_right:Nn \g__csl_bib_items_clist {#1}
     \@skiphyperreftrue \H at item \@skiphyperreffalse
     \Hy at raisedlink
       {
@@ -143,27 +180,78 @@
     \ignorespaces
   }
 
-% The hyperref package also patches \bibcite but it cannot provide hyperlinks
-% when used with csl.
-\bool_new:N \l__csl_hyperref_loaded_bool
-\hook_gput_code:nnn { package / hyperref / after } { . }
+\prop_new:N \g__csl_entry_ids_prop
+\prop_new:N \g__csl_excluded_ids_prop
+
+\cs_new:Npn \__csl_hyperref_process_entry_ids:n #1
   {
-    \bool_set_true:N \l__csl_hyperref_loaded_bool
-    % Pakcage "hyperref" redefines \@lbibitem and \bibitem and we need to
-    % recover them.
-    % In non-implicit mode (e.g., loaded by `beamer`), hyperref stops early
-    % (`\MaybeStopEarly`) and it doesn't redefine the cite internal commands.
-    \cs_if_exist:NT \@extra at b@citeb
+    \sys_if_engine_luatex:TF
       {
-        \cs_gset_eq:NN \@lbibitem \__csl_lbibitem:
-        \cs_gset_eq:NN \@bibitem \__csl_bibitem:
-        \cs_gset_eq:NN \__csl_lbibitem_plain:nn \__csl_hyperref_lbibitem:nn
-        \cs_gset_eq:NN \__csl_bibitem_plain:n \__csl_hyperref_bibitem:n
-        \cs_gset_eq:NN \cslcite \__csl_hyperref_cite_item:nn
+        \__csl_if_preamble:TF
+          {
+            % From `\csl at aux@options` commands in the `.aux` file
+            \exp_args:NNV \__csl_append_entry_ids:Nnn \g__csl_entry_ids_prop
+              \l__csl_ref_section_index_tl {#1}
+          }
+          {
+            % From `\csloptions` commands via `\printbibliography`
+            \__csl_write_aux_options:n { entry-ids = {#1} }
+          }
       }
+      {
+        % Read by `\csloptions` commands from the `.bbl` file
+        \exp_args:NNV \__csl_append_entry_ids:Nnn \g__csl_entry_ids_prop
+          \l__csl_ref_section_index_tl {#1}
+      }
   }
 
+\cs_new:Npn \__csl_hyperref_process_excluded_ids:n #1
+  {
+    \sys_if_engine_luatex:TF
+      {
+        \__csl_if_preamble:TF
+          {
+            % From `\csl at aux@options` commands in the `.aux` file
+            \exp_args:NNV \__csl_append_entry_ids:Nnn \g__csl_excluded_ids_prop
+              \l__csl_ref_section_index_tl {#1}
+          }
+          {
+            % From `\csloptions` commands via `\printbibliography`
+            \__csl_write_aux_options:n { excluded-ids = {#1} }
+          }
+      }
+      {
+        % Read by `\csloptions` commands from the `.bbl` file
+        \exp_args:NNV \__csl_append_entry_ids:Nnn \g__csl_excluded_ids_prop
+          \l__csl_ref_section_index_tl {#1}
+      }
+  }
 
+\cs_new:Npn \__csl_append_entry_ids:Nnn #1#2#3
+  {
+    \clist_clear:N \l_tmpa_clist
+    \prop_get:NnNT #1 {#2} \l_tmpa_tl
+      { \clist_set:NV \l_tmpa_clist \l_tmpa_tl }
+    \clist_map_inline:nn {#3}
+      {
+        \clist_if_in:NnF \l_tmpa_clist {##1}
+          { \clist_put_right:Nn \l_tmpa_clist {##1} }
+      }
+    \prop_gput:Nne #1 {#2}
+      { \clist_use:Nn \l_tmpa_clist { , } }
+  }
+
+\cs_new:Npn \__csl_hyperref_read_entry_ids:
+  {
+    \prop_get:NeNT \g__csl_entry_ids_prop
+      { \int_use:N \g__csl_ref_section_index_int } \l_tmpa_tl
+      { \clist_set:NV \l__csl_ref_section_entry_ids_clist \l_tmpa_tl }
+    \prop_get:NeNT \g__csl_excluded_ids_prop
+      { \int_use:N \g__csl_ref_section_index_int } \l_tmpa_tl
+      { \clist_set:NV \l__csl_ref_section_excluded_ids_clist \l_tmpa_tl }
+  }
+
+
 % ### `perpage`
 
 \hook_gput_code:nnn { package / perpage / after } { . }

Modified: trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty	2025-01-25 21:22:52 UTC (rev 73596)
@@ -18,6 +18,7 @@
         \__csl_load_bbl:
         \__csl_get_style_class:
       }
+    \__csl_read_entry_ids:
     \__csl_set_ref_section_level:
   }
 
@@ -138,8 +139,6 @@
 }
 
 
-\clist_new:N \l__csl_options_clist
-
 \bool_new:N \l__csl_engine_initialized_bool
 
 \prop_new:N \l__csl_language_code_map_prop
@@ -263,7 +262,7 @@
 
 \cs_new:Npn \__csl_write_aux_csl_options:
   {
-    \clist_clear:N \l__csl_options_clist
+    \clist_clear:N \l_tmpa_clist  % list of options to write to aux file
     % locale
     \tl_if_empty:NT \l__csl_locale_tl
       {
@@ -275,18 +274,18 @@
       }
     \tl_if_empty:NF \l__csl_locale_tl
       {
-        \clist_put_right:Ne \l__csl_options_clist
+        \clist_put_right:Ne \l_tmpa_clist
           { locale = \l__csl_locale_tl }
       }
     % linking
     \@ifpackageloaded { hyperref }
-      { \clist_put_right:Nn \l__csl_options_clist { linking = true } }
+      { \clist_put_right:Nn \l_tmpa_clist { linking = true } }
       { }
     % write to aux file
-    \prop_if_empty:NF \l__csl_options_clist
+    \prop_if_empty:NF \l_tmpa_clist
       {
         \exp_args:Ne \__csl_write_aux_options:n
-          { \clist_use:Nn \l__csl_options_clist { , } }
+          { \clist_use:Nn \l_tmpa_clist { , } }
       }
   }
 
@@ -301,9 +300,15 @@
     \fi
   }
 
-\cs_new:Npn \csl at aux@options #1#2 { }
+\tl_new:N \l__csl_ref_section_index_tl
 
+\cs_new:Npn \csl at aux@options #1#2
+  {
+    \tl_set:Nn \l__csl_ref_section_index_tl {#1}
+    \keys_set:nn { csl / options } {#2}
+  }
 
+
 % Load .bbl at the beginning of document to save one pass of latex.
 % In this procedure, the \cslcitation command is processed and the contents
 % of `thebibliography` is stored into \g__csl_bibliographies_prop.
@@ -349,7 +354,10 @@
 % #1: refsection index
 % #2: refsection options
 \NewDocumentCommand \csloptions { m m }
-  { \keys_set:nn { csl / options } { #2 } }
+  {
+    \tl_set:Nn \l__csl_ref_section_index_tl {#1}
+    \keys_set:nn { csl / options } {#2}
+  }
 
 % The class option is in the `<style>=<class>` form
 % (e.g. `\csloptions{class={apa=in-text}}`).
@@ -356,8 +364,15 @@
 \keys_define:nn { csl / options }
   {
     class .code:n = { \prop_gput_from_keyval:Nn \g__csl_style_class_prop {#1} },
+    entry-ids .code:n = { \__csl_process_entry_ids:n {#1} } ,
+    excluded-ids .code:n = { \__csl_process_excluded_ids:n {#1} } ,
+    unknown .code:n = { } ,
   }
 
+\cs_new:Npn \__csl_process_entry_ids:n #1 { }
+
+\cs_new:Npn \__csl_process_excluded_ids:n #1 { }
+
 \prop_new:N \g__csl_style_class_prop
 
 % The `\textcite` bahaves differently with note styles.
@@ -424,6 +439,9 @@
 % \msg_new:nnn { citation-style-language } { file-non-exist }
 %   { No~ file~ #1. }
 
+% This is a hook for `hyperref`.
+\cs_new:Npn \__csl_read_entry_ids: {}
+
 \cs_new:Npn \__csl_set_ref_section_level:
   {
     \str_case:Vn \l__csl_bib_ref_section_str

Modified: trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty	2025-01-25 21:22:52 UTC (rev 73596)
@@ -9,7 +9,7 @@
 \RequirePackage{expl3}
 \RequirePackage{xparse}
 
-\ProvidesExplPackage {citation-style-language} {2025-01-10} {0.6.7}
+\ProvidesExplPackage {citation-style-language} {2025-01-25} {0.6.8}
   {Citation Style Language for LaTeX}
 
 \RequirePackage { l3keys2e }
@@ -100,7 +100,7 @@
     locale .code:n =
       {
         \tl_set:Nn \l__csl_locale_tl {#1}
-        \tl_gset:Nn \g__csl_global_locale {#1}
+        \tl_gset:Nn \g__csl_global_locale_tl {#1}
       } ,
     backref .choices:nn =
       { true, page, section, false }
@@ -123,13 +123,13 @@
 
 \cs_new:Npn \__csl_set_back_ref:n #1
   {
-    \str_if_eq:nnTF {#1} {false}
+    \str_if_eq:nnTF {#1} { false }
       {
         \bool_set_false:N \l__csl_back_ref_bool
       }
       {
         \bool_set_true:N \l__csl_back_ref_bool
-        \str_if_eq:nnTF {#1} {true}
+        \str_if_eq:nnTF {#1} { true }
           { \str_set:Nn \l__csl_back_ref_type_str { page } }
           { \str_set:Nn \l__csl_back_ref_type_str {#1} }
       }
@@ -159,7 +159,7 @@
   }
 
 \tl_new:N \g__csl_aux_bibstyle_tl
-\cs_set:Npn \csl at aux@style #1#2
+\cs_new:Npn \csl at aux@style #1#2
   {
     \str_if_eq:nnT {#1} { 0 }
       { \tl_gset:Nn \g__csl_aux_bibstyle_tl {#2} }
@@ -174,7 +174,7 @@
     \iow_now:Ne \l__csl_ccf_iow
       {
         \c_percent_str \c_space_tl This~ file~ is~ generated~ by~
-        citation-style-language~ package.\iow_newline:
+        citation-style-language~ package. \iow_newline:
         \c_percent_str \c_space_tl Its~ main~ purpose~ is~ to~ be~ recognized~
         by~ latexmk.
       }
@@ -183,11 +183,11 @@
 
 
 % Load other modules
-\input{citation-style-language-init.sty}
-\input{citation-style-language-data.sty}
-\input{citation-style-language-cite.sty}
-\input{citation-style-language-bib.sty}
-\input{citation-style-language-compatible.sty}
+\input { citation-style-language-init.sty }
+\input { citation-style-language-data.sty }
+\input { citation-style-language-cite.sty }
+\input { citation-style-language-bib.sty }
+\input { citation-style-language-compatible.sty }
 
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl
===================================================================
--- trunk/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl	2025-01-25 20:49:12 UTC (rev 73595)
+++ trunk/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl	2025-01-25 21:22:52 UTC (rev 73596)
@@ -14,7 +14,7 @@
     <category citation-format="author-date"/>
     <category field="psychology"/>
     <category field="generic-base"/>
-    <updated>2024-12-12T11:41:56-05:00</updated>
+    <updated>2025-01-22T13:45:37-05:00</updated>
     <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
   </info>
   <locale xml:lang="en">
@@ -138,7 +138,7 @@
   <!-- APA references contain four parts: author, date, title, source -->
   <macro name="author-bib">
     <group delimiter=" ">
-      <names variable="composer" delimiter=", ">
+      <names variable="composer" delimiter=", & ">
         <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
         <substitute>
           <names variable="author"/>
@@ -147,7 +147,7 @@
           <!-- TODO: Replace `delimiter` with `collapse` to combine names variables when that becomes available. -->
           <choose>
             <if type="broadcast">
-              <names variable="script-writer director" delimiter=", & ">
+              <names variable="script-writer director">
                 <!-- Note: Actors/performers and producers [not executive] not cited in APA style. -->
                 <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
                 <label form="long" prefix=" (" suffix=")" text-case="title"/>
@@ -160,7 +160,7 @@
             <label form="long" prefix=" (" suffix=")" text-case="title"/>
           </names>
           <!-- TODO: Replace `delimiter` with `collapse` to combine names variables when that becomes available. -->
-          <names variable="guest host" delimiter=", & ">
+          <names variable="guest host">
             <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
             <label form="long" prefix=" (" suffix=")" text-case="title"/>
           </names>
@@ -293,7 +293,7 @@
         </choose>
       </else-if>
       <else>
-        <names variable="composer" delimiter=", ">
+        <names variable="composer" delimiter=" & ">
           <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
           <substitute>
             <names variable="author"/>
@@ -301,12 +301,12 @@
             <!-- TODO: Replace `delimiter` with `collapse` to combine names variables when that becomes available. -->
             <choose>
               <if type="broadcast">
-                <names variable="script-writer director" delimiter=", & "/>
+                <names variable="script-writer director"/>
               </if>
             </choose>
             <names variable="director"/>
             <!-- TODO: Replace `delimiter` with `collapse` to combine names variables when that becomes available. -->
-            <names variable="guest host" delimiter=", & "/>
+            <names variable="guest host"/>
             <names variable="producer"/>
             <choose>
               <if variable="container-title">



More information about the tex-live-commits mailing list.