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

$type discards the input on success, which breaks ternaries #2872

Open
retorquere opened this issue May 7, 2024 Discussed in #2868 · 0 comments
Open

$type discards the input on success, which breaks ternaries #2872

retorquere opened this issue May 7, 2024 Discussed in #2868 · 0 comments
Labels

Comments

@retorquere
Copy link
Owner

Discussed in #2868

Originally posted by MemeAddict314 May 7, 2024
Hi! I'm trying to format my citekeys but having issues with ternaries. I'm trying to make the citekey for encyclopedias (specifically Wikipedia) appear different from everything else. My current citekey looks like this:
type(encyclopediaArticle) ? (shorttitle.capitalize + EncyclopediaTitle.capitalize) : (authEtAl.capitalize + year)
It works right for most things, but for some reason it adds journal abbreviations in front of the title on some items. Right now I have these citekeys in these kinds of formats outputted by my citekey:

  • Encyclopedia Name + Shorttitle (correct)
  • Author + Year (wrong with encyclopedias, right for other sources)
  • Journal Abbreviation/Publication + Shorttitle (very wrong)

I've tried a bunch of different options, and I can't find documentation for what I'm looking for. What I'd like to happen would be something like:

If item is (from Wikipedia or an encyclopedia)
Then EncyclopediaTitle.capitalize + shorttitle.capitalize
Else authEtAl.capitalize + year

I don't want the journal name, journal abbreviation, or publication name in the citekey. I want the name of the encyclopedia then the short title only for encyclopedia entries. I'm mainly focused on Wikipedia articles being cited and saved, but I'd prefer if the citekey worked on all encyclopedias. Thank you for any help you can give!

@retorquere retorquere changed the title Custom Citation Key Help $type discards the input on success, which breaks ternaries May 7, 2024
@retorquere retorquere added the bug label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant