From ef36320aaee193f6aedb88b60b7daa458911ea21 Mon Sep 17 00:00:00 2001 From: Zeping Lee Date: Wed, 4 Sep 2024 17:08:38 +0800 Subject: [PATCH] Fix form="long" in style locale --- citeproc/citeproc-node-label.lua | 4 + citeproc/citeproc-node-locale.lua | 2 +- .../local/fullstyles_ApaCollectionTitle.txt | 2190 +++++++++++++++++ tests/latex/luatex-1/style-apa.tlg | 6 +- 4 files changed, 2198 insertions(+), 4 deletions(-) create mode 100644 tests/fixtures/local/fullstyles_ApaCollectionTitle.txt diff --git a/citeproc/citeproc-node-label.lua b/citeproc/citeproc-node-label.lua index 67b6ec3e..ca4b106e 100644 --- a/citeproc/citeproc-node-label.lua +++ b/citeproc/citeproc-node-label.lua @@ -54,6 +54,10 @@ function Label:from_node(node) return o end +---@param engine CiteProc +---@param state table +---@param context Context +---@return Rendered? function Label:build_ir(engine, state, context) -- local variable = context:get_variable(self.variable, self.form) diff --git a/citeproc/citeproc-node-locale.lua b/citeproc/citeproc-node-locale.lua index 9d103f94..9f479562 100644 --- a/citeproc/citeproc-node-locale.lua +++ b/citeproc/citeproc-node-locale.lua @@ -214,7 +214,7 @@ function Terms:from_node(node) end local key = term.name - if form then + if form and form ~= "long" then key = key .. '/form-' .. form end -- if gender then diff --git a/tests/fixtures/local/fullstyles_ApaCollectionTitle.txt b/tests/fixtures/local/fullstyles_ApaCollectionTitle.txt new file mode 100644 index 00000000..8b80a094 --- /dev/null +++ b/tests/fixtures/local/fullstyles_ApaCollectionTitle.txt @@ -0,0 +1,2190 @@ +>>===== MODE =====>> +bibliography +<<===== MODE =====<< + + +>>===== DESCRIPTION =====>> + +<<===== DESCRIPTION =====<< + + +>>===== RESULT =====>> +
+
Blackwell, D. L., Lucas, J. W., & Clarke, T. C. (2014). Summary health statistics for U.S. adults: National Health Interview Survey, 2012 (Vital and Health Statistics Series 10, Issue 260). Centers for Disease Control and Prevention. https://www.atlantic.org/images/publications/Democratic_Defense_Against_Disinformation_FINAL.pdf
+
+<<===== RESULT =====<< + + +>>===== CSL =====>> + + +<<===== CSL =====<< + + +>>===== INPUT =====>> +[ + { + "id": "10.4:52", + "type": "report", + "author": [ + { + "family": "Blackwell", + "given": "D. L." + }, + { + "family": "Lucas", + "given": "J. W." + }, + { + "family": "Clarke", + "given": "T. C." + } + ], + "collection-number": "10", + "collection-title": "Vital and Health Statistics Series", + "issue": "260", + "issued": { + "date-parts": [ + [ + 2014 + ] + ] + }, + "publisher": "Centers for Disease Control and Prevention", + "title": "Summary health statistics for U.S. adults: National Health Interview Survey, 2012", + "title-short": "Summary health statistics for U.S. adults", + "URL": "https://www.atlantic.org/images/publications/Democratic_Defense_Against_Disinformation_FINAL.pdf" + } +] +<<===== INPUT =====<< + + +>>===== VERSION =====>> +1.0 +<<===== VERSION =====<< diff --git a/tests/latex/luatex-1/style-apa.tlg b/tests/latex/luatex-1/style-apa.tlg index c569e4d8..637527d6 100644 --- a/tests/latex/luatex-1/style-apa.tlg +++ b/tests/latex/luatex-1/style-apa.tlg @@ -160,7 +160,7 @@ The sequence \l__csl_bibliography_seq contains the items (without outer braces): > {\bibitem {10.4:50c} National Cancer Institute. (2018). \textit {Facing forward: Life after cancer treatment} (NIH Publication No. 18-2424). \url {https://www.cancer.gov/publications/patient-education/life-after-cancer-treatment.pdf}} > {\bibitem {10.4:51a} Fried, D., \& Polyakova, A. (2018). \textit {Democratic defense against disinformation}. Atlantic Council. \url {https://www.atlantic.org/images/publications/Democratic_Defense_Against_Disinformation_FINAL.pdf}} > {\bibitem {10.4:51b} Segaert, A., \& Bauer, A. (2015). \textit {The extent and nature of veteran homelessness in Canada}. Employment and Social Development Canada. \url {https://www.canada.ca/en/employment-social-development/programs/communities/homelessness/publications-bulletins/veterans-report.html}} -> {\bibitem {10.4:52} Blackwell, D. L., Lucas, J. W., \& Clarke, T. C. (2014). \textit {Summary health statistics for U.S. adults: National Health Interview Survey, 2012} (Vital and Health Statistics Series 10, Number 260). Centers for Disease Control and Prevention. \url {https://www.atlantic.org/images/publications/Democratic_Defense_Against_Disinformation_FINAL.pdf}} +> {\bibitem {10.4:52} Blackwell, D. L., Lucas, J. W., \& Clarke, T. C. (2014). \textit {Summary health statistics for U.S. adults: National Health Interview Survey, 2012} (Vital and Health Statistics Series 10, Issue 260). Centers for Disease Control and Prevention. \url {https://www.atlantic.org/images/publications/Democratic_Defense_Against_Disinformation_FINAL.pdf}} > {\bibitem {10.4:53} British Cardiovascular Society Working Group. (2016). \textit {British Cardiovascular Society Working Group Report: Out-of-Hours Cardiovascular Care: Management of Cardiac Emergencies and Hospital In-patients}. British Cardiovascular Society. \url {http://www.bcs.com/documents/BCSOOHWP_Final_Report_05092016.pdf}} > {\bibitem {10.4:54} U.S. Securities and Exchange Commission. (2017). \textit {Agency financial report: Fiscal year 2017}. \url {https://www.sec.gov/files/sec-2017-agency-financial-report.pdf}} > {\bibitem {10.4:55a} American Counseling Association. (2014). \textit {2014 ACA code of ethics}. \url {https://www.counseling.org/knowledge-center}} @@ -180,11 +180,11 @@ The sequence \l__csl_bibliography_seq contains the items (without outer braces): > {\bibitem {10.6:64} Harris, L. (2014). \textit {Instructional leadership perceptions and practices of elementary school leaders} [Unpublished doctoral dissertation]. University of Virginia.} > {\bibitem {10.6:65} Hollander, M. M. (2017). \textit {Resistance to authority: Methodological innovations and new lessons from the Milgram experiment} (Doctoral Dissertation No. 10289373). ProQuest Dissertations and Theses Global.} > {\bibitem {10.6:66} Hutcheson, V. H. (2012). \textit {Dealing with dual differences: Social coping strategies of gifted and lesbian, gay, bisexual, transgender, and queer adolescents} [Master’s thesis, William \& Mary Digital Archive]. \url {https://digitalarchive.wm.edu/bitstream/handle/10288/16594/HutchesonVirginia2012.pdf}} -> {\bibitem {10.7:67} Mirabito, L. A., \& Heck, N. C. (2016). Bringing LGBTQ youth theater into the spotlight [Review of film \textit {The year we thought about love}, by E. Brodsky]. \textit {Psychology of Sexual Orientation and Gender Diversity}, \textit {3}(4), 499–500. \url {https://doi.org/10.1037/sgd0000205}} +> {\bibitem {10.7:67} Mirabito, L. A., \& Heck, N. C. (2016). Bringing LGBTQ youth theater into the spotlight [Review of the film \textit {The year we thought about love}, by E. Brodsky]. \textit {Psychology of Sexual Orientation and Gender Diversity}, \textit {3}(4), 499–500. \url {https://doi.org/10.1037/sgd0000205}} > {\bibitem {10.7:67r} Brodsky, E. (2016). \textit {The year we thought about love} [Film].} > {\bibitem {10.7:68} Santos, F. (2019, January 11). Reframing refugee children’s stories [Review of \textit {We are Displaced: My Journey and Stories From Refugee Girls Around the World}, by M. Yousafzai]. \textit {The New York Times}. \url {https://nyt.ms/2Hlgjk3}} > {\bibitem {10.7:68r} Yousafzai, M. (2016). \textit {We are Displaced: My Journey and Stories From Refugee Girls Around the World}.} -> {\bibitem {10.7:69} Perkins, D. (2018, February 1). \textit {\textup {The good place} ends its Remarkable Second Season With Irrational Hope, Unexpected Gifts, and a Smile} [Review of tv series episode \textit {Somewhere else}, by M. Schur]. \url {https://www.avclub.com/the-good-place-ends-its-remarkable-second-season-with-i-1822649316}} +> {\bibitem {10.7:69} Perkins, D. (2018, February 1). \textit {\textup {The good place} ends its Remarkable Second Season With Irrational Hope, Unexpected Gifts, and a Smile} [Review of the tv series episode \textit {Somewhere else}, by M. Schur]. \url {https://www.avclub.com/the-good-place-ends-its-remarkable-second-season-with-i-1822649316}} > {\bibitem {10.7:69r} Schur, M. (2018). \textit {Somewhere else} [TV series episode].} > {\bibitem {10.8:70} Yoo, J., Miyamoto, Y., Rigotti, A., \& Ryff, C. (2016). \textit {Linking positive affect to blood lipids: A cultural perspective} [Unpublished Manuscript]. Department of Psychology, University of Wisconsin-Madison.} > {\bibitem {10.8:71} O’Shea, M. (2018). \textit {Understanding proactive behaviour in the workplace as a function of gender} [Manuscript in preparation]. Department of Management, University of Kansas.}