My question is not about LaTeX, it is about BibDesk.
Steps to reproduce the problem.
Go to settings, TeX preview, enter "elsarticle-num" without quotes in BiBTeX
style menu/field. Validate.
Copy:
@book{wigner,
author = {Eugene Paul Wigner},
doi = {10.1007/978-3-663-02555-9},
publisher = {Springer},
title = {{Gruppentheorie und ihre Anwendung auf die Quantenmechanik der
Atomspektren}},
year = {1931}}
On BibDesk, add this entry with alt+cmd+L.
Select this new entry if necessary.
Click on Editing. On "Doi" field, there is a little icon with "@" at the right
side, if you click, you go to the Springer page about this book. Works as
expected.
Return on BibDesk app, click on TeX Preview.
This will work as expected and displays:
[1] E. P. Wigner, Gruppentheorie und ihre Anwendung auf die Quantenmechanik der
Atomspektren, Springer, 1931. doi:10.1007/978-3-663-02555-9.
Perfect.
Yet, copy this entry:
@Inbook{Wigner1931,
author="Wigner, Eugen",
title="Vektoren und Matrizen",
bookTitle="Gruppentheorie und ihre Anwendung auf die Quantenmechanik der
Atomspektren",
year="1931",
publisher="Vieweg+Teubner Verlag",
address="Wiesbaden",
pages="1--13",
isbn="978-3-663-02555-9",
doi="10.1007/978-3-663-02555-9_1",
url="https://doi.org/10.1007/978-3-663-02555-9_1"
}
On BibDesk, add this entry with alt+cmd+L.
Select this new entry if necessary.
Click on Editing. On "Doi" field, tere is a little icon with "@" at the right
side, if you click, you go to the Springer page about the chapter "Vektoren und
Matrizen" of this book. Works as expected.
Return on BibDesk app, click on TeX Preview.
No surprise, this don't work, because of the "_" in the doi and the url field.
So what to do? Replace _ by \_ in the doi and url field?
OK, I will try this.
doi="10.1007/978-3-663-02555-9\_1",
url="https://doi.org/10.1007/978-3-663-02555-9\_1"
I click on TeX Preview.
It works. The TeX Preview displays:
[1] E. Wigner, Vektoren und Matrizen, Vieweg+Teubner Verlag, Wiesbaden, 1931,
pp. 1–13. doi:10.1007/978-3-663-02555-9_1.
URL https://doi.org/10.1007/978-3-663-02555-9_1
Not sure if this is totally correct, because the _ in the url seems not be a
displayed with a tt font.
But anyway, if you click then on Editing, and the little icon "@" at right of
the field doi (or url), you go to
https://doi.org/10.1007/978-3-663-02555-9%5C_1 and this display :
DOI NOT FOUND
(displayed on https://www.doi.org/ page).
So what is the right way to have at the same time:
a doi with "_" which works with the TeX Preview AND which works when we click
on the "@" icon in the doi field when we are in Editing mode?
Does BibDesk need an update, so it understands "\_" in the doi field as "_", or
does the TeX Preview (more precisely ~/Library/Application
Support/BibDesk/previewtemplate.tex) be updated so it displays a TeX Preview
even if the doi field contains a "_" (without a backslash) ?
I know that in pure LaTeX, I cannot directly write
"https://doi.org/10.1007/978-3-663-02555-9_1", but I can for example load the
package url and then write \url{https://doi.org/10.1007/978-3-663-02555-9_1}.
But here my question is about what to do in the doi field in BibDesk, so that:
• click on the "@" icon at right side of the field works ;
• and the TeX preview also works.
If this is impossible, the better is to remove the "@" icon in the doi and the
url field. Or remove the TeX Preview.
But I hope there is another solution.
Thanks.
> Le 22 mai 2024 à 23:03, Christiaan Hofman <[email protected]> a écrit :
>
> Perhaps the discussion in
> <https://tex.stackexchange.com/questions/383678/underscore-in-bibtex-url> can
> help.
>
> Christiaan
>
>> On 22 May 2024, at 21:48, quark67 via Bibdesk-users
>> <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> How to manage the underscore in DOI or url specifically in BibDesk?
>>
>> What is the recommended method?
>>
>> We cannot replace "_" by "\_" because in the DOI or url field of BibDesk,
>> there is a little icon which open the browser to the DOI website with the
>> number in the DOI field, or to the url displayed in the url field, and an
>> address like https://www.my-example.com/a\_test
>> <https://www.my-example.com/a/_test> is NOT the same address as the address
>> https://www.my-example.com/a_test.
>>
>> AND if the "_" is not replaced by "\_", the preview TeX for the bibliography
>> entry cannot be created (a red error is displayed instead).
>>
>> So, please, what is the recommendation for this problem? A complete guide to
>> this problem can be useful (on the website or the user help).
>>
>> If the file ~/Library/Application Support/BibDesk/previewtemplate.tex has to
>> be edited for this problem, what is the edit to do? I have tried adding
>> \usepackage[strings]{underscore} in the preamble, but this don't work
>> (suggested here: https://tex.stackexchange.com/a/523253/132405).
>>
>> I don't understand why the DOI organization has chosen the character "_" as
>> available character for DOI numbers, as the TeX world uses a lot of DOI, and
>> "_" is special in the TeX world, but this is another question, not for here.
>>
>> For testing, I use in the setting, TeX preview, the "elsarticle-num" BiBTeX
>> style (manually entered).
>>
>> By the way, why this above popup menu don't display all available .bst in
>> the LaTeX installation, a least the .bst in
>> /usr/local/texlive/2024/texmf-dist/bibtex/bst? If this list is too big,
>> there is perhaps a middle between the actual situation (it displays only
>> abbrv, abbrvnat, acm, alpha, amsalpha, amsplain, apalike, gerabbrv,
>> geralpha, gerapali, gerplain, ieeetr, jurabib, jureco, plabbrv, plalpha,
>> plplain, plainnat, siam. Not abbrv-fr, plain-fr for the French, for example).
>>
>> The help says about the list in the popup menu: "This is a list of generic
>> styles that may or may not exist on your system." Perhaps, but why few
>> styles for German or Polish, and not French (and other languages)?
>>
>> Thanks.
>
> _______________________________________________
> Bibdesk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users