diff options
author | Karl Berry <karl@freefriends.org> | 2024-08-01 19:56:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-08-01 19:56:55 +0000 |
commit | 02d9b7021483611fdcf54e5f9e9df5931ccf8ceb (patch) | |
tree | 4592be686091bfb36e3e1c883840f86229ce346e /Master/texmf-dist/tex/latex/citation-style-language | |
parent | 00d8d14e75da25f4104dd27020f521f7c56c6fab (diff) |
citation-style-language (1aug24)
git-svn-id: svn://tug.org/texlive/trunk@71944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/citation-style-language')
7 files changed, 985 insertions, 443 deletions
diff --git a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty index 19619e1f5b1..2a2af3a7d2b 100644 --- a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty +++ b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-bib.sty @@ -34,7 +34,7 @@ \__csl_collect_bibliography:n { \lua_now:e - { csl.bibliography("\l__csl_bib_filter_tl") } + { csl_citation_manager:bibliography("\l__csl_bib_filter_tl") } } } } @@ -53,11 +53,11 @@ } \tl_use:N \l__csl_bibliography_tl } - { \msg_warning:nn { citation-style-language } { bibliography / empty } } + { \msg_warning:nn { citation-style-language } { empty-bibliography } } \group_end: } -\msg_new:nnn { citation-style-language } { bibliography / empty } +\msg_new:nnn { citation-style-language } { empty-bibliography } { The~ bibliography~ is~ empty. } \DeclareDocumentCommand \bibliography { m } @@ -108,11 +108,16 @@ \cs_new:Npn \__csl_write_aux_bibliography:n #1 { \if@filesw - \iow_now:Nn \@auxout { \csl@aux@bibliography {#1} } + \iow_now:Nx \@auxout + { + \token_to_str:N \csl@aux@bibliography + { \int_use:N \g__csl_ref_section_index_int } + {#1} + } \fi } -\cs_new:Npn \csl@aux@bibliography #1 { } +\cs_new:Npn \csl@aux@bibliography #1#2 { } \tl_new:N \l__csl_bib_index_tl @@ -182,7 +187,7 @@ } { \tl_set:Nn \@noitemerr - { \msg_warning:nn { citation-style-language } { bibliography / empty } } + { \msg_warning:nn { citation-style-language } { empty-bibliography } } \endlist \group_end: \exp_args:NV \__csl_print_bib_note:n \l__csl_bib_post_note_tl @@ -355,6 +360,96 @@ } +% ### Bibliography sections and segments + + +\int_new:N \g__csl_ref_section_index_int +\int_new:N \g__csl_max_ref_section_index_int +\int_gset:Nn \g__csl_ref_section_index_int { 0 } +\int_gset:Nn \g__csl_max_ref_section_index_int { 0 } + +\keys_define:nn { csl / ref-section } + { + style .code:n = + { + \tl_set:Nn \l__csl_style_tl {#1} + \renewcommand \csl@style {#1} + } , + bib-resource .clist_set:N = \l__csl_bib_resources_clist , + locale .tl_set:N = \l__csl_locale_tl , + } + +\NewDocumentCommand \refsection { O { } } + { + \int_gincr:N \g__csl_max_ref_section_index_int + \int_gset_eq:NN \g__csl_ref_section_index_int \g__csl_max_ref_section_index_int + + \tl_clear:N \l__csl_style_tl + \clist_clear:N \l__csl_bib_resources_clist + \tl_clear:N \l__csl_locale_tl + \keys_set:nn { csl / ref-section } { #1 } + \tl_if_empty:NTF \l__csl_style_tl + { + \tl_set_eq:NN \l__csl_style_tl \g__csl_global_style_tl + \tl_set_eq:NN \csl@style \l__csl_style_tl + } + { + \tl_set_eq:NN \csl@style \l__csl_style_tl + \exp_args:NV \__csl_write_aux_bibstyle:n \l__csl_style_tl + } + \clist_if_empty:NF \l__csl_bib_resources_clist + % { \clist_set_eq:NN \l__csl_bib_resources_clist \g__csl_global_bib_resources_clist } + { + \exp_args:Nx \__csl_write_aux_bibdata:n + { \clist_use:Nn \l__csl_bib_resources_clist { , } } + } + \tl_if_empty:NTF \l__csl_locale_tl + { \tl_set_eq:NN \l__csl_locale_tl \g__csl_global_locale_tl } + { + \exp_args:Nx \__csl_write_aux_options:n + { locale = \l__csl_locale_tl } + } + \sys_if_engine_luatex:TF + { + \lua_now:e + { + csl_citation_manager:begin_ref_section( + "\l__csl_style_tl", + "\clist_use:Nn \l__csl_bib_resources_clist { , }", + "\l__csl_locale_tl" + ) + } + \str_if_eq:eeTF + { + \lua_now:n + { + tex.print(tostring( + csl_citation_manager.ref_section.initialized + )) + } + } + { true } + { \bool_set_true:N \l__csl_engine_initialized_bool } + { \bool_set_false:N \l__csl_engine_initialized_bool } + \__csl_get_style_class_luatex: + } + { + \__csl_get_style_class: + } + } + +\cs_set_eq:NN \newrefsection \refsection + +\cs_new:Npn \endrefsection { + \int_compare:nNnT { \g__csl_ref_section_index_int } > { 0 } + { + \int_gzero:N \g__csl_ref_section_index_int + \sys_if_engine_luatex:T + { \lua_now:n { csl_citation_manager:end_ref_section() } } + } +} + + % ### Bibliography Headings and Environments \prop_new:N \l__csl_bib_env_begin_prop @@ -381,7 +476,7 @@ { \cs_if_exist:cF { __csl_head_ #1 :n } { - \msg_error:nnn { citation-style-language } { bib-heading-undefined } + \msg_error:nnn { citation-style-language } { undefined-bib-heading } {#1} } \tl_if_blank:nTF {#2} @@ -393,7 +488,7 @@ { \exp_args:NV \label \l__csl_bib_head_label_tl } } -\msg_new:nnn { citation-style-language } { bib-heading-undefined } +\msg_new:nnn { citation-style-language } { undefined-bib-heading } { Bibliography~ heading~ '#1'~ undefined. } \keys_define:nn { csl / bib-heading } @@ -426,6 +521,10 @@ \expandafter \newcommand \csname __csl_head_ #1 :n \endcsname [1] [ {#2} ] } + +\cs_if_exist:NF \refname + { \cs_set:Npn \refname { References } } + \cs_if_exist:NTF \chapter { % `book` or `report` @@ -437,19 +536,19 @@ \defbibheading { biblist } [ \biblistname ] { \chapter* {#1} - \@mkboth { \MakeMarkcase {#1} } { \MakeMarkcase {#1} } + \@mkboth { \MakeUppercase {#1} } { \MakeUppercase {#1} } } \defbibheading { bibintoc } [ \bibname ] { \chapter* {#1} \addcontentsline { toc } { chapter } {#1} - \@mkboth { \MakeMarkcase {#1} } { \MakeMarkcase {#1} } + \@mkboth { \MakeUppercase {#1} } { \MakeUppercase {#1} } } \defbibheading { biblistintoc } [ \biblistname ] { \chapter* {#1} \addcontentsline { toc } { chapter } {#1} - \@mkboth { \MakeMarkcase {#1} } { \MakeMarkcase {#1} } + \@mkboth { \MakeUppercase {#1} } { \MakeUppercase {#1} } } \defbibheading { bibnumbered } [ \bibname ] { \chapter {#1} } @@ -459,7 +558,7 @@ { \section* {#1} \if@twoside - \markright { \MakeMarkcase {#1} } + \markright { \MakeUppercase {#1} } \fi } \defbibheading { subbibintoc } [ \refname ] @@ -467,7 +566,7 @@ \section* {#1} \addcontentsline { toc } { section } {#1} \if@twoside - \markright { \MakeMarkcase {#1} } + \markright { \MakeUppercase {#1} } \fi } \defbibheading { subbibnumbered } [ \refname ] @@ -483,19 +582,19 @@ \defbibheading { biblist } [ \biblistname ] { \section* {#1} - \@mkboth { \MakeMarkcase {#1} } { \MakeMarkcase {#1} } + \@mkboth { \MakeUppercase {#1} } { \MakeUppercase {#1} } } \defbibheading { bibintoc } [ \refname ] { \section* {#1} \addcontentsline { toc } { section } {#1} - \@mkboth { \MakeMarkcase {#1} } { \MakeMarkcase {#1} } + \@mkboth { \MakeUppercase {#1} } { \MakeUppercase {#1} } } \defbibheading { biblistintoc } [ \biblistname ] { \section* {#1} \addcontentsline { toc } { section } {#1} - \@mkboth { \MakeMarkcase {#1} } { \MakeMarkcase {#1} } + \@mkboth { \MakeUppercase {#1} } { \MakeUppercase {#1} } } \defbibheading { bibnumbered } [ \refname ] { \section {#1} } @@ -531,7 +630,7 @@ { \prop_get:NnNF \l__csl_bib_notes_prop {#1} \l_tmpa_tl { - \msg_error:nnn { citation-style-language } { bib-note-undefined } + \msg_error:nnn { citation-style-language } { undefined-bib-note } {#1} } \tl_if_empty:NF \l_tmp_tl @@ -547,7 +646,7 @@ } } -\msg_new:nnn { citation-style-language } { bib-note-undefined } +\msg_new:nnn { citation-style-language } { undefined-bib-note } { Bibliography~ note~ '#1'~ undefined. } @@ -593,7 +692,7 @@ \tl_put_right:Nn \l_tmpa_tl { ##1 = {##2} } } \sys_if_engine_luatex:T - { \lua_now:e { csl.set_categories("\l_tmpa_tl") } } + { \lua_now:e { csl_citation_manager:set_categories("\l_tmpa_tl") } } { \tl_put_left:Nx \l_tmpa_tl { categories = \c_left_brace_str } \tl_put_right:NV \l_tmpa_tl \c_right_brace_str diff --git a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty index e7683b5a900..709ef6191e4 100644 --- a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty +++ b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-cite.sty @@ -246,10 +246,17 @@ \cs_new:Npn \__csl_set_locator:nn #1#2 { - \prop_put:Nnn \l__csl_cite_item_prop { label } {#1} - \prop_put:Nnn \l__csl_cite_item_prop { locator } {#2} + \tl_if_empty:nTF {#2} + { \msg_warning:nnn { citation-style-language } { empty-locator } {#1} } + { + \prop_put:Nnn \l__csl_cite_item_prop { label } {#1} + \prop_put:Nnn \l__csl_cite_item_prop { locator } {#2} + } } +\msg_new:nnn { citation-style-language } { empty-locator } + { Empty~ '#1'~ locator. } + \keys_define:nn { csl / cite-item } { prefix .prop_put:N = \l__csl_cite_item_prop, @@ -376,7 +383,7 @@ \__csl_serialize_prop:NN \l__csl_citation_info_prop \l__csl_citation_info_tl % Write to .aux file % \tl_show:N \l__csl_citation_info_tl - \exp_args:NV \__csl_write_aux_citation:n \l__csl_citation_info_tl + \exp_args:NVV \__csl_write_aux_citation:nn \g__csl_ref_section_index_int \l__csl_citation_info_tl \bool_if:NT \l__csl_regression_test_bool { \tl_show:N \l__csl_citation_info_tl } % Print the citation string @@ -404,7 +411,7 @@ } \cs_new:Npn \__csl_cite_aux:n #1 - { \lua_now:e { csl.cite("\lua_escape:n {#1}") } } + { \lua_now:e { csl_citation_manager:cite("\lua_escape:n {#1}") } } % #1: seq % #2: tl @@ -488,11 +495,12 @@ } -\cs_new:Npn \__csl_write_aux_citation:n #1 - % #1: citation info "{<citationID>}{{id=ITEM-1},{id=ITEM-2}}{<noteIndex>}" +\cs_new:Npn \__csl_write_aux_citation:nn #1#2 + % #1: refsection index (already converted to tl) + % #2: citation info "{<citationID>}{{id=ITEM-1},{id=ITEM-2}}{<noteIndex>}" { \if@filesw - \iow_now:Nn \@auxout { \csl@aux@cite {#1} } + \iow_now:Nn \@auxout { \csl@aux@cite {#1} {#2} } \fi } @@ -550,8 +558,8 @@ \tl_set:Nn \l__csl_citation_tl { [ \textbf {#1} ] } } -% \msg_new:nnn { citation-style-language } { citation / undefined } -% { Citation~ `#1'~ on~ page~ \thepage \space undefined~ \msg_line_context: . } +% \msg_new:nnn { citation-style-language } { undefined-citation } +% { Citation~ '#1'~ on~ page~ \thepage \space undefined~ \msg_line_context: . } \cs_new:Npn \__csl_warn_citation_undefined:n #1 { @@ -580,23 +588,23 @@ } \bool_if:NT \l__csl_regression_test_bool { \tl_show:N \l__csl_citation_info_tl } - \exp_args:NV \__csl_no_cite_write_aux:n \l__csl_citation_info_tl + \exp_args:NVV \__csl_no_cite_write_aux:nn \g__csl_ref_section_index_int \l__csl_citation_info_tl \sys_if_engine_luatex:T - { \lua_now:n { csl.nocite("#1") } } + { \lua_now:n { csl_citation_manager:nocite("#1") } } \tl_clear:N \l__csl_citation_tl \bool_if:NT \l__csl_regression_test_bool { \tl_show:N \l__csl_citation_tl } } -\cs_new:Npn \__csl_no_cite_write_aux:n #1 +\cs_new:Npn \__csl_no_cite_write_aux:nn #1#2 { \__csl_if_preamble:TF { \hook_gput_code:nnn { begindocument } { . } - { \exp_args:Nx \__csl_write_aux_citation:n { #1 } } + { \__csl_write_aux_citation:nn {#1} {#2} } } - { \exp_args:Nx \__csl_write_aux_citation:n { #1 } } + { \__csl_write_aux_citation:nn {#1} {#2} } } @@ -612,10 +620,10 @@ % Used in aux files to register cite items. % #1: a citation object -\cs_set:Npn \csl@aux@cite #1 +\cs_set:Npn \csl@aux@cite #1#2 { \sys_if_engine_luatex:T - { \lua_now:e { csl.register_citation_info("\lua_escape:n {#1}") } } + { \lua_now:e { csl_citation_manager:register_citation_info(#1, "\lua_escape:n {#2}") } } } @@ -627,3 +635,10 @@ % #1: cite id % #2: cite contents \cs_new:Npn \cslcite #1#2 {#2} + +% This command is for use with hyperref. +% #1: cite id +\cs_new:Npn \cslundefinedcite #1 { + \textbf {#1} + \__csl_warn_citation_undefined:n {#1} +} diff --git a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty index ca44d0e4579..5289be43ee4 100644 --- a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty +++ b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-compatible.sty @@ -98,25 +98,33 @@ % ### `hyperref` \cs_set:Npn \__csl_hyperref_cite_item:nn #1#2 - { \hyper@@link [ cite ] { } { cite. #1 \@extra@b@citeb } { #2 } } + { + \hyper@@link [ cite ] { } + { cite \int_use:N \g__csl_ref_section_index_int . #1 \@extra@b@citeb } { #2 } + } \cs_new:Npn \__csl_hyperref_lbibitem:nn [#1]#2 { \clist_gput_right:Nn \g__csl_bib_items_clist {#2} \@skiphyperreftrue - \H@item[% - \ifx\Hy@raisedlink\@empty - \hyper@anchorstart{cite.#2\@extra@b@citeb}% - \@BIBLABEL{#1}% - \hyper@anchorend - \else - \Hy@raisedlink{% - \hyper@anchorstart{cite.#2\@extra@b@citeb}\hyper@anchorend - }% - \@BIBLABEL{#1}% - \fi - \hfill - ]% + \H@item + [ + \ifx \Hy@raisedlink \@empty + \hyper@anchorstart + { cite \int_use:N \g__csl_ref_section_index_int . #2 \@extra@b@citeb } + \@BIBLABEL {#1} + \hyper@anchorend + \else + \Hy@raisedlink + { + \hyper@anchorstart + { cite \int_use:N \g__csl_ref_section_index_int . #2 \@extra@b@citeb } + \hyper@anchorend + } + \@BIBLABEL {#1} + \fi + \hfill + ] \@skiphyperreffalse \ignorespaces } @@ -128,7 +136,8 @@ \Hy@raisedlink { \hyper@anchorstart - { cite. #1 \@extra@b@citeb } \relax + { cite \int_use:N \g__csl_ref_section_index_int . #1 \@extra@b@citeb } + \relax \hyper@anchorend } \ignorespaces diff --git a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty index db83bced06c..65bc15d1162 100644 --- a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty +++ b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language-init.sty @@ -16,8 +16,9 @@ { \__csl_initialize_lua_module: } { \__csl_load_bbl: - \__csl_read_style_class: + \__csl_get_style_class: } + \__csl_set_ref_section_level: } @@ -25,19 +26,20 @@ \cs_new:Npn \__csl_write_aux_info: { + \tl_if_empty:NF \l__csl_style_tl + { \exp_args:NV \__csl_write_aux_bibstyle:n \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 } \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 } - } - \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 + \tl_set_eq:NN \csl@style \l__csl_style_tl + \clist_if_empty:NT \l__csl_bib_resources_clist { \clist_set_eq:NN \l__csl_bib_resources_clist \g__csl_aux_bib_files_clist } + \clist_if_empty:NTF \l__csl_bib_resources_clist + { \msg_warning:nn { citation-style-language } { empty-bib-resources } } { \exp_args:Nx \__csl_write_aux_bibdata:n { \clist_use:Nn \l__csl_bib_resources_clist { , } } @@ -48,7 +50,11 @@ \cs_new:Npn \__csl_write_aux_bibstyle:n #1 { \if@filesw - \iow_now:Nx \@auxout { \token_to_str:N \csl@aux@style {#1} } + \iow_now:Nx \@auxout + { + \token_to_str:N \csl@aux@style + { \int_use:N \g__csl_ref_section_index_int } {#1} + } \fi } @@ -56,42 +62,56 @@ { \if@filesw % Full expansion for files like \jobname.bib - \iow_now:Nx \@auxout { \token_to_str:N \csl@aux@data {#1} } + \iow_now:Nx \@auxout + { + \token_to_str:N \csl@aux@data + { \int_use:N \g__csl_ref_section_index_int } {#1} + } \fi } % In earlier time, \bibdata{xxx.json} was used but this causes latexmk unable % to find xxx.json.bib and it refuses to run the $bibtex procedure. % John Collins suggests using a different command than \bibdata. -\cs_new:Npn \csl@aux@data #1 - { \clist_gput_right:Nn \g__csl_aux_bib_files_clist {#1} } +\cs_new:Npn \csl@aux@data #1#2 + { + \str_if_eq:nnT {#1} { 0 } + { \clist_gput_right:Nn \g__csl_aux_bib_files_clist {#2} } + } \cs_new:Npn \__csl_initialize_lua_module: { - \clist_if_empty:NT \l__csl_bib_resources_clist - { \msg_warning:nn { citation-style-language } { empty-bib-resources } } + \tl_set:Nx \l_tmpa_tl { \clist_use:Nn \l__csl_bib_resources_clist { , } } \lua_now:e { - csl.init( + csl_citation_manager:init( "\l__csl_style_tl", - "\l__csl_bib_resources_clist", + "\l_tmpa_tl", "\l__csl_locale_tl" ) } - - - \str_if_eq:eeT { \lua_now:n { tex.print(csl.initialized) } } { true } + \str_if_eq:eeTF + { + \lua_now:n + { + tex.print(tostring( + csl_citation_manager.ref_section.initialized + )) + } + } + { true } { \bool_set_true:N \l__csl_engine_initialized_bool } - \__csl_get_style_class: + { \bool_set_false:N \l__csl_engine_initialized_bool } + \__csl_get_style_class_luatex: \@ifpackageloaded { hyperref } - { \lua_now:n { csl.enable_linking() } } + { \lua_now:n { csl_citation_manager:enable_linking() } } { } } \msg_new:nnn { citation-style-language } { missing-style-name } - { Missing~ style~ name.\\Will~ use~ default~ APA~ style. } + { 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. } @@ -101,13 +121,16 @@ % In-text (including numeric or author-date) or note style % \bool_new:N \l__csl_note_style_bool -\cs_new:Npn \__csl_get_style_class: { +\cs_new:Npn \__csl_get_style_class_luatex: { + \bool_set_false:N \l__csl_note_bool \bool_if:NT \l__csl_engine_initialized_bool { - \tl_set:Nx \l__csl_class_tl { \lua_now:n { csl.get_style_class() } } + \tl_set:Nx \l__csl_class_tl { \lua_now:n { tex.print(csl_citation_manager:get_style_class()) } } \tl_if_eq:NnT \l__csl_class_tl { note } { \bool_set_true:N \l__csl_note_bool } } + \int_compare:nNnT { \g__csl_ref_section_index_int } = { 0 } + { \bool_gset_eq:NN \g__csl_global_note_class_bool \l__csl_note_bool } } @@ -266,14 +289,16 @@ \cs_new:Npn \__csl_write_aux_options:n #1 { \if@filesw - \iow_now:Nn \@auxout { \csl@aux@options {#1} } + \iow_now:Nx \@auxout + { + \token_to_str:N \csl@aux@options + { \int_use:N \g__csl_ref_section_index_int } {#1} + } \fi } -\cs_new:Npn \csl@aux@options #1 { } - +\cs_new:Npn \csl@aux@options #1#2 { } -\tl_new:N \g__csl_bibliography_setup_tl % Load .bbl at the beginning of document to save one pass of latex. % In this procedure, the \cslcitation command is processed and the contents @@ -283,10 +308,6 @@ % The \@input@ prints "No file ....bbl" in the .log file from which % the latexmk decides to run $bibtex or not. \__csl_collect_bibliography:n { \@input@ { \jobname .bbl } } - % Execute the \cslsetup part to set the style class. - % \tl_show:N \g__csl_bibliography_setup_tl - \tl_use:N \g__csl_bibliography_setup_tl - % \bool_show:N \l__csl_note_bool } @@ -302,8 +323,6 @@ % URLs may contain "%" and "#" characters. \char_set_catcode_other:N \% \char_set_catcode_other:N \# - \RenewDocumentCommand \cslsetup { m } - { \tl_gset:Nn \g__csl_bibliography_setup_tl { \cslsetup { ##1 } } } \RenewDocumentEnvironment { thebibliography } { m +b } { \tl_set:Nn \l__csl_bib_index_tl { 1 } @@ -321,29 +340,121 @@ \group_end: } +% At the moment, the `\csloptions` only reads the style class from `.bbl` +% generated by `citeproc-lua`. +% #1: refsection index +% #2: refsection options +\NewDocumentCommand \csloptions { m m } + { \keys_set:nn { csl / options } { #2 } } + +% The class option is in the `<style>=<class>` form +% (e.g. `\csloptions{class={apa=in-text}}`). +\keys_define:nn { csl / options } + { + class .code:n = { \prop_gput_from_keyval:Nn \g__csl_style_class_prop {#1} }, + } + +\prop_new:N \g__csl_style_class_prop % The `\textcite` bahaves differently with note styles. % Thus we read the style class from the `.csl` file with non-LuaTeX engines. \ior_new:N \l__csl_style_ior -\cs_new:Npn \__csl_read_style_class: +\cs_new:Npn \__csl_get_style_class: { + \tl_clear:N \l__csl_class_tl \bool_set_false:N \l__csl_note_bool + \prop_get:NVNF \g__csl_style_class_prop \l__csl_style_tl \l__csl_class_tl + { \__csl_read_style_class: } + \tl_if_empty:NF \l__csl_class_tl + { + \str_case:VnTF \l__csl_class_tl + { + { note } { \bool_set_true:N \l__csl_note_bool } + { in-text } { \bool_set_false:N \l__csl_note_bool } + } + { + \int_compare:nNnT { \g__csl_ref_section_index_int } = { 0 } + { + \bool_gset_eq:NN \g__csl_global_note_class_bool \l__csl_note_bool + } + } + { + \msg_error:nnV { citation-style-language } { invalid-style-class } + \l__csl_class_tl + } + } + } + +\cs_new:Npn \__csl_read_style_class: + { \tl_if_blank:VF \l__csl_style_tl { \exp_args:NNx \ior_open:Nn \l__csl_style_ior { \l__csl_style_tl .csl } \ior_map_inline:Nn \l__csl_style_ior { % \tl_show:n {##1} - \tl_if_in:nnT {##1} { class="note" } + \tl_if_in:nnTF {##1} { class="note" } { \tl_set:Nn \l__csl_class_tl { note } \bool_set_true:N \l__csl_note_bool + \prop_gput:NVn \g__csl_style_class_prop \l__csl_style_tl { note } \ior_map_break: } + { + \tl_if_in:nnT {##1} { class="in-text" } + { + \tl_set:Nn \l__csl_class_tl { in-text } + \bool_set_false:N \l__csl_note_bool + \prop_gput:NVn \g__csl_style_class_prop \l__csl_style_tl { in-text } + \ior_map_break: + } + } } \ior_close:N \l__csl_style_ior } } -% \msg_new:nnn { citation-style-language } { file / non-exist } +\msg_new:nnn { citation-style-language } { invalid-style-class } + { Invalid~ style~ class~ '#1'. } + +% \msg_new:nnn { citation-style-language } { file-non-exist } % { No~ file~ #1. } + +\cs_new:Npn \__csl_set_ref_section_level: + { + \str_case:Vn \l__csl_bib_ref_section_str + { + { none } { } + { part } + { \__csl_patch_ref_section:n { part } } + { chapter } + { \__csl_patch_ref_section:n { chapter } } + { chapter+ } + { + \__csl_patch_ref_section:n { part } + \__csl_patch_ref_section:n { chapter } + } + { section } + { \__csl_patch_ref_section:n { section } } + { section+ } + { + \__csl_patch_ref_section:n { part } + \__csl_patch_ref_section:n { chapter } + \__csl_patch_ref_section:n { section } + } + { subsection } + { \__csl_patch_ref_section:n { subsection } } + { subsection+ } + { + \__csl_patch_ref_section:n { part } + \__csl_patch_ref_section:n { chapter } + \__csl_patch_ref_section:n { section } + \__csl_patch_ref_section:n { subsection } + } + } + } + +\cs_new:Npn \__csl_patch_ref_section:n #1 + { + \hook_gput_code:nnn { cmd / #1 / before } { . } { \newrefsection } + } diff --git a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty index ebd497bcb71..03f20df1389 100644 --- a/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty +++ b/Master/texmf-dist/tex/latex/citation-style-language/citation-style-language.sty @@ -9,16 +9,23 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {citation-style-language} {2024-06-09} {0.5.0} +\ProvidesExplPackage {citation-style-language} {2024-07-31} {0.6.0} {Citation Style Language for LaTeX} \RequirePackage { l3keys2e } \RequirePackage { url } +\prop_gput:Nnn \g_msg_module_name_prop { citation-style-language } { CSL } +\prop_gput:Nnn \g_msg_module_type_prop { citeproc } { Module } + +\msg_new:nnn { citeproc } { citeproc-error } {#1} +\msg_new:nnn { citeproc } { citeproc-warning } {#1} + + % Check incompatible packages \msg_new:nnn { citation-style-language } { incompatible-package } - { The~ `#1'~ package~ is~ incompatible~ with~ `citation-style-language'. } + { Package~ '#1'~ is~ incompatible~ with~ 'citation-style-language'. } \clist_map_inline:nn { @@ -34,7 +41,13 @@ % Load Lua module in LuaTeX \sys_if_engine_luatex:T - { \lua_now:n { csl = require("citeproc-latex") } } + { + \lua_now:n + { + citeproc_manager = require("citeproc-manager") + csl_citation_manager = citeproc_manager.CslCitationManager:new() + } + } % Global options @@ -44,11 +57,15 @@ \bool_new:N \l__csl_regression_test_bool +\tl_new:N \g__csl_global_style_tl \tl_new:N \l__csl_style_tl \newcommand \csl@style {} % For latex2e interface \tl_new:N \l__csl_class_tl % TODO: This should be removed +\bool_new:N \g__csl_global_note_class_bool \bool_new:N \l__csl_note_bool +\clist_new:N \g__csl_global_bib_resources_clist \clist_new:N \l__csl_bib_resources_clist +\tl_new:N \g__csl_global_locale_tl \tl_new:N \l__csl_locale_tl \bool_new:N \l__csl_back_ref_bool \str_new:N \l__csl_back_ref_type_str @@ -62,6 +79,7 @@ \tl_new:N \l__csl_bib_item_sep_tl \tl_new:N \l__csl_bib_par_indent_tl \tl_new:N \l__csl_bib_hang_tl +\str_new:N \l__csl_bib_ref_section_str \keys_define:nn { csl } @@ -71,14 +89,19 @@ { \tl_set:Nn \l__csl_style_tl {#1} \renewcommand \csl@style {#1} + \tl_gset:Nn \g__csl_global_style_tl {#1} } , - class .code:n = + class .code:n = {} , % Deprecated, should be removed in the next release. + bib-resource .code:n = { - \tl_set:Nn \l__csl_class_tl {#1} - \tl_if_eq:NnT \l__csl_class_tl { note } - { \bool_set_true:N \l__csl_note_bool } + \clist_set:Nn \l__csl_bib_resources_clist {#1} + \clist_gset_eq:NN \g__csl_global_bib_resources_clist \l__csl_bib_resources_clist + } , + locale .code:n = + { + \tl_set:Nn \l__csl_locale_tl {#1} + \tl_gset:Nn \g__csl_global_locale {#1} } , - locale .tl_set:N = \l__csl_locale_tl , backref .choices:nn = { true, page, section, false } { \exp_args:NV \__csl_set_back_ref:n \l_keys_choice_tl } , @@ -92,13 +115,10 @@ bib-item-sep .tl_set:N = \l__csl_bib_item_sep_tl , bib-par-indent .tl_set:N = \l__csl_bib_par_indent_tl , bib-hang .tl_set:N = \l__csl_bib_hang_tl , - % The following keys are for easier interaction between LaTeX and - % citeproc-lua engine and they are not designed for end-users. - undefined-cites .code:n = - { - \clist_map_inline:nn {#1} - { \__csl_warn_citation_undefined:n {##1} } - } , + % ref section + ref-section .choices:nn = + { none, part, chapter, chapter+, section, section+, subsection, subsection+ } + { \str_set:NV \l__csl_bib_ref_section_str \l_keys_choice_tl } , } \cs_new:Npn \__csl_set_back_ref:n #1 @@ -124,6 +144,7 @@ bib-entry-page-break = true , bib-par-indent = { \parindent } , bib-hang = { 1 em } , + ref-section = none , } @@ -138,8 +159,11 @@ } \tl_new:N \g__csl_aux_bibstyle_tl -\cs_set:Npn \csl@aux@style #1 - { \tl_gset:Nn \g__csl_aux_bibstyle_tl {#1} } +\cs_set:Npn \csl@aux@style #1#2 + { + \str_if_eq:nnT {#1} { 0 } + { \tl_gset:Nn \g__csl_aux_bibstyle_tl {#2} } + } % Write to an empty `.ccf` file for use with latexmk diff --git a/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl b/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl index 79208912e77..ec2a5260175 100644 --- a/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl +++ b/Master/texmf-dist/tex/latex/citation-style-language/styles/apa.csl @@ -14,7 +14,7 @@ <category citation-format="author-date"/> <category field="psychology"/> <category field="generic-base"/> - <updated>2024-06-06T05:59:25+00:00</updated> + <updated>2024-07-19T10:52:31-04: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"> @@ -23,6 +23,10 @@ <single>ed. & trans.</single> <multiple>eds. & trans.</multiple> </term> + <term name="editor-translator" form="short"> + <single>ed. & trans.</single> + <multiple>eds. & trans.</multiple> + </term> <term name="translator" form="short">trans.</term> <term name="interviewer" form="short"> <single>interviewer</single> @@ -32,6 +36,7 @@ <single>ed.</single> <multiple>eds.</multiple> </term> + <term name="performer" form="verb">recorded by</term> <term name="circa" form="short">ca.</term> <term name="bc"> B.C.E.</term> <term name="ad"> C.E.</term> @@ -41,7 +46,12 @@ </term> <term name="software">computer software</term> <term name="at" form="long">before the</term> + <term name="collection">archival collection</term> + <term name="post">online post</term> + <term name="at" form="long">before the</term> <term name="hearing" form="verb">testimony of</term> + <term name="review-of" form="long">review of the</term> + <term name="review-of" form="short">review of</term> </terms> </locale> <locale xml:lang="da"> @@ -82,101 +92,158 @@ <term name="et-al">et al.</term> </terms> </locale> - <!-- TODO: New types: classic collection document event hearing performance periodical regulation -software- standard --> - <!-- TODO: New creator roles: chair compiler contributor curator executive-producer guest host narrator organizer performer producer script-writer series-creator --> - <!-- TODO: New variables: - available-date submitted - part-number printing-number supplement-number - part-title volume-title - archive_collection - division jurisdiction - event-title - language - license - reviewed-genre + <!-- For Indigeneous Knowledge, assume the item is stored as `document` or `speech` + and that Nation/Community, treaty, where the Elder lives, + and topic are all stored in `title` + cf. https://libguides.norquest.ca/c.php?g=314831&p=5188823. + If the item is stored as `interview`, assume that Nation/Community, treat, and topic + are stored in `title`, 'Oral teaching' or similar is stored in `archive`, and where + the Elder lives is stored in `archive-place`. --> - <!-- TODO: New terms: - advance-online-publication - album on audio-recording - original-work-published - personal-communication - preprint - review-of - item types + <!-- Reviews are detected if an item has type `review` or `review-book` or if it has any of the variables + `reviewed-title`, `reviewed-author`, or `reviewed-genre`. For the latter case, reviews are commonly + stored as types `article-journal`, `article-magazine`, `article-newspaper`, `post-weblog`, or `webpage` --> - <!-- TODO: Check Indigeneous Knowledge format --> <!-- General categories of item types: - Periodical: article-journal article-magazine article-newspaper post-weblog review review-book + Periodical: article-journal article-magazine article-newspaper periodical post-weblog review review-book Periodical or Booklike: paper-conference Booklike: article book broadcast chapter classic collection dataset document entry entry-dictionary entry-encyclopedia event figure - graphic interview manuscript map motion_picture musical_score pamphlet patent - performance periodical personal_communication post report + graphic interview manuscript map motion_picture musical_score + pamphlet patent performance personal_communication post report software song speech standard thesis webpage Legal: bill hearing legal_case legislation regulation treaty --> + <!-- Equivalencies: + classic == book + document == report, but give full date + standard == report + performance == speech + event == speech + collection == book, but give full date + --> + <!-- Role equivalencies: + compiler == editor + organizer, curator == chair + script-writer == director + producer == director (but don't print both) + guest, host == director + series-creator, executive-producer == editor + --> <!-- APA references contain four parts: author, date, title, source --> <macro name="author-bib"> - <!-- TODO: New creator roles (media, contributor) --> - <!-- TODO: Add new item types --> - <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"/> - <names variable="illustrator"/> - <names variable="director"> - <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> - <choose> - <if variable="container-title"> - <choose> - <if type="book entry entry-dictionary entry-encyclopedia" match="any"> - <choose> - <if variable="title"> - <group delimiter=" "> - <text macro="title"/> - <text macro="parenthetical"/> - </group> - </if> - <else> - <text macro="title-and-descriptions"/> - </else> - </choose> - </if> - </choose> - </if> - </choose> - <!-- TODO: Test for editortranslator and put that first as that becomes available --> - <names variable="editor" delimiter=", "> - <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> - <label form="short" prefix=" (" suffix=")" text-case="title"/> - </names> - <names variable="editorial-director"> - <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> - <label form="short" prefix=" (" suffix=")" text-case="title"/> - </names> - <names variable="collection-editor"> - <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> - <label form="short" prefix=" (" suffix=")" text-case="title"/> - </names> - <choose> - <if variable="title"> - <group delimiter=" "> - <text macro="title"/> - <text macro="parenthetical"/> - </group> - </if> - <else> - <text macro="title-and-descriptions"/> - </else> - </choose> - </substitute> - </names> + <group 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"/> + <!-- Note: `narrator` only cited in secondary-contributors --> + <names variable="illustrator"/> + <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"/> + </names> + <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> + <names variable="producer"> + <!-- Note: Producers not cited if there is a writer/director, but use if they are the principle creator. --> + <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> + <choose> + <if variable="container-title"> + <choose> + <if type="book classic collection entry entry-dictionary entry-encyclopedia" match="any"> + <!-- Items with book-like container-title substitute with their title and parenthetical, + but leave bracketed after container-title. This mimics the `container-booklike` formatting. --> + <choose> + <if variable="title"> + <group delimiter=" "> + <text macro="title"/> + <text macro="parenthetical"/> + </group> + </if> + <else> + <text macro="title-and-descriptions"/> + </else> + </choose> + </if> + </choose> + </if> + </choose> + <names variable="series-creator executive-producer"> + <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> + <names variable="editor-translator" delimiter=", "> + <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> + <label form="short" prefix=" (" suffix=")" text-case="title"/> + </names> + <!-- TODO: Split editor and translator into separate lines once processors begin to automatically create + the editor-translator variable. --> + <names variable="editor translator" delimiter=", "> + <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> + <label form="short" prefix=" (" suffix=")" text-case="title"/> + </names> + <names variable="editorial-director"> + <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> + <label form="short" prefix=" (" suffix=")" text-case="title"/> + </names> + <names variable="compiler"> + <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> + <choose> + <if type="event performance speech" match="any"> + <names variable="chair"> + <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> + <names variable="organizer"> + <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> + </if> + </choose> + <names variable="curator"> + <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> + <names variable="collection-editor"> + <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> + <label form="short" prefix=" (" suffix=")" text-case="title"/> + </names> + <choose> + <if variable="title"> + <!-- If an item has a title, substitute missing author with title and parenthetical, but leave bracketed + after the date (in the 'title' position). --> + <group delimiter=" "> + <text macro="title"/> + <text macro="parenthetical"/> + </group> + </if> + <else> + <!-- If an item has no title, substitute with bracketed followed by parenthetical. --> + <text macro="title-and-descriptions"/> + </else> + </choose> + </substitute> + </names> + <choose> + <!-- Print "with" contributor for books, but not for other types that commonly have them (eg, thesis, software) --> + <if type="book classic collection" match="any"> + <names variable="contributor" prefix="(" suffix=")"> + <label form="verb" suffix=" "/> + <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/> + </names> + </if> + </choose> + </group> </macro> <macro name="author-intext"> - <!-- TODO: New creator roles --> - <!-- TODO: Add new item types --> <choose> <if type="bill hearing legal_case legislation regulation treaty" match="any"> <text macro="title-intext"/> @@ -212,18 +279,29 @@ <substitute> <names variable="author"/> <names variable="illustrator"/> - <names variable="director"/> + <names variable="script-writer director"/> + <names variable="guest host"/> + <names variable="producer"/> <choose> <if variable="container-title"> <choose> - <if type="book entry entry-dictionary entry-encyclopedia" match="any"> + <if type="book classic collection entry entry-dictionary entry-encyclopedia" match="any"> <text macro="title-intext"/> </if> </choose> </if> </choose> + <names variable="series-creator executive-producer"/> <names variable="editor"/> <names variable="editorial-director"/> + <names variable="compiler"/> + <choose> + <if type="event performance speech" match="any"> + <names variable="chair"/> + <names variable="organizer"/> + </if> + </choose> + <names variable="curator"/> <text macro="title-intext"/> </substitute> </names> @@ -241,7 +319,6 @@ </choose> </macro> <macro name="date-bib"> - <!-- TODO: Add new item types --> <group delimiter=" " prefix="(" suffix=")"> <choose> <if is-uncertain-date="issued"> @@ -257,7 +334,7 @@ <text variable="year-suffix"/> </group> <choose> - <if type="article-magazine article-newspaper broadcast interview motion_picture pamphlet personal_communication post post-weblog song speech webpage" match="any"> + <if type="article-magazine article-newspaper broadcast collection document event interview motion_picture pamphlet performance personal_communication post post-weblog song speech webpage" match="any"> <!-- Many video and audio examples in manual give full dates. Err on the side of too much information. --> <date variable="issued"> <date-part name="month"/> @@ -267,7 +344,7 @@ <else-if type="paper-conference"> <!-- Capture 'speech' stored as 'paper-conference' --> <choose> - <if variable="collection-editor editor editorial-director issue page volume" match="none"> + <if variable="collection-editor compiler editor editorial-director issue page volume" match="none"> <date variable="issued"> <date-part name="month"/> <date-part name="day" prefix=" "/> @@ -275,14 +352,14 @@ </if> </choose> </else-if> - <!-- Only year: article article-journal book chapter entry entry-dictionary entry-encyclopedia dataset figure graphic - manuscript map musical_score paper-conference[published] patent report review review-book thesis --> + <!-- Only year: article article-journal book chapter classic entry entry-dictionary entry-encyclopedia dataset figure graphic + manuscript map musical_score paper-conference[published] patent periodical report review review-book software standard thesis --> </choose> </group> </if> <else-if variable="status"> <group> - <!-- TODO: Should I print status as-is, or should I print the in-press term? --> + <!-- We print the status variable directly rather than using in-press, etc. terms. --> <text variable="status" text-case="lowercase"/> <text variable="year-suffix" prefix="-"/> </group> @@ -296,6 +373,7 @@ </group> </macro> <macro name="date-sort"> + <!-- This is necessary to ensure that citeproc sorts all item types chonologically in the same list. --> <choose> <if type="article article-journal book chapter entry entry-dictionary entry-encyclopedia dataset figure graphic manuscript map musical_score patent report review review-book thesis" match="any"> <date variable="issued" date-parts="year" form="numeric"/> @@ -303,7 +381,7 @@ <else-if type="paper-conference"> <!-- Capture 'speech' stored as 'paper-conference' --> <choose> - <if variable="collection-editor editor editorial-director issue page volume" match="any"> + <if variable="collection-editor compiler editor editorial-director issue page volume" match="any"> <date variable="issued" date-parts="year" form="numeric"/> </if> <else> @@ -339,7 +417,6 @@ </choose> </macro> <macro name="date-intext"> - <!-- TODO: Add new item types --> <choose> <if variable="issued"> <group delimiter="/"> @@ -387,7 +464,7 @@ </group> </if> <else-if variable="status"> - <!-- TODO: Should I print status as-is, or should I print the in-press term? --> + <!-- We print the status variable directly rather than using in-press, etc. terms. --> <text variable="status" text-case="lowercase"/> <text variable="year-suffix" prefix="-"/> </else-if> @@ -398,7 +475,7 @@ </choose> </macro> <!-- APA has two description elements following the title: - title (parenthetical) [bracketed] --> + title (parenthetical) [bracketed] --> <macro name="title-and-descriptions"> <choose> <if variable="title"> @@ -412,7 +489,7 @@ <choose> <if type="bill report" match="any"> <!-- Bills, resolutions, and congressional reports are not italicized and substitute bill number if no title. --> - <!-- Can't distinguish congressional reports from other reports, + <!-- Can't distinguish congressional reports from other reports, but giving the genre and number seems fine for other reports too. --> <text macro="number"/> <text macro="bracketed"/> @@ -429,68 +506,125 @@ </choose> </macro> <macro name="title"> - <!-- TODO: Add new item types --> <choose> <if type="post webpage" match="any"> <!-- Webpages are always italicized --> - <text variable="title" font-style="italic"/> + <text macro="title-plus-part-title" font-style="italic"/> </if> - <else-if variable="container-title" match="any"> - <!-- Other types are italicized based on presence of container-title. + <!-- Other types are italicized based on presence of container-title. Assume that review and review-book are published in periodicals/blogs, not just on a web page (ex. 69) --> - <text variable="title"/> + <else-if type="article-journal article-magazine article-newspaper periodical post-weblog review review-book" match="any"> + <text macro="periodical-title"/> </else-if> - <else> + <else-if type="paper-conference"> + <!-- Treat paper-conference as book-like if it has an editor, otherwise as periodical-like --> <choose> - <if type="article-journal article-magazine article-newspaper post-weblog review review-book" match="any"> - <text variable="title" font-style="italic"/> + <if variable="collection-editor compiler editor editorial-director" match="any"> + <text macro="booklike-title"/> </if> - <else-if type="paper-conference"> - <choose> - <if variable="collection-editor editor editorial-director" match="any"> - <group delimiter=": " font-style="italic"> - <text variable="title"/> - <!-- TODO: Replace with volume-title --> - <choose> - <if is-numeric="volume" match="none"> - <group delimiter=" "> - <label variable="volume" form="short" text-case="capitalize-first"/> - <text variable="volume"/> - </group> - </if> - </choose> - </group> - </if> - <else> - <text variable="title" font-style="italic"/> - </else> - </choose> - </else-if> <else> - <group delimiter=": " font-style="italic"> + <text macro="periodical-title"/> + </else> + </choose> + </else-if> + <else> + <text macro="booklike-title"/> + </else> + </choose> + </macro> + <macro name="periodical-title"> + <!-- For periodicals, assume that part-number and part-title refer to the article and append to title --> + <choose> + <if variable="container-title" match="any"> + <text macro="title-plus-part-title"/> + </if> + <else> + <!-- for periodical items without container titles, don't append volume-title to title --> + <text macro="title-plus-part-title" font-style="italic"/> + </else> + </choose> + </macro> + <macro name="booklike-title"> + <!-- For book-like items, assume part-number and part-title refer to the book/volume. --> + <choose> + <if variable="container-title" match="any"> + <text variable="title"/> + </if> + <else> + <!-- For book-like items without container titles and with volume-title, append volume-title to title (ex. 30) --> + <text macro="title-plus-volume-title" font-style="italic"/> + </else> + </choose> + </macro> + <macro name="title-plus-part-title"> + <choose> + <if variable="reviewed-author reviewed-genre reviewed-title" type="review review-book" match="any"> + <!-- If a review has no `reviewed-title`, assume that `title` contains the title of the reviewed work + and omit it here; it is printed in the `reviewed-item` macro. --> + <choose> + <if variable="reviewed-title" match="none"/> + <else> + <group delimiter=": "> <text variable="title"/> - <!-- TODO: Replace with volume-title --> - <choose> - <if is-numeric="volume" match="none"> - <group delimiter=" "> - <label variable="volume" form="short" text-case="capitalize-first"/> - <text variable="volume"/> - </group> - </if> - </choose> + <text macro="part-title"/> </group> </else> </choose> + </if> + <else> + <group delimiter=": "> + <text variable="title"/> + <text macro="part-title"/> + </group> </else> </choose> </macro> + <macro name="part-title"> + <group delimiter=". "> + <group delimiter=" "> + <label variable="part-number" form="short" text-case="capitalize-first"/> + <text variable="part-number"/> + </group> + <text variable="part-title" text-case="capitalize-first"/> + </group> + </macro> + <macro name="title-plus-volume-title"> + <group delimiter=": "> + <text variable="title"/> + <text macro="volume-title"/> + </group> + </macro> + <macro name="volume-title"> + <group delimiter=": "> + <choose> + <if variable="volume-title"> + <group delimiter=" "> + <group delimiter=". "> + <group delimiter=" "> + <label variable="volume" form="short" text-case="capitalize-first"/> + <text variable="volume"/> + </group> + <text variable="volume-title"/> + </group> + </group> + </if> + <else-if is-numeric="volume" match="none"> + <group delimiter=" "> + <label variable="volume" form="short" text-case="capitalize-first"/> + <text variable="volume"/> + </group> + </else-if> + </choose> + <!-- For book-like items, assume part-number and part-title refer to the book/volume. --> + <text macro="part-title"/> + </group> + </macro> <macro name="title-intext"> - <!-- TODO: Add new item types --> <choose> <if type="bill report"> <!-- Bills, resolutions, and congressional reports are not italicized and substitute bill number if no title. --> - <!-- Can't distinguish congressional reports from other reports, + <!-- Can't distinguish congressional reports from other reports, but giving the genre and number seems fine for other reports too. --> <choose> <if variable="title"> @@ -544,7 +678,6 @@ </choose> </macro> <macro name="parenthetical"> - <!-- TODO: Add new item types --> <!-- (Secondary contributors; Database location; Genre no. 123; Report Series 123, Version, Edition, Volume, Page) --> <group prefix="(" suffix=")"> <choose> @@ -604,7 +737,7 @@ <text macro="secondary-contributors"/> <choose> <if type="broadcast graphic map motion_picture song" match="any"> - <!-- For audiovisual media, number information comes after title, not container-title --> + <!-- For audiovisual media, number information comes after title, not container-title (ex. 94) --> <text macro="number"/> </if> </choose> @@ -622,7 +755,6 @@ </group> </macro> <macro name="parenthetical-container"> - <!-- TODO: Add new item types --> <choose> <if variable="container-title" match="any"> <group prefix="(" suffix=")"> @@ -630,7 +762,7 @@ <text macro="database-location"/> <choose> <if type="broadcast graphic map motion_picture song" match="none"> - <!-- For audiovisual media, number information comes after title, not container-title --> + <!-- For audiovisual media, number information comes after title, not container-title (ex. 94) --> <text macro="number"/> </if> </choose> @@ -641,65 +773,12 @@ </choose> </macro> <macro name="bracketed"> - <!-- TODO: Add new item types --> <!-- [Descriptive information] --> <!-- If there is a number, genre is already printed in macro="number" --> <group prefix="[" suffix="]"> <choose> - <if variable="reviewed-author reviewed-title" type="review review-book" match="any"> - <!-- Reviewed item --> - <group delimiter="; "> - <group delimiter=", "> - <group delimiter=" "> - <!-- Assume that genre is entered as 'Review of the book' or similar --> - <choose> - <if variable="number" match="none"> - <choose> - <if variable="genre"> - <text variable="genre" text-case="capitalize-first"/> - </if> - <else-if variable="medium"> - <text variable="medium" text-case="capitalize-first"/> - </else-if> - <else> - <!-- TODO: Replace with term="review" --> - <!-- TODO: Handle review vs review-of depending on presence of reviewed-title --> - <!-- TODO: Add reviewed-genre --> - <text value="Review of"/> - </else> - </choose> - </if> - <else> - <choose> - <if variable="medium"> - <text variable="medium" text-case="capitalize-first"/> - </if> - <else> - <!-- TODO: Replace with term="review" --> - <!-- TODO: Handle review vs review-of depending on presence of reviewed-title --> - <!-- TODO: Add reviewed-genre --> - <text value="Review of"/> - </else> - </choose> - </else> - </choose> - <text macro="reviewed-title"/> - </group> - <names variable="reviewed-author"> - <label form="verb-short" suffix=" "/> - <name and="symbol" initialize-with=". " delimiter=", "/> - </names> - </group> - <choose> - <if variable="genre" match="any"> - <choose> - <if variable="number" match="none"> - <text variable="medium" text-case="capitalize-first"/> - </if> - </choose> - </if> - </choose> - </group> + <if variable="reviewed-author reviewed-genre reviewed-title" type="review review-book" match="any"> + <text macro="reviewed-item"/> </if> <else-if type="thesis"> <!-- Thesis type and institution --> @@ -814,22 +893,35 @@ <choose> <if variable="genre"> <text variable="genre" text-case="capitalize-first"/> - <!-- TODO: Replace prefix with performer label --> - <names variable="author" prefix="recorded by "> - <name and="symbol" initialize-with=". " delimiter=", "/> - </names> + <group delimiter=" "> + <text term="performer" form="verb"/> + <names variable="author"> + <name and="symbol" initialize-with=". " delimiter=", "/> + <substitute> + <names variable="performer"/> + </substitute> + </names> + </group> </if> <else-if variable="medium"> <text variable="medium" text-case="capitalize-first"/> - <!-- TODO: Replace prefix with performer label --> - <names variable="author" prefix="recorded by "> - <name and="symbol" initialize-with=". " delimiter=", "/> - </names> + <group delimiter=" "> + <text term="performer" form="verb"/> + <names variable="author"> + <name and="symbol" initialize-with=". " delimiter=", "/> + <substitute> + <names variable="performer"/> + </substitute> + </names> + </group> </else-if> <else> - <!-- TODO: Replace prefix with performer label --> - <names variable="author" prefix="Recorded by "> + <text term="performer" form="verb" text-case="capitalize-first"/> + <names variable="author"> <name and="symbol" initialize-with=". " delimiter=", "/> + <substitute> + <names variable="performer"/> + </substitute> </names> </else> </choose> @@ -840,15 +932,23 @@ <choose> <if variable="medium"> <text variable="medium" text-case="capitalize-first"/> - <!-- TODO: Replace prefix with performer label --> - <names variable="author" prefix="recorded by "> - <name and="symbol" initialize-with=". " delimiter=", "/> - </names> + <group delimiter=" "> + <text term="performer" form="verb"/> + <names variable="author"> + <name and="symbol" initialize-with=". " delimiter=", "/> + <substitute> + <names variable="performer"/> + </substitute> + </names> + </group> </if> <else> - <!-- TODO: Replace prefix with performer label --> - <names variable="author" prefix="Recorded by "> + <text term="performer" form="verb" text-case="capitalize-first"/> + <names variable="author"> <name and="symbol" initialize-with=". " delimiter=", "/> + <substitute> + <names variable="performer"/> + </substitute> </names> </else> </choose> @@ -871,16 +971,17 @@ <text macro="format"/> </else-if> <else> - <!-- For conference presentations, chapters in reports, software, place bracketed after the container title --> + <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, + place bracketed after the container title --> <choose> - <if type="paper-conference speech" match="any"> + <if type="event paper-conference performance speech" match="any"> <choose> - <if variable="collection-editor editor editorial-director issue page volume" match="any"> + <if variable="collection-editor compiler editor editorial-director issue page volume" match="any"> <text macro="format"/> </if> </choose> </if> - <else-if type="report software" match="none"> + <else-if type="document report software standard" match="none"> <text macro="format"/> </else-if> </choose> @@ -889,10 +990,9 @@ </group> </macro> <macro name="bracketed-intext"> - <!-- TODO: Add new item types --> <group prefix="[" suffix="]"> <choose> - <if variable="reviewed-author reviewed-title" type="review review-book" match="any"> + <if variable="reviewed-title" match="any"> <group delimiter=" "> <text term="review-of" text-case="capitalize-first"/> <text macro="reviewed-title-intext"/> @@ -937,14 +1037,80 @@ </choose> </group> </macro> + <macro name="reviewed-item"> + <!-- Reviewed item --> + <group delimiter="; "> + <group delimiter=", "> + <group delimiter=" "> + <choose> + <if variable="reviewed-genre"> + <group delimiter=" "> + <text term="review-of" form="long" text-case="capitalize-first"/> + <text variable="reviewed-genre" text-case="lowercase"/> + </group> + </if> + <!-- If no `reviewed-genre`, assume that `genre` or `medium` is entered as 'Review of the book' or similar --> + <else-if variable="number" match="none"> + <choose> + <if variable="genre"> + <text variable="genre" text-case="capitalize-first"/> + </if> + <else-if variable="medium"> + <text variable="medium" text-case="capitalize-first"/> + </else-if> + <else-if type="review-book"> + <group delimiter=" "> + <text term="review-of" form="long" text-case="capitalize-first"/> + <text term="book" form="long" text-case="lowercase"/> + </group> + </else-if> + <else> + <text term="review-of" form="short" text-case="capitalize-first"/> + </else> + </choose> + </else-if> + <else> + <choose> + <if variable="medium"> + <text variable="medium" text-case="capitalize-first"/> + </if> + <else-if type="review-book"> + <group delimiter=" "> + <text term="review-of" form="long" text-case="capitalize-first"/> + <text term="book" form="long" text-case="lowercase"/> + </group> + </else-if> + <else> + <text term="review-of" form="short" text-case="capitalize-first"/> + </else> + </choose> + </else> + </choose> + <text macro="reviewed-title"/> + </group> + <names variable="reviewed-author"> + <label form="verb-short" suffix=" "/> + <name and="symbol" initialize-with=". " delimiter=", "/> + </names> + </group> + <choose> + <if variable="genre" match="any"> + <choose> + <if variable="number" match="none"> + <text variable="medium" text-case="capitalize-first"/> + </if> + </choose> + </if> + </choose> + </group> + </macro> <macro name="bracketed-container"> - <!-- TODO: Add new item types --> <group prefix="[" suffix="]"> <choose> - <if type="paper-conference speech" match="any"> + <if type="event paper-conference performance speech" match="any"> <!-- Conference presentations should describe the session [container] in bracketed unless published in a proceedings --> <choose> - <if variable="collection-editor editor editorial-director issue page volume" match="none"> + <if variable="collection-editor compiler editor editorial-director issue page volume" match="none"> <text macro="format"/> </if> </choose> @@ -953,23 +1119,21 @@ <!-- For entries in mobile app reference works, place bracketed after the container-title --> <text macro="format"/> </else-if> - <else-if type="report"> - <!-- For chapters in reports, place bracketed after the container title --> + <else-if type="document report standard"> + <!-- For chapters in report, standards, and generic documents, place bracketed after the container title --> <text macro="format"/> </else-if> </choose> </group> </macro> <macro name="secondary-contributors"> - <!-- TODO: Add new item types --> - <!-- TODO: Add new creator roles --> <choose> - <if type="article-journal article-magazine article-newspaper post-weblog review review-book" match="any"> + <if type="article-journal article-magazine article-newspaper periodical post-weblog review review-book" match="any"> <text macro="secondary-contributors-periodical"/> </if> <else-if type="paper-conference"> <choose> - <if variable="collection-editor editor editorial-director" match="any"> + <if variable="collection-editor compiler editor editorial-director" match="any"> <text macro="secondary-contributors-booklike"/> </if> <else> @@ -992,14 +1156,13 @@ </names> </if> </choose> - <names variable="translator" delimiter="; "> + <names variable="translator narrator" delimiter="; "> <name and="symbol" initialize-with=". " delimiter=", "/> <label form="short" prefix=", " text-case="title"/> </names> </group> </macro> <macro name="secondary-contributors-booklike"> - <!-- TODO: Add new item types --> <group delimiter="; "> <choose> <if variable="title"> @@ -1009,7 +1172,8 @@ </names> </if> </choose> - <!-- TODO: When editortranslator becomes available, add a test: variable="editortranslator" match="none"; then print translator --> + <!-- TODO: When editor-translator becomes available in processors, add a test: + variable="editor-translator" match="none"; then print translator --> <choose> <if type="post webpage" match="none"> <!-- Webpages treat container-title like publisher --> @@ -1024,6 +1188,14 @@ <name and="symbol" initialize-with=". " delimiter=", "/> <label form="short" prefix=", " text-case="title"/> </names> + <names variable="illustrator narrator" delimiter="; "> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="short" prefix=", " text-case="title"/> + </names> + <names variable="compiler chair organizer curator series-creator executive-producer" delimiter="; "> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="long" prefix=", " text-case="title"/> + </names> </group> </if> </choose> @@ -1038,6 +1210,14 @@ <name and="symbol" initialize-with=". " delimiter=", "/> <label form="short" prefix=", " text-case="title"/> </names> + <names variable="illustrator narrator" delimiter="; "> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="short" prefix=", " text-case="title"/> + </names> + <names variable="compiler chair organizer curator series-creator executive-producer" delimiter="; "> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="long" prefix=", " text-case="title"/> + </names> </group> </else> </choose> @@ -1047,13 +1227,11 @@ <choose> <if variable="archive-place" match="none"> <!-- With `archive-place`: physical archives. Without: online archives. --> - <!-- TODO: Add archive_collection --> <text variable="archive_location"/> </if> </choose> </macro> <macro name="number"> - <!-- TODO: Add new item types --> <choose> <if variable="number"> <group delimiter=", "> @@ -1079,12 +1257,11 @@ </choose> </macro> <macro name="locators-booklike"> - <!-- TODO: Add new item types --> <choose> - <if type="article-journal article-magazine article-newspaper broadcast interview patent post post-weblog review review-book speech webpage" match="any"/> + <if type="article-journal article-magazine article-newspaper broadcast event interview patent performance periodical post post-weblog review review-book speech webpage" match="any"/> <else-if type="paper-conference"> <choose> - <if variable="collection-editor editor editorial-director" match="any"> + <if variable="collection-editor compiler editor editorial-director" match="any"> <group delimiter=", "> <text macro="version"/> <text macro="edition"/> @@ -1129,23 +1306,26 @@ </choose> </macro> <macro name="volume-booklike"> - <!-- TODO: Add new item types --> <group delimiter=", "> <!-- Report series [ex. 52] --> <choose> - <if type="report"> + <if type="document report standard"> <group delimiter=" "> <text variable="collection-title" text-case="title"/> <text variable="collection-number"/> </group> </if> </choose> + <group delimiter=" "> + <label variable="supplement-number" text-case="capitalize-first"/> + <text variable="supplement-number"/> + </group> <choose> <if variable="volume" match="any"> - <!-- TODO: Update using volume-title --> <choose> <!-- Non-numeric volumes are already printed as part of the book title --> - <if is-numeric="volume" match="none"/> + <if variable="volume-title"/> + <else-if is-numeric="volume" match="none"/> <else> <group delimiter=" "> <label variable="volume" form="short" text-case="capitalize-first"/> @@ -1176,7 +1356,8 @@ <choose> <if variable="reviewed-title"> <!-- Not possible to distinguish TV series episode from other reviewed - works [Ex. 69] --> + works without reviewed-container-title [Ex. 69] --> + <!-- Adapt for reviewed-container-title if that becomes available --> <text variable="reviewed-title" font-style="italic"/> </if> <else> @@ -1188,7 +1369,9 @@ <macro name="reviewed-title-intext"> <choose> <if variable="reviewed-title"> - <!-- Not possible to distinguish TV series episode from other reviewed works [Ex. 69] --> + <!-- Not possible to distinguish TV series episode from other reviewed + works without reviewed-container-title [Ex. 69] --> + <!-- Adapt for reviewed-container-title if that becomes available --> <text variable="reviewed-title" form="short" font-style="italic" text-case="title"/> </if> <else> @@ -1198,7 +1381,6 @@ </choose> </macro> <macro name="format"> - <!-- TODO: Add new item types --> <choose> <if variable="genre medium" match="any"> <group delimiter="; "> @@ -1210,31 +1392,12 @@ <text variable="medium" text-case="capitalize-first"/> </group> </if> - <!-- Generic labels for specific types --> - <!-- TODO: Add terms for other types? --> - <else-if type="dataset"> - <text term="dataset"/> - </else-if> - <else-if type="software"> - <text term="software" text-case="capitalize-first"/> - </else-if> - <else-if type="interview personal_communication" match="any"> - <choose> - <if variable="archive container-title DOI publisher URL" match="none"> - <text term="personal-communication" text-case="capitalize-first"/> - </if> - <else-if type="interview"> - <text term="interview" text-case="capitalize-first"/> - </else-if> - </choose> - </else-if> - <else-if type="map"> - <text term="map" text-case="capitalize-first"/> - </else-if> + <else> + <text macro="generic-type-label"/> + </else> </choose> </macro> <macro name="format-intext"> - <!-- TODO: Add new item types --> <choose> <if variable="genre" match="any"> <text variable="genre" text-case="capitalize-first"/> @@ -1242,11 +1405,17 @@ <else-if variable="medium"> <text variable="medium" text-case="capitalize-first"/> </else-if> - <!-- Generic labels for specific types --> - <!-- TODO: Add terms for other types? --> - <else-if type="dataset"> - <text term="dataset"/> - </else-if> + <else> + <text macro="generic-type-label"/> + </else> + </choose> + </macro> + <macro name="generic-type-label"> + <!-- Generic labels for specific types --> + <choose> + <if type="dataset"> + <text term="dataset" text-case="capitalize-first"/> + </if> <else-if type="software"> <text term="software" text-case="capitalize-first"/> </else-if> @@ -1261,21 +1430,47 @@ </choose> </else-if> <else-if type="map"> - <text term="map"/> + <text term="map" text-case="capitalize-first"/> + </else-if> + <else-if type="collection"> + <text term="collection" text-case="capitalize-first"/> + </else-if> + <else-if type="song"> + <text term="song" text-case="capitalize-first"/> + </else-if> + <else-if type="motion_picture"> + <text term="motion_picture" text-case="capitalize-first"/> + </else-if> + <else-if type="post"> + <text term="post" text-case="capitalize-first"/> + </else-if> + <else-if type="review"> + <text term="review" text-case="capitalize-first"/> + </else-if> + <else-if type="review-book"> + <text term="review-book" text-case="capitalize-first"/> + </else-if> + <else-if type="broadcast"> + <text term="broadcast" text-case="capitalize-first"/> + </else-if> + <else-if type="figure"> + <text term="figure" text-case="capitalize-first"/> + </else-if> + <else-if type="graphic"> + <text term="graphic" text-case="capitalize-first"/> </else-if> </choose> </macro> <!-- APA 'source' element contains four parts: container, event, publisher, access --> <macro name="container"> - <!-- TODO: Add new item types --> <choose> - <if type="article-journal article-magazine article-newspaper post-weblog review review-book" match="any"> + <if type="article-journal article-magazine article-newspaper periodical post-weblog review review-book" match="any"> <!-- Periodical items --> <text macro="container-periodical"/> </if> <else-if type="paper-conference"> - <!-- Determine if paper-conference is a periodical or booklike --> + <!-- Determine if paper-conference is a periodical- or book-like --> <choose> <if variable="editor editorial-director collection-editor container-author" match="any"> <text macro="container-booklike"/> @@ -1309,7 +1504,6 @@ <choose> <if variable="number"> <!-- Ex. 6: Journal article with article number or eLocator --> - <!-- This should be localized --> <group delimiter=" "> <text term="article-locator" text-case="capitalize-first"/> <text variable="number"/> @@ -1323,8 +1517,8 @@ <choose> <if variable="issued"> <choose> - <if variable="issue page volume" match="none"> - <!-- TODO: Should I print status as-is, or should I print the in-press term? --> + <if variable="issue number page volume" match="none"> + <!-- We print the status variable directly rather than using in-press, etc. terms. --> <text variable="status" text-case="capitalize-first"/> </if> </choose> @@ -1333,33 +1527,54 @@ </group> </macro> <macro name="container-booklike"> - <!-- TODO: Add new item types --> <choose> <if variable="container-title" match="any"> <group delimiter=" "> - <text term="in" text-case="capitalize-first"/> + <choose> + <if type="song"> + <text term="on" text-case="capitalize-first"/> + </if> + <else> + <text term="in" text-case="capitalize-first"/> + </else> + </choose> <group delimiter=", "> - <names variable="editor translator" delimiter=", & "> - <!-- TODO: Change to editortranslator and move editor to substitute --> + <names variable="series-creator executive-producer" delimiter=", & "> <name and="symbol" initialize-with=". " delimiter=", "/> - <label form="short" text-case="title" prefix=" (" suffix=")"/> + <label form="long" text-case="title" prefix=" (" suffix=")"/> <substitute> - <names variable="editorial-director"/> - <names variable="collection-editor"/> + <names variable="editor-translator"> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="short" text-case="title" prefix=" (" suffix=")"/> + </names> + <!-- TODO: Split editor and translator lines once processors start to automatically + create editor-translator variable. --> + <names variable="editor translator"> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="short" text-case="title" prefix=" (" suffix=")"/> + </names> + <names variable="editorial-director"> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="short" text-case="title" prefix=" (" suffix=")"/> + </names> + <names variable="compiler"/> + <choose> + <if type="event performance speech" match="any"> + <names variable="chair"/> + <names variable="organizer"/> + </if> + </choose> + <names variable="curator"/> + <names variable="collection-editor"> + <name and="symbol" initialize-with=". " delimiter=", "/> + <label form="short" text-case="title" prefix=" (" suffix=")"/> + </names> <names variable="container-author"/> </substitute> </names> <group delimiter=": " font-style="italic"> <text variable="container-title"/> - <!-- TODO: Replace with volume-title --> - <choose> - <if is-numeric="volume" match="none"> - <group delimiter=" "> - <label variable="volume" form="short" text-case="capitalize-first"/> - <text variable="volume"/> - </group> - </if> - </choose> + <text macro="volume-title"/> </group> </group> <text macro="parenthetical-container"/> @@ -1369,7 +1584,6 @@ </choose> </macro> <macro name="publisher"> - <!-- TODO: Add new item types --> <group delimiter="; "> <choose> <if type="thesis"> @@ -1377,6 +1591,9 @@ <if variable="archive DOI URL" match="none"> <text variable="publisher"/> </if> + <else> + <text variable="archive"/> + </else> </choose> </if> <else-if type="post webpage" match="any"> @@ -1389,12 +1606,12 @@ <else-if type="paper-conference"> <!-- For paper-conference, don't print publisher if in a journal-like proceedings --> <choose> - <if variable="collection-editor editor editorial-director" match="any"> + <if variable="collection-editor compiler editor editorial-director" match="any"> <text variable="publisher"/> </if> </choose> </else-if> - <else-if type="article-journal article-magazine article-newspaper post-weblog" match="none"> + <else-if type="article-journal article-magazine article-newspaper periodical post-weblog review review-book" match="none"> <text variable="publisher"/> </else-if> </choose> @@ -1404,15 +1621,27 @@ <!-- With `archive-place`: physical archives. Without: online archives. --> <!-- For physical archives, print the location before the archive name. For electronic archives, these are printed in macro="description". --> - <!-- TODO: Split "archive_location" into "archive_collection" and "archive_location" --> <!-- Must test for archive_collection: With collection: archive_collection (archive_location), archive, archive-place No collection: archive (archive_location), archive-place --> - <text variable="archive_location"/> + <choose> + <if variable="archive_collection"> + <group delimiter=" "> + <text variable="archive_collection"/> + <text variable="archive_location" prefix="(" suffix=")"/> + </group> + <text variable="archive"/> + </if> + <else> + <group delimiter=" "> + <text variable="archive"/> + <text variable="archive_location" prefix="(" suffix=")"/> + </group> + </else> + </choose> </if> </choose> - <text variable="archive"/> <text variable="archive-place"/> </group> </group> @@ -1439,19 +1668,30 @@ </choose> </macro> <macro name="event"> - <!-- TODO: Add new item types (e.g., event, collection, performance) --> <choose> <if variable="event event-title" match="any"> <!-- To prevent Zotero from printing event-place due to its double-mapping of all 'place' to both publisher-place and event-place. Remove this 'choose' when that is changed. --> <choose> - <if variable="collection-editor editor editorial-director issue page volume" match="none"> - <!-- Don't print event info if published in a proceedings --> + <if type="paper-conference"> + <choose> + <if variable="collection-editor compiler editor editorial-director issue page volume" match="none"> + <!-- Don't print event info for conference papers published in a proceedings --> + <group delimiter=", "> + <text macro="event-title"/> + <text variable="event-place"/> + </group> + </if> + </choose> + </if> + <else> + <!-- For other item types, print event info even if published (e.g., for collection catalogs, performance programs. + These items aren't given explicit examples in the APA manual, so err on the side of providing too much information. --> <group delimiter=", "> <text macro="event-title"/> <text variable="event-place"/> </group> - </if> + </else> </choose> </if> </choose> @@ -1472,19 +1712,30 @@ </macro> <!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) --> <macro name="publication-history"> - <!-- TODO: Add new item types --> <choose> - <if type="patent" match="none"> - <group prefix="(" suffix=")"> + <if type="patent"> + <text variable="references" prefix="(" suffix=")"/> + </if> + <else> + <group delimiter="; " prefix="(" suffix=")"> + <!-- Print `status` here for things like "retracted" if it's not printed elsewhere already. --> + <choose> + <if variable="issued"> + <choose> + <if variable="issue number page volume" match="any"> + <text variable="status" text-case="capitalize-first"/> + </if> + </choose> + </if> + </choose> <choose> <if variable="references"> <!-- This provides the option for more elaborate description - of publication history, such as full "reprinted" references - (examples 11, 43, 44) or retracted references --> + of publication history, such as full "reprinted" references + (examples 11, 43, 44) --> <text variable="references"/> </if> <else> - <!-- TODO: Replace these with terms --> <group delimiter=" "> <text term="original-work-published" text-case="capitalize-first"/> <choose> @@ -1499,9 +1750,6 @@ </else> </choose> </group> - </if> - <else> - <text variable="references" prefix="(" suffix=")"/> </else> </choose> </macro> @@ -1510,24 +1758,24 @@ <!-- `treaty`: for treaties --> <!-- `legal_case`: for all legal and court cases --> <!-- `bill`: for bills, resolutions, federal reports --> - <!-- `hearing`: TODO for hearings and testimony --> + <!-- `hearing`: for hearings and testimony --> <!-- `legislation`: for statutes, constitutional items, and charters --> - <!-- `regulation`: TODO codified regulations, uncodified regulations, executive orders --> + <!-- `regulation`: codified regulations, uncodified regulations, executive orders --> <group delimiter=" "> <choose> <if type="treaty"> <group delimiter=", " suffix="."> <!-- APA generally defers to Bluebook for legal citations, but diverges without - explanation for treaty items. We follow the Bluebook format that was used + explanation for treaty items. We follow the Bluebook format that was used in APA 6th ed. --> - <!-- APA manual omits treaty parties/authors, but per Bluebook + <!-- APA manual omits treaty parties/authors, but per Bluebook they should be included at least for bilateral treaties. --> <names variable="author"> <name initialize-with="." form="short" delimiter="-"/> </names> <text macro="date-legal"/> - <!-- APA manual omits treaty source/report called for by Bluebook in favor of just URL. - Both are included here, following the APA style used for all other item types + <!-- APA manual omits treaty source/report called for by Bluebook in favor of just URL. + Both are included here, following the APA style used for all other item types to end the reference with a period, then give the URL afterward. --> <text macro="container-legal"/> </group> @@ -1553,7 +1801,7 @@ <text variable="title" text-case="title"/> </if> <else-if type="hearing"> - <!-- APA uses a comma delimiter and omits "hearing before the" for hearings with testimony, + <!-- APA uses a comma delimiter and omits "hearing before the" for hearings with testimony, but follows Bluebook rules (colon delimiter, prefix before the committee name) for references to the whole hearing. We simply follow the Bluebook rules for both, but use APA style capitalization (not capitalizing "Before" or the title of the hearing). --> @@ -1609,14 +1857,14 @@ </group> <choose> <if variable="issued"> - <!-- APA manual includes "rev." before the revision year, + <!-- APA manual includes "rev." before the revision year, but this isn't part of the Bluebook rules. --> <date variable="issued"> <date-part name="year"/> </date> </if> <else> - <!-- Show proposal date for uncodified regualtions. + <!-- Show proposal date for uncodified regualtions. Assume date is entered literally ala "proposed May 23, 2016". TODO: Add 'proposed' term here if that becomes available --> <date variable="submitted" form="text"/> @@ -1682,10 +1930,10 @@ <text variable="genre"/> <group delimiter=" "> <choose> - <!-- TODO: What was the logic for this? Do we still need this? --> - <!-- If there is no session number or code/record title, print number. - Is that trying to capture congressional reports/documents? --> + <!-- If there is no session number or code/record title, assume + assume the item is a congressional report and include 'No.' term. --> <if variable="chapter-number container-title" match="none"> + <!-- The item is a congressional report, rather than a bill or resultion. --> <label variable="number" form="short" text-case="capitalize-first"/> </if> </choose> @@ -1789,14 +2037,14 @@ </choose> </macro> <macro name="citation-locator"> - <!-- TODO: Add new locator types? --> + <!-- Abbreviate page and paragraph, leave other locator labels in long form, cf. Rule 8.13 --> <group delimiter=" "> <choose> - <if locator="chapter"> - <label variable="locator" text-case="capitalize-first"/> + <if locator="page paragraph" match="any"> + <label variable="locator" form="short"/> </if> <else> - <label variable="locator" form="short"/> + <label variable="locator" text-case="capitalize-first"/> </else> </choose> <text variable="locator"/> @@ -1827,17 +2075,9 @@ </sort> <layout> <choose> - <!-- TODO: Add new item types --> <if type="bill hearing legal_case legislation regulation treaty" match="any"> <!-- Legal items have different orders and delimiters --> - <choose> - <if variable="DOI URL" match="any"> - <text macro="legal-cites"/> - </if> - <else> - <text macro="legal-cites" suffix="."/> - </else> - </choose> + <text macro="legal-cites"/> </if> <else> <group delimiter=" "> diff --git a/Master/texmf-dist/tex/latex/citation-style-language/styles/ieee.csl b/Master/texmf-dist/tex/latex/citation-style-language/styles/ieee.csl index 9ac71c63eaf..98b666b83e9 100644 --- a/Master/texmf-dist/tex/latex/citation-style-language/styles/ieee.csl +++ b/Master/texmf-dist/tex/latex/citation-style-language/styles/ieee.csl @@ -44,8 +44,8 @@ <category citation-format="numeric"/> <category field="engineering"/> <category field="generic-base"/> - <summary>IEEE style as per the 2021 guidelines, V 01.29.2021.</summary> - <updated>2024-01-11T14:39:58-05:00</updated> + <summary>IEEE style as per the 2023 guidelines, V 11.29.2023.</summary> + <updated>2024-07-15T10:30:07-04: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"> @@ -56,6 +56,7 @@ </date> <terms> <term name="chapter" form="short">ch.</term> + <term name="chapter-number" form="short">ch.</term> <term name="presented at">presented at the</term> <term name="available at">available</term> </terms> @@ -120,6 +121,7 @@ <substitute> <names variable="editor"/> <names variable="translator"/> + <text macro="director"/> </substitute> </names> </macro> @@ -129,6 +131,12 @@ <label form="short" prefix=", " text-case="capitalize-first"/> </names> </macro> + <macro name="director"> + <names variable="director"> + <name and="text" et-al-min="7" et-al-use-first="1" initialize-with=". "/> + <et-al font-style="italic"/> + </names> + </macro> <macro name="locators"> <group delimiter=", "> <text macro="edition"/> @@ -148,7 +156,7 @@ </macro> <macro name="title"> <choose> - <if type="bill book graphic legal_case legislation motion_picture song" match="any"> + <if type="bill book graphic legal_case legislation motion_picture song standard software" match="any"> <text variable="title" font-style="italic"/> </if> <else> @@ -374,6 +382,10 @@ <text macro="collection"/> <text macro="publisher"/> <text macro="issued"/> + <group delimiter=" "> + <label variable="chapter-number" form="short"/> + <text variable="chapter-number"/> + </group> <text macro="page"/> </group> <text macro="access"/> @@ -399,6 +411,26 @@ </group> <text macro="access"/> </else-if> + <else-if type="software"> + <group delimiter=". " suffix="."> + <text macro="title"/> + <text macro="issued" prefix="(" suffix=")"/> + <text variable="genre"/> + <text macro="publisher"/> + </group> + <text macro="access"/> + </else-if> + <else-if type="article"> + <group delimiter=", " suffix="."> + <text macro="title"/> + <text macro="issued"/> + <group delimiter=": "> + <text macro="publisher" font-style="italic"/> + <text variable="number"/> + </group> + </group> + <text macro="access"/> + </else-if> <else-if type="webpage post-weblog post" match="any"> <group delimiter=", " suffix="."> <text macro="title"/> @@ -423,6 +455,18 @@ </group> <text macro="access"/> </else-if> + <else-if type="standard"> + <group delimiter=", " suffix="."> + <text macro="title"/> + <group delimiter=" "> + <text variable="genre"/> + <text variable="number"/> + </group> + <text macro="geographic-location"/> + <text macro="issued"/> + </group> + <text macro="access"/> + </else-if> <!-- Generic/Fallback Formats --> <else-if type="bill book graphic legal_case legislation report song" match="any"> <group delimiter=", " suffix=". "> |