From eb5f6f6b85d43592051aaf5c6e14e4173cffeba9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 6 Oct 2023 03:01:32 +0000 Subject: CTAN sync 202310060301 --- biblio/citation-style-language/CHANGELOG.md | 11 +- .../citation-style-language-doc.pdf | Bin 229873 -> 229861 bytes .../citation-style-language-doc.tex | 2 +- .../citation-style-language-init.sty | 59 +++--- .../citation-style-language.sty | 4 +- biblio/citation-style-language/citeproc-cli.lua | 3 +- .../citeproc-latex-core.lua | 10 +- biblio/citation-style-language/citeproc-latex.lua | 12 +- biblio/citation-style-language/citeproc-lua.1 | 2 +- biblio/citation-style-language/citeproc-output.lua | 27 ++- biblio/citation-style-language/citeproc-util.lua | 5 +- biblio/citation-style-language/citeproc.lua | 2 +- .../citation-style-language/csl-locales-en-US.xml | 2 +- .../citation-style-language/csl-locales-hr-HR.xml | 6 +- .../citation-style-language/csl-locales-ja-JP.xml | 224 +++++++++++---------- biblio/citation-style-language/ieee.csl | 27 +-- biblio/ctan-bibdata/ctan.bib | 44 +++- biblio/ctan-bibdata/ctan.pdf | Bin 3712122 -> 3714907 bytes 18 files changed, 260 insertions(+), 180 deletions(-) (limited to 'biblio') diff --git a/biblio/citation-style-language/CHANGELOG.md b/biblio/citation-style-language/CHANGELOG.md index 85ffb9f43d..312b82ef03 100644 --- a/biblio/citation-style-language/CHANGELOG.md +++ b/biblio/citation-style-language/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.4.5] - 2023-10-05 + +### Fixed + +- Fix tilde (nonbreakable space) incorrectly displayed in LuaTeX ([#42](https://github.com/zepinglee/citeproc-lua/issues/42)). +- If no style is defined, a warning is given and the default APA style will be used ([#43](https://github.com/zepinglee/citeproc-lua/issues/43)). +- The JSON decoding error is now correctly issued. + ## [0.4.4] - 2023-09-16 ### Fixed @@ -146,7 +154,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial CTAN release. -[Unreleased]: https://github.com/zepinglee/citeproc-lua/compare/v0.4.4...HEAD +[Unreleased]: https://github.com/zepinglee/citeproc-lua/compare/v0.4.5...HEAD +[0.4.5]: https://github.com/zepinglee/citeproc-lua/compare/v0.4.4...v0.4.5 [0.4.4]: https://github.com/zepinglee/citeproc-lua/compare/v0.4.3...v0.4.4 [0.4.3]: https://github.com/zepinglee/citeproc-lua/compare/v0.4.2...v0.4.3 [0.4.2]: https://github.com/zepinglee/citeproc-lua/compare/v0.4.1...v0.4.2 diff --git a/biblio/citation-style-language/citation-style-language-doc.pdf b/biblio/citation-style-language/citation-style-language-doc.pdf index b18b95c0eb..9d4c11658f 100644 Binary files a/biblio/citation-style-language/citation-style-language-doc.pdf and b/biblio/citation-style-language/citation-style-language-doc.pdf differ diff --git a/biblio/citation-style-language/citation-style-language-doc.tex b/biblio/citation-style-language/citation-style-language-doc.tex index 4c2f500ca7..e904d6caf3 100644 --- a/biblio/citation-style-language/citation-style-language-doc.tex +++ b/biblio/citation-style-language/citation-style-language-doc.tex @@ -49,7 +49,7 @@ }% } -\date{2023-09-16 v0.4.4} +\date{2023-10-05 v0.4.5} \maketitle diff --git a/biblio/citation-style-language/citation-style-language-init.sty b/biblio/citation-style-language/citation-style-language-init.sty index db7dc0111a..5425eaac27 100644 --- a/biblio/citation-style-language/citation-style-language-init.sty +++ b/biblio/citation-style-language/citation-style-language-init.sty @@ -25,12 +25,17 @@ \cs_new:Npn \__csl_write_aux_info: { - \tl_if_empty:NTF \l__csl_style_tl + \tl_if_empty:NT \l__csl_style_tl { \tl_set_eq:NN \l__csl_style_tl \g__csl_aux_bibstyle_tl \edef \csl@style { \g__csl_aux_bibstyle_tl } } - { \exp_args:Nx \__csl_write_aux_bibstyle:n { \l__csl_style_tl } } + \tl_if_empty:VTF \l__csl_style_tl + { + \msg_warning:nn { citation-style-language } { missing-style-name } + \tl_set:Nn \l__csl_style_tl { apa } + } + { \exp_args:NV \__csl_write_aux_bibstyle:n \l__csl_style_tl } \clist_if_empty:NTF \l__csl_bib_resources_clist { \clist_set_eq:NN \l__csl_bib_resources_clist \g__csl_aux_bib_files_clist } { @@ -65,22 +70,18 @@ \cs_new:Npn \__csl_initialize_lua_module: { - \tl_if_blank:VTF \l__csl_style_tl - { \msg_warning:nn { citation-style-language } { empty-style-name } } + \clist_if_empty:NT \l__csl_bib_resources_clist + { \msg_warning:nn { citation-style-language } { empty-bib-resources } } + \lua_now:e { - \clist_if_empty:NTF \l__csl_bib_resources_clist - { \msg_warning:nn { citation-style-language } { empty-bib-resources } } - { - \lua_now:e - { - csl.init( - "\l__csl_style_tl", - "\l__csl_bib_resources_clist", - "\l__csl_locale_tl" - ) - } - } + csl.init( + "\l__csl_style_tl", + "\l__csl_bib_resources_clist", + "\l__csl_locale_tl" + ) } + + \str_if_eq:eeT { \lua_now:n { tex.print(csl.initialized) } } { true } { \bool_set_true:N \l__csl_engine_initialized_bool } \__csl_get_style_class: @@ -89,11 +90,11 @@ { } } -\msg_new:nnn { citation-style-language } { empty-style-name } - { Style~ name~ not~ specified. } +\msg_new:nnn { citation-style-language } { missing-style-name } + { Missing~ style~ name.\\Will~ use~ default~ APA~ style. } \msg_new:nnn { citation-style-language } { empty-bib-resources } - { Empty~ bibliographic~ resources. Use~ \token_to_str:N \addbibresource. } + { Empty~ bibliographic~ resources.~ Use~ \token_to_str:N \addbibresource. } % \str_new:N \l__csl_style_class_str @@ -325,18 +326,22 @@ \ior_new:N \l__csl_style_ior \cs_new:Npn \__csl_read_style_class: { - \exp_args:NNx \ior_open:Nn \l__csl_style_ior { \l__csl_style_tl .csl } - \ior_map_inline:Nn \l__csl_style_ior + \bool_set_false:N \l__csl_note_bool + \tl_if_blank:VF \l__csl_style_tl { - % \tl_show:n {##1} - \tl_if_in:nnT {##1} { class="note" } + \exp_args:NNx \ior_open:Nn \l__csl_style_ior { \l__csl_style_tl .csl } + \ior_map_inline:Nn \l__csl_style_ior { - \tl_set:Nn \l__csl_class_tl { note } - \bool_set_true:N \l__csl_note_bool - \ior_map_break: + % \tl_show:n {##1} + \tl_if_in:nnT {##1} { class="note" } + { + \tl_set:Nn \l__csl_class_tl { note } + \bool_set_true:N \l__csl_note_bool + \ior_map_break: + } } + \ior_close:N \l__csl_style_ior } - \ior_close:N \l__csl_style_ior } % \msg_new:nnn { citation-style-language } { file / non-exist } diff --git a/biblio/citation-style-language/citation-style-language.sty b/biblio/citation-style-language/citation-style-language.sty index b7f8f9a36f..af8a8ea903 100644 --- a/biblio/citation-style-language/citation-style-language.sty +++ b/biblio/citation-style-language/citation-style-language.sty @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {citation-style-language} {2023-09-16} {0.4.4} +\ProvidesExplPackage {citation-style-language} {2023-10-05} {0.4.5} {Citation Style Language for LaTeX} \RequirePackage { l3keys2e } @@ -46,7 +46,7 @@ \bool_new:N \l__csl_regression_test_bool \tl_new:N \l__csl_style_tl \newcommand \csl@style {} % For latex2e interface -\tl_new:N \l__csl_class_tl +\tl_new:N \l__csl_class_tl % TODO: This should be removed \bool_new:N \l__csl_note_bool \clist_new:N \l__csl_bib_resources_clist \tl_new:N \l__csl_locale_tl diff --git a/biblio/citation-style-language/citeproc-cli.lua b/biblio/citation-style-language/citeproc-cli.lua index f82d6e3c02..4a2dcee563 100644 --- a/biblio/citation-style-language/citeproc-cli.lua +++ b/biblio/citation-style-language/citeproc-cli.lua @@ -209,7 +209,8 @@ local function process_aux_file(aux_file) if style_name and style_name ~= "" then util.info(string.format("The style file: %s.csl", style_name)) else - util.error("citeproc-lua: missing style name") + util.warning("Missing style name. Will use default APA style.") + style_name = "apa" end if #citations == 0 then diff --git a/biblio/citation-style-language/citeproc-latex-core.lua b/biblio/citation-style-language/citeproc-latex-core.lua index 42beb07735..5a795ca060 100644 --- a/biblio/citation-style-language/citeproc-latex-core.lua +++ b/biblio/citation-style-language/citeproc-latex-core.lua @@ -129,7 +129,7 @@ local function read_data_files(data_files) if format == "json" then local ok, res = pcall(json_decode, contents) - if ok then + if ok and res then ---@cast res CslData csl_items = res else @@ -138,7 +138,13 @@ local function read_data_files(data_files) elseif format == "yaml" then yaml = yaml or require("citeproc-yaml") - csl_items = yaml.parse(contents) + local ok, res = pcall(yaml.parse, contents) + if ok and res then + ---@cast res CslData + csl_items = res + else + util.error(string.format('YAML decode error in file "%s".', file)) + end elseif format == "bibtex" then local bib_data, exceptions = bibtex_parser.parse(contents, bibtex_strings) diff --git a/biblio/citation-style-language/citeproc-latex.lua b/biblio/citation-style-language/citeproc-latex.lua index 74c3637733..4f87010a1c 100644 --- a/biblio/citation-style-language/citeproc-latex.lua +++ b/biblio/citation-style-language/citeproc-latex.lua @@ -24,7 +24,11 @@ csl.preview_mode = false -- Whether to use citeproc:preview_citation function csl.init(style_name, bib_files, lang) - bib_files = util.split(util.strip(bib_files), "%s*,%s*") + if string.match(bib_files, "^%s*$") then + bib_files = {} + else + bib_files = util.split(util.strip(bib_files), "%s*,%s*") + end csl.engine = core.init(style_name, bib_files, lang) @@ -111,7 +115,11 @@ function csl.cite(citation_info) -- tex.sprint(citation_str) -- tex.setcatcode(35, 12) -- # -- tex.setcatcode(37, 12) -- % - token.set_macro("l__csl_citation_tl", citation_str) + -- token.set_macro("l__csl_citation_tl", citation_str) + -- Don't use `token.set_macro`. + -- See + -- and . + tex.sprint(string.format("\\expandafter\\def\\csname l__csl_citation_tl\\endcsname{%s}", citation_str)) for _, cite_item in ipairs(citation.citationItems) do if not core.item_dict[cite_item.id] then diff --git a/biblio/citation-style-language/citeproc-lua.1 b/biblio/citation-style-language/citeproc-lua.1 index 5b62299f57..eac58ea82d 100644 --- a/biblio/citation-style-language/citeproc-lua.1 +++ b/biblio/citation-style-language/citeproc-lua.1 @@ -1,4 +1,4 @@ -.TH citeproc-lua 1 "0.4.4" +.TH citeproc-lua 1 "0.4.5" .SH NAME citeproc-lua \- make CSL citations and bibliography for LaTeX .SH SYNOPSIS diff --git a/biblio/citation-style-language/citeproc-output.lua b/biblio/citation-style-language/citeproc-output.lua index f596a39e3a..617440e531 100644 --- a/biblio/citation-style-language/citeproc-output.lua +++ b/biblio/citation-style-language/citeproc-output.lua @@ -1742,18 +1742,25 @@ LatexWriter.markups = { -- ["@display/indent"] = '
%s
\n ', } +local latex_escape_table = { + ["\\"] = "\\textbackslash{}", + ["{"] = "\\{", + ["}"] = "\\}", + ["$"] = "\\$", + ["&"] = "\\&", + ["#"] = "\\#", + ["^"] = "\\^", + ["_"] = "\\_", + ["%"] = "\\%", + ["~"] = "\\~", +} + +---@param str string +---@param context Context +---@return string function LatexWriter:write_escaped(str, context) -- TeXbook, p. 38 - str = str:gsub("\\", "\\textbackslash{}") - str = str:gsub("{", "\\{") - str = str:gsub("}", "\\}") - str = str:gsub("%$", "\\$") - str = str:gsub("&", "\\&") - str = str:gsub("#", "\\#") - str = str:gsub("%^", "\\^") - str = str:gsub("_", "\\_") - str = str:gsub("%%", "\\%%") - str = str:gsub("~", "\\~") + str = str:gsub("[\\{}$&#^_%%~]", latex_escape_table) str = str:gsub(util.unicode["em space"], "\\quad ") str = str:gsub(util.unicode["no-break space"], "~") for char, sub in pairs(util.superscripts) do diff --git a/biblio/citation-style-language/citeproc-util.lua b/biblio/citation-style-language/citeproc-util.lua index 56f9ae5fb1..a9e2b09abe 100644 --- a/biblio/citation-style-language/citeproc-util.lua +++ b/biblio/citation-style-language/citeproc-util.lua @@ -152,6 +152,7 @@ function util.error(message) -- The luatexbase.module_error() prints the traceback, which causes panic -- luatexbase.module_error("citeproc", message) + -- TODO: Enhance the error output. Make it like `\msg_error`. texio.write_nl("term", "\n") tex.error("Module citeproc Error: " .. message) @@ -177,12 +178,12 @@ function util.warning(message) -- tex.print(string.format("\\PackageWarning{citation-style-language}{%s}{}", message)) else - message = "Warning: " .. message + message = "Warning: " .. message if util.logging_file then util.logging_file:write(message .. "\n") end if util.warning_enabled then - io.stderr:write("Warning: " .. message, "\n") + io.stderr:write(message, "\n") end end end diff --git a/biblio/citation-style-language/citeproc.lua b/biblio/citation-style-language/citeproc.lua index a69367b606..4d69ac755f 100644 --- a/biblio/citation-style-language/citeproc.lua +++ b/biblio/citation-style-language/citeproc.lua @@ -16,7 +16,7 @@ else util = require("citeproc.util") end -citeproc.__VERSION__ = "0.4.4" +citeproc.__VERSION__ = "0.4.5" citeproc.new = engine.CiteProc.new citeproc.util = util diff --git a/biblio/citation-style-language/csl-locales-en-US.xml b/biblio/citation-style-language/csl-locales-en-US.xml index a12fb4373d..b7deb1026b 100644 --- a/biblio/citation-style-language/csl-locales-en-US.xml +++ b/biblio/citation-style-language/csl-locales-en-US.xml @@ -17,7 +17,7 @@ Brenton M. Wiernik This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License - 2022-10-12T15:53:27-04:00 + 2023-09-20T11:36:32-04:00 diff --git a/biblio/citation-style-language/csl-locales-hr-HR.xml b/biblio/citation-style-language/csl-locales-hr-HR.xml index bf5cac29ed..c626508f76 100644 --- a/biblio/citation-style-language/csl-locales-hr-HR.xml +++ b/biblio/citation-style-language/csl-locales-hr-HR.xml @@ -5,7 +5,7 @@ tvrbanec This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License - 2022-10-12T15:53:27-04:00 + 2023-09-21T10:32:52-04:00 @@ -48,7 +48,7 @@ working paper pristupljeno i - i ostali + i dr. anonimno anon. na @@ -62,7 +62,7 @@ izdanja izd. - i ostali + i sur. u pripremi od ibid. diff --git a/biblio/citation-style-language/csl-locales-ja-JP.xml b/biblio/citation-style-language/csl-locales-ja-JP.xml index 0057e9b48a..71545c8d78 100644 --- a/biblio/citation-style-language/csl-locales-ja-JP.xml +++ b/biblio/citation-style-language/csl-locales-ja-JP.xml @@ -4,8 +4,16 @@ Shoji Takahashi + + cmplstofB + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License - 2022-10-12T15:53:27-04:00 + 2023-09-21T12:37:26-04:00 + @@ -48,15 +56,15 @@ working paper 参照 - and others - anonymous - anon - at - available at - by - circa - c. - cited + ほか + 匿名 + 匿名 + にて + 入手先 + による + およそ + およそ + 引用 @@ -67,24 +75,24 @@ から 前掲 - in press - internet + 近刊 + インターネット 手紙 - no date + 日付なし 日付なし online presented at the - reference - references + 参照 + 参照 - ref. - refs. + 参照 + 参照 読み込み - scale - version + + preprint @@ -106,7 +114,7 @@ graphic hearing - interview + 面接 legal case legislation manuscript @@ -142,7 +150,7 @@ doc. graph. - interv. + 面接 MS video rec. rep. @@ -151,8 +159,8 @@ audio rec. - AD - BC + 紀元前 + 紀元後 BCE CE @@ -167,25 +175,25 @@ ; - th - st - nd - rd - th - th - th + 番目 + 番目 + 番目 + 番目 + 番目 + 番目 + 番目 - first - second - third - fourth - fifth - sixth - seventh - eighth - ninth - tenth + 1番目 + 2番目 + 3番目 + 4番目 + 5番目 + 6番目 + 7番目 + 8番目 + 9番目 + 10番目 @@ -233,40 +241,40 @@ titles - book - books + 書籍 + 書籍 - chapter - chapters + + - column - columns + + - figure - figures + + - folio - folios + + - number - numbers + + - note - notes + + - opus - opera + 作品 + 作品 ページ @@ -281,24 +289,28 @@ 段落 - part - parts + + - section - sections + + - sub verbo - sub verbis + + における + における - verse - verses + 詩歌 + 詩歌 - volume - volumes + + @@ -435,28 +447,28 @@ series creators - director - directors + 指導者 + 指導者 - - + 編集者 + 編集者 - editor - editors + 編集者 + 編集者 - illustrator - illustrators + 図解者 + 図解者 翻訳者 翻訳者 - editor & translator - editors & translators + 編集・翻訳者 + 編集・翻訳者 @@ -501,28 +513,28 @@ cres. - dir. - dirs. + 指導 + 指導 - ed. - eds. + + - ill. - ills. + + - 翻訳者 - 翻訳者 + + - ed. & tran. - eds. & trans. + 編・訳 + 編・訳 @@ -539,16 +551,16 @@ produced by written by created by - by - directed by - 編集者: - edited by - illustrated by - interview by - to - by - 翻訳者: - edited & translated by + 作者: + 指導者: + 編集者: + 編集者: + 図解者: + 面接者: + 受領者: + 査読者: + 翻訳者: + 編集・翻訳者: comp. by @@ -563,12 +575,12 @@ prod. by writ. by cre. by - dir. - 編集者: - ed. - illus. - 翻訳者: - ed. & trans. by + 指導: + 編: + 編: + 図: + 訳: + 編・訳: 1月 @@ -599,9 +611,9 @@ 12月 - Spring - Summer - Autumn - Winter + 春季 + 夏季 + 秋季 + 冬季 diff --git a/biblio/citation-style-language/ieee.csl b/biblio/citation-style-language/ieee.csl index 5a642d3113..6567e479bb 100644 --- a/biblio/citation-style-language/ieee.csl +++ b/biblio/citation-style-language/ieee.csl @@ -45,7 +45,7 @@ IEEE style as per the 2021 guidelines, V 01.29.2021. - 2023-04-22T23:05:51-04:00 + 2023-09-24T22:45:14-04:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -200,12 +200,16 @@ - - - - + + + + + + + + @@ -359,17 +363,15 @@ - + - - - - - + + + @@ -400,8 +402,7 @@ - - + diff --git a/biblio/ctan-bibdata/ctan.bib b/biblio/ctan-bibdata/ctan.bib index f9f665a4fe..32d5a0b3da 100644 --- a/biblio/ctan-bibdata/ctan.bib +++ b/biblio/ctan-bibdata/ctan.bib @@ -1,7 +1,7 @@ %% bib file of all CTAN packages %% (C) Herbert Voß %% -%% created at 05-10-2023, 02:00:51 +%% created at 06-10-2023, 02:00:35 %% %% This file is provided under the terms of the LPPL v1.3 or @@ -12603,6 +12603,17 @@ url = {https://ctan.org/pkg/circuitikz}, } +@manual{ctan-circularglyphs, + title = {The \texttt{circularglyphs} package}, + subtitle = {A circular glyphs alphabet}, + author = {Cédric Pierquet}, + date = {2023-10-05}, + version = {0.1.0}, + license = {lppl1.3c,other-free}, + mirror = {https://mirror.ctan.org/graphics/pgf/contrib/circularglyphs}, + url = {https://ctan.org/pkg/circularglyphs}, +} + @manual{ctan-cirth, title = {The \texttt{cirth} package}, subtitle = {Fonts for Cirth}, @@ -12618,8 +12629,8 @@ title = {The \texttt{citation-style-language} package}, subtitle = {Bibliography formatting with Citation Style Language}, author = {Zeping Lee}, - date = {2023-09-16}, - version = {0.4.4}, + date = {2023-10-05}, + version = {0.4.5}, license = {mit,cc-by-sa-3}, mirror = {https://mirror.ctan.org/biblio/citation-style-language}, url = {https://ctan.org/pkg/citation-style-language}, @@ -50118,6 +50129,25 @@ url = {https://ctan.org/pkg/opacity-pro}, } +@manual{ctan-opbible, + title = {The \texttt{OpBible} package}, + subtitle = {Creating a study Bible with OpTeX}, + author = {Petr Olšák}, + date = {2023-10-05}, + version = {0.31}, + license = {gpl}, + mirror = {https://mirror.ctan.org/macros/luatex/generic/opbible}, + url = {https://ctan.org/pkg/opbible}, + annotation = {This package includes macros + which allow to create a study Bible in many language variants. + The main Bible text is in separate files while the commentary + apparatus can be written in other files. + \TeX{} is able to join all these data into a single print of a + study Bible. + Moreover, multiple language variants and translation subvariants + are provided.}, +} + @manual{ctan-opcit, title = {The \texttt{opcit} package}, subtitle = {Footnote-style bibliographical references}, @@ -51920,8 +51950,8 @@ title = {The \texttt{pdfjam} package}, subtitle = {Shell scripts interfacing to pdfpages}, author = {David Firth and Reuben Thomas}, - date = {2023-09-12}, - version = {3.08}, + date = {2023-10-05}, + version = {3.09}, license = {gpl2+}, mirror = {https://mirror.ctan.org/support/pdfjam}, url = {https://ctan.org/pkg/pdfjam}, @@ -62596,8 +62626,8 @@ title = {The \texttt{sidenotesplus} package}, subtitle = {Place referenced notes, alerts, figures and tables into the document margin}, author = {Anton Vrba}, - date = {2022-07-09}, - version = {1.02}, + date = {2023-10-05}, + version = {1.03}, license = {lppl1.3c}, mirror = {https://mirror.ctan.org/macros/latex/contrib/sidenotesplus}, url = {https://ctan.org/pkg/sidenotesplus}, diff --git a/biblio/ctan-bibdata/ctan.pdf b/biblio/ctan-bibdata/ctan.pdf index de33567bec..ad87ce1e6c 100644 Binary files a/biblio/ctan-bibdata/ctan.pdf and b/biblio/ctan-bibdata/ctan.pdf differ -- cgit v1.2.3