zotfile
zotfile copied to clipboard
Short title with N words
Hi, all!
Is it possible to get a short title with, for instance, 3 first words. Like shortTitle in BetterBibTex. I try a personal wildcard:
{
"1": {
"field": "title",
"regex": "((?!\\b(is|are|the|a|an|do|does|can|could|will|would|of|to|and|from)\\b)\\b\\w+\\b)",
"group": 1,
"flag": "gi",
"transform": "capitalize"
}
}
But it is not working.
I have, for instance, this reference:
McNickle G. G. & Dybzinski R. (2013) Game theory and plant ecology. Ecol. Lett. 16 , 545–555.
And I would like rename with title like this: "Game_Theory_Plant" or "GameTheoryPlant"
My rename rule is: {%a_}{%y_}{[%s]_}{%1}
All the best,
Mario
Bumping this! Would love to have this, this is how Bibdesk used to do it for me and the one thing that I really miss from Zotero.
As of Zotfile v5.0.16, you can use the Wildcard for BetterBibTeX citekey (%b). Not a very versatile solution, but if like me you want your citekey as the .pdf name, it's perfect!
I achieved this by chaining two operations: first eliminating unwanted words and then matching the first 3 words of the remaining words.
The definition of extensions.zotfile.wildcards.user
is thus:
{
"z": {
"field": "title",
"operations": [{
"function": "replace",
"regex": "\\b(is|are|the|a|an|as|do|does|can|could|will|would|of|for|in|to|and|from|with|without)\\b",
"replacement": "",
"flags": "gi"
}, {
"function": "exec",
"regex": "(\\b[\\w-]+\\b\\s*?){3}"
}]
}
}