Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for bibtex/natbib command \citeyearpar (equivalent to biblatex command \parencite*) [improving compatibility] #52

Open
saudbinayed opened this issue Jan 19, 2024 · 1 comment

Comments

@saudbinayed
Copy link

I have not tried this package in LaTeX yet, but it looks very handy and a game changer (for sure) to boost citation formatting!

I always work with "author-year" (e.g. Harvard family) citation styles. Usually, I have several citations in the form of "year-only" as the author(s) are typed explicitly in the text. The latex commands are \citeyearpar in natbib/bibtex, or the \parencite* in biblatex.

This package ("citation-style-language"/ "citeproc-lua") appears to not provide the translation of the above ("year-only") citation commands. I have scanned the source files in this repo and found the "suppress-author" property, defined at: #L199

I am curious to see if the following code can provide the needed feature (i.e. to define a translation for the \citeyearpar and \parencite*):

Edits to the file: ./latex/citation-style-language-cite.sty

  • Add this at Line #34:

\NewDocumentCommand \citeyearpar { o o m } { \__csl_cite_year:nnn {#1} {#2} {#3} }

\NewDocumentCommand \parencite*{ o o m } { \__csl_cite_year:nnn {#1} {#2} {#3} }

  • Add this at Line #114:
    \cs_new:Npn \__csl_cite_year:nnn #1#2#3 { \seq_clear:N \l__csl_cite_keys_seq \seq_clear:N \l__csl_citation_items_seq \prop_clear:N \l__csl_citation_properties_prop \__csl_process_cite_input:nnn {#1} {#2} {#3} \__csl_process_citation_info:NN \l__csl_cite_keys_seq \l__csl_citation_items_seq \prop_put:Nnn \l__csl_citation_properties_prop { noteIndex } { 0 } \prop_put:Nnn \l__csl_citation_properties_prop { mode } { suppress-author} \bool_set_false:N \l__csl_note_bool \__csl_make_citation:N \l__csl_citation_info_prop }

End of suggestions.

I am not sure if the suggestions above will be successful to add the needed feature to provide compatibility for natbib command \citeyearpar and the equivalent biblatex command \parencite*. In particular, I don't know the actual behaviour of \l__csl_citation_properties_prop { mode } { suppress-author}: does it just print the year-only citation?

Thanks for providing such very practical package.

@saudbinayed saudbinayed changed the title support for bibtex/natbib command \citeyearpar (equivalent to biblatex command \parencite* [improving compatibility] support for bibtex/natbib command \citeyearpar (equivalent to biblatex command \parencite*) [improving compatibility] Jan 19, 2024
zepinglee added a commit that referenced this issue Mar 10, 2024
@zepinglee
Copy link
Owner

Thanks for you appreciation and the \citeyearpar and \parencite* commands are added in 19cb3f7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants