From 640cc06ea25ff5bef627203157d960e9c75c34c2 Mon Sep 17 00:00:00 2001 From: Zeping Lee Date: Wed, 10 Jul 2024 10:11:56 +0800 Subject: [PATCH] Fix font style flip-flopping with raw code (#67) --- CHANGELOG.md | 4 ++ tests/fixtures/local/flipflop_Issue67.txt | 67 +++++++++++++++++++++++ tests/latex/luatex-1/issue-67.lvt | 52 ++++++++++++++++++ tests/latex/luatex-1/issue-67.tlg | 16 ++++++ tests/latex/luatex-2/issue-67.lvt | 52 ++++++++++++++++++ tests/latex/luatex-2/issue-67.tlg | 16 ++++++ tests/latex/pdftex-1/issue-67.lvt | 52 ++++++++++++++++++ tests/latex/pdftex-1/issue-67.tlg | 17 ++++++ tests/latex/pdftex-2/issue-67.lvt | 52 ++++++++++++++++++ tests/latex/pdftex-2/issue-67.tlg | 16 ++++++ 10 files changed, 344 insertions(+) create mode 100644 tests/fixtures/local/flipflop_Issue67.txt create mode 100644 tests/latex/luatex-1/issue-67.lvt create mode 100644 tests/latex/luatex-1/issue-67.tlg create mode 100644 tests/latex/luatex-2/issue-67.lvt create mode 100644 tests/latex/luatex-2/issue-67.tlg create mode 100644 tests/latex/pdftex-1/issue-67.lvt create mode 100644 tests/latex/pdftex-1/issue-67.tlg create mode 100644 tests/latex/pdftex-2/issue-67.lvt create mode 100644 tests/latex/pdftex-2/issue-67.tlg diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c4ae9e..cf94a846 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix a bug in font style flip-flopping with raw code ([#67](https://github.com/zepinglee/citeproc-lua/issues/67)). + ## [0.5.0] - 2024-06-09 ### Added diff --git a/tests/fixtures/local/flipflop_Issue67.txt b/tests/fixtures/local/flipflop_Issue67.txt new file mode 100644 index 00000000..af0f660b --- /dev/null +++ b/tests/fixtures/local/flipflop_Issue67.txt @@ -0,0 +1,67 @@ +>>===== MODE =====>> +citation +<<===== MODE =====<< + + +>>===== DESCRIPTION =====>> + +<<===== DESCRIPTION =====<< + + +>>===== RESULT =====>> +\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: “The dove returned to him at sunset, and incredibly, a fresh-picked olive branch was in its mouth!”; lihat Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation +8:11 sebagai penanda keterkejutan: “The dove returned to him at sunset, and incredibly, a fresh-picked olive branch was in its mouth!”; lihat Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation +<<===== RESULT =====<< + + +>>===== CITATION-ITEMS =====>> +[ + [ + { + "id": "Hardy2019-Gemsfr", + "prefix": "\\dots \\ dalam Kej.\\ 8:11 sebagai penanda keterkejutan: “The dove returned to him at sunset, and incredibly, a fresh-picked olive branch was in its mouth!”; lihat " + } + ], + [ + { + "id": "Hardy2019-Gemsfr", + "prefix": "8:11 sebagai penanda keterkejutan: “The dove returned to him at sunset, and incredibly, a fresh-picked olive branch was in its mouth!”; lihat " + } + ] +] +<<===== CITATION-ITEMS =====<< + + +>>===== CSL =====>> + +<<===== CSL =====<< + + +>>===== INPUT =====>> +[ + { + "id": "Hardy2019-Gemsfr", + "type": "book", + "title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation" + } +] +<<===== INPUT =====<< + + +>>===== VERSION =====>> +1.0 +<<===== VERSION =====<< diff --git a/tests/latex/luatex-1/issue-67.lvt b/tests/latex/luatex-1/issue-67.lvt new file mode 100644 index 00000000..75010fe4 --- /dev/null +++ b/tests/latex/luatex-1/issue-67.lvt @@ -0,0 +1,52 @@ +\input{regression-test} + +\documentclass{article} + +% + +\begin{filecontents}[overwrite, noheader]{\jobname.json} +[ + { + "id": "Hardy2019-Gemsfr", + "type": "book", + "author": [ + { + "family": "Hardy", + "given": "H. H.", + "suffix": "II" + } + ], + "title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation", + "title-short": "Gems from Biblical Hebrew", + "publisher-place": "Grand Rapids, MI", + "publisher": "Baker Academic", + "issued": { + "date-parts": [ + [ + "2019" + ] + ] + } + } +] +\end{filecontents} + +\usepackage[style = chicago-fullnote-bibliography]{citation-style-language} +\cslsetup{regression-test = true} +\addbibresource{\jobname.json} + + +\begin{document} +\START + +\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan: +``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11 +sebagai penanda keterkejutan: ``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''; lihat }, +page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} + +\OMIT +\end{document} diff --git a/tests/latex/luatex-1/issue-67.tlg b/tests/latex/luatex-1/issue-67.tlg new file mode 100644 index 00000000..a656ffe3 --- /dev/null +++ b/tests/latex/luatex-1/issue-67.tlg @@ -0,0 +1,16 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}. + } +l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +> \l__csl_citation_tl=\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: “\textit {The dove returned to him at sunset, {\normalshape and incredibly}, a fresh-picked olive branch was in its mouth!}”; lihat H. H. Hardy II, \textit {Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation} (Grand Rapids, MI: Baker Academic, 2019), 194 (tekanan saya).. + } +l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line .... diff --git a/tests/latex/luatex-2/issue-67.lvt b/tests/latex/luatex-2/issue-67.lvt new file mode 100644 index 00000000..75010fe4 --- /dev/null +++ b/tests/latex/luatex-2/issue-67.lvt @@ -0,0 +1,52 @@ +\input{regression-test} + +\documentclass{article} + +% + +\begin{filecontents}[overwrite, noheader]{\jobname.json} +[ + { + "id": "Hardy2019-Gemsfr", + "type": "book", + "author": [ + { + "family": "Hardy", + "given": "H. H.", + "suffix": "II" + } + ], + "title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation", + "title-short": "Gems from Biblical Hebrew", + "publisher-place": "Grand Rapids, MI", + "publisher": "Baker Academic", + "issued": { + "date-parts": [ + [ + "2019" + ] + ] + } + } +] +\end{filecontents} + +\usepackage[style = chicago-fullnote-bibliography]{citation-style-language} +\cslsetup{regression-test = true} +\addbibresource{\jobname.json} + + +\begin{document} +\START + +\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan: +``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11 +sebagai penanda keterkejutan: ``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''; lihat }, +page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} + +\OMIT +\end{document} diff --git a/tests/latex/luatex-2/issue-67.tlg b/tests/latex/luatex-2/issue-67.tlg new file mode 100644 index 00000000..a656ffe3 --- /dev/null +++ b/tests/latex/luatex-2/issue-67.tlg @@ -0,0 +1,16 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}. + } +l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +> \l__csl_citation_tl=\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: “\textit {The dove returned to him at sunset, {\normalshape and incredibly}, a fresh-picked olive branch was in its mouth!}”; lihat H. H. Hardy II, \textit {Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation} (Grand Rapids, MI: Baker Academic, 2019), 194 (tekanan saya).. + } +l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line .... diff --git a/tests/latex/pdftex-1/issue-67.lvt b/tests/latex/pdftex-1/issue-67.lvt new file mode 100644 index 00000000..75010fe4 --- /dev/null +++ b/tests/latex/pdftex-1/issue-67.lvt @@ -0,0 +1,52 @@ +\input{regression-test} + +\documentclass{article} + +% + +\begin{filecontents}[overwrite, noheader]{\jobname.json} +[ + { + "id": "Hardy2019-Gemsfr", + "type": "book", + "author": [ + { + "family": "Hardy", + "given": "H. H.", + "suffix": "II" + } + ], + "title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation", + "title-short": "Gems from Biblical Hebrew", + "publisher-place": "Grand Rapids, MI", + "publisher": "Baker Academic", + "issued": { + "date-parts": [ + [ + "2019" + ] + ] + } + } +] +\end{filecontents} + +\usepackage[style = chicago-fullnote-bibliography]{citation-style-language} +\cslsetup{regression-test = true} +\addbibresource{\jobname.json} + + +\begin{document} +\START + +\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan: +``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11 +sebagai penanda keterkejutan: ``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''; lihat }, +page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} + +\OMIT +\end{document} diff --git a/tests/latex/pdftex-1/issue-67.tlg b/tests/latex/pdftex-1/issue-67.tlg new file mode 100644 index 00000000..f17ac34e --- /dev/null +++ b/tests/latex/pdftex-1/issue-67.tlg @@ -0,0 +1,17 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}. + } +l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +LaTeX Warning: Citation `Hardy2019-Gemsfr' on page 1 undefined on input line .... +> \l__csl_citation_tl=[\textbf {Hardy2019-Gemsfr}]. + } +l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line .... diff --git a/tests/latex/pdftex-2/issue-67.lvt b/tests/latex/pdftex-2/issue-67.lvt new file mode 100644 index 00000000..75010fe4 --- /dev/null +++ b/tests/latex/pdftex-2/issue-67.lvt @@ -0,0 +1,52 @@ +\input{regression-test} + +\documentclass{article} + +% + +\begin{filecontents}[overwrite, noheader]{\jobname.json} +[ + { + "id": "Hardy2019-Gemsfr", + "type": "book", + "author": [ + { + "family": "Hardy", + "given": "H. H.", + "suffix": "II" + } + ], + "title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation", + "title-short": "Gems from Biblical Hebrew", + "publisher-place": "Grand Rapids, MI", + "publisher": "Baker Academic", + "issued": { + "date-parts": [ + [ + "2019" + ] + ] + } + } +] +\end{filecontents} + +\usepackage[style = chicago-fullnote-bibliography]{citation-style-language} +\cslsetup{regression-test = true} +\addbibresource{\jobname.json} + + +\begin{document} +\START + +\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan: +``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11 +sebagai penanda keterkejutan: ``\emph{The dove returned to him +at sunset, \emph{and incredibly}, a fresh-picked olive branch +was in its mouth!}''; lihat }, +page = {194 (tekanan saya)}]{Hardy2019-Gemsfr} + +\OMIT +\end{document} diff --git a/tests/latex/pdftex-2/issue-67.tlg b/tests/latex/pdftex-2/issue-67.tlg new file mode 100644 index 00000000..627a7a5a --- /dev/null +++ b/tests/latex/pdftex-2/issue-67.tlg @@ -0,0 +1,16 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}. + } +l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +> \l__csl_citation_tl=\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: “\textit {The dove returned to him at sunset, {\normalshape and incredibly}, a fresh-picked olive branch was in its mouth!}”; lihat H. H. Hardy II, \textit {Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation} (Grand Rapids, MI: Baker Academic, 2019), 194 (tekanan saya).. + } +l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr} +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line .... +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line ....