retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.3k stars 284 forks source link

feature request: auth&al #941

Closed bothide closed 6 years ago

bothide commented 6 years ago

To generate citekeys for .bib entries for use with BibTeX that agree with the citekeys in my already existing huge .bib database, I need a citekey function "auth&al", say, that is similar to "authEtAl" but where the author (last) names, in case of exactly two, are separated by "&" (ampersand). In the case of more than two authors, the (last) name of the first author should be given, appended by "&al". Is that doable?

Examples from one of my existing .bib files:

@ARTICLE{Thide&al:PRL:2007,
 AUTHOR = "B. Thid{\'e} and H. Then and J. Sj{\"o}holm and K. Palmer and
                    J. Bergman and T. D. Carozzi and Ya. N. Istomin and
                    N. H. Ibragimov and R. Khamitova",
 TITLE  = "Utilization of photon orbital angular momentum in the
          low-frequency radio domain",
 JOURNAL= PRL,
 VOLUME = 99,
 NUMBER = 8,
 PAGES  = "087701(4)",
 MONTH  = "22 August",
 DOI    = "10.1103/PhysRevLett.99.087701",
 YEAR   = 2007,
}

@ARTICLE{Mendonca&Thide:EPL:2008,
 AUTHOR  = "J. T. Mendon\c{c}a and B. Thid{\'e}",
 TITLE   = "Neutrino orbital angular momentum in a plasma vortex",
 JOURNAL = EPL,
 VOLUME  = 84,
 PAGES   = "41001(4)",
 MONTH   = "14 November",
 YEAR    = 2008,
}

@ARTICLE{Tamburini&al:NPHY:2011,
 AUTHOR  = "Fabrizio Tamburini and Bo Thid\'e and Gabriel Molina-Terriza
            and Gabriele Anzolin",
 TITLE   = "Twisting of light around rotating black holes",
 JOURNAL = NPHY,
 VOLUME  = 7,
 NUMBER  = 3,
 PAGES   = "195-197",
 MONTH   = feb,
 DOI     = "10.1038/NPHYS1907",
 YEAR    = 2011,
}

The acronyms for the (abbreviated) journal names are included in the .bib files in the form of @STRINGs:

@STRING{PRL = "Phys.\ Rev.\ Lett."}
@STRING{EPL = "Europhys.\ Lett."}
@STRING{NPHY = "Nature Phys."}

and so on...

blip-bloop commented 6 years ago

:robot: this is your friendly neighborhood build bot announcing test build 5.0.112.6149.issue-941 ("Merge branch 'master' into 941").

retorquere commented 6 years ago

If you try build 6149 (linked above) you could use [auth.etal:replace=.etal,&al] for a pattern. If that works to your satisfaction (replace is new), I can merge it to master.

blip-bloop commented 6 years ago

:robot: this is your friendly neighborhood build bot announcing test build 5.0.112.6162.issue-941 ("auth joiner").

bothide commented 6 years ago

Thanks! Will test at once...

Bo

On 3 April 2018 at 11:20, blip-bloop notifications@github.com wrote:

🤖 this is your friendly neighborhood build bot announcing test build 5.0.112.6149.issue-941 https://github.com/retorquere/zotero-better-bibtex/releases/download/builds/zotero-better-bibtex-5.0.112.6149.issue-941.xpi ("Merge branch 'master' into 941").

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/retorquere/zotero-better-bibtex/issues/941#issuecomment-378185273, or mute the thread https://github.com/notifications/unsubscribe-auth/AHlBJCdzYmsmKMSeByi0gZoTwNa3S1WPks5tkz7YgaJpZM4TEJxF .

--


Emeritus Professor Dr Bo Thidé https://www.researchgate.net/profile/Bo_Thide Swedish Institute of Space Physics (IRF), P. O. Box 537, SE-751 21 Uppsala Phone: Office +46184715902 Mobile/Cell +46705613670 Home +46184951801 Visiting address: Ångström Laboratory, Rm# 84108, Lägerhyddsvägen 1, Uppsala

bothide commented 6 years ago

Hi,

Thanks a lot. This works as far as the replacement ".etal" --> "&al" goes, but in the case when there are exactly two authors, these two author names are still separated by a ".", whereas I should like them to be separated by "&".

Bo

PS. I have used TeX and LaTex/BibTeX for three decades and have a huge .bib database...

On 3 April 2018 at 11:22, Emiliano Heyns notifications@github.com wrote:

If you try build 6149 (linked above) you could use [auth.etal:replace=.etal,&al] for a pattern. If that works to your satisfaction (replace is new), I can merge it to master.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/retorquere/zotero-better-bibtex/issues/941#issuecomment-378185795, or mute the thread https://github.com/notifications/unsubscribe-auth/AHlBJF9_Pu93HkE3Sz5JKTEVZScnlFkxks5tkz8_gaJpZM4TEJxF .

--


Emeritus Professor Dr Bo Thidé https://www.researchgate.net/profile/Bo_Thide Swedish Institute of Space Physics (IRF), P. O. Box 537, SE-751 21 Uppsala Phone: Office +46184715902 Mobile/Cell +46705613670 Home +46184951801 Visiting address: Ångström Laboratory, Rm# 84108, Lägerhyddsvägen 1, Uppsala

bothide commented 6 years ago

By experimenting, I just found that the 6162.issue-941 build can indeed generate the correct format with the following: [auth.etal:replace=.etal,&al:replace=.,&]

retorquere commented 6 years ago

Alright, merged to master and will drop as .114

bothide commented 6 years ago

Fine!

On Tue, 3 Apr 2018, 23:56 Emiliano Heyns, notifications@github.com wrote:

Alright, merged to master and will drop as .114

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/retorquere/zotero-better-bibtex/issues/941#issuecomment-378411915, or mute the thread https://github.com/notifications/unsubscribe-auth/AHlBJGnaDmjdNMUcXbFmJwyRJrxQdh7lks5tk--SgaJpZM4TEJxF .

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.