feat: Add option to preserve TeX markup in cache#865
Draft
benthamite wants to merge 2 commits into
Draft
Conversation
Co-authored-by: aider (gemini/gemini-2.5-pro-preview-06-05) <aider@aider.chat>
This was referenced Jul 1, 2025
Contributor
|
I'll take a look at this soon, but note that the CI check is failing currently, and you can convert this to a draft to indicate it's "not ready" status. |
Contributor
Author
|
I didn't know about the ‘draft’ option, thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NB: the PR is not ready to be merged. Please read below for a description of the required additional changes.
The PR introduces a new user option,
citar-cache-preserve-markup, to control whether TeX markup is preserved in bibliography fields when populating the Citar cache. This helps address issues with incorrect capitalization in formatted references, as reported in #784.Problem
When using
citar-insert-referencewithciteproc-el, titles and other fields may not be capitalized correctly. This is becausecitar's caching mechanism, which usesparsebib-parse, strips TeX markup by default. For example, a title like{Can humans be the {FORTRAN} of creatures?}becomes"Can humans be the fortran of creatures?", losing the intended capitalization of "FORTRAN".Solution
This change introduces a new boolean custom variable,
citar-cache-preserve-markup.nil(the default),citarmaintains the existing behavior of stripping TeX markup.t,citarpreserves TeX markup by passing:display niltoparsebib-parse.The cache invalidation logic has also been updated. The cache will now be rebuilt if the value of
citar-cache-preserve-markupchanges, ensuring that the cached entries reflect the user's current setting.Known Issues
Preserving markup across all fields can have side effects on downstream processors like
citeproc-el, which may not expect markup in certain fields (e.g.,dateorauthor). This can lead to parsing errors or incorrect formatting for those fields.This change provides a way to solve the capitalization issue, but a full solution requires improvements to the parsers in
citeproc-el. Since I don’t understand the inner workings of this other package, I am not able to implement those changes myself.