bibtex export issue: capital greek in title
Hi,
When using bibtex export, I noticed the following:
Greek letters in the title get converted to lower-case by the IEEE citation style. This is undesired (e.g. \Sigma-\Delta modulator becomes \sigma-\delta modulator). I fixed this by editing bibtex.js:
"\u03A3":"$\\Sigma$", // GREEK Sigma
becomes
"\u03A3":"{$\\Sigma$}", // GREEK Sigma
The curly braces protect the capital letters from being converted to lower case downstream.
I did this for the whole set of capital greek letters from line 1621 through 1630 in bibtex.js
I don't know if this is the proper proper place to fix this, but it worked for me.
Best regards,
Paul
When using bibtex export, I noticed the following:
Greek letters in the title get converted to lower-case by the IEEE citation style. This is undesired (e.g. \Sigma-\Delta modulator becomes \sigma-\delta modulator). I fixed this by editing bibtex.js:
"\u03A3":"$\\Sigma$", // GREEK Sigma
becomes
"\u03A3":"{$\\Sigma$}", // GREEK Sigma
The curly braces protect the capital letters from being converted to lower case downstream.
I did this for the whole set of capital greek letters from line 1621 through 1630 in bibtex.js
I don't know if this is the proper proper place to fix this, but it worked for me.
Best regards,
Paul
<span class="nocase">Σ</span>
. This will work for both the bibtex export and for Zotero-generated bibliographies in Word/LO (which would otherwise suffer the same problem). Zotero doesn't have math sections, so as far as Zotero is concerned,Σ
is just a letter, not a math symbol.If I'd diverge from the Zotero behavior, I'm not sure whether I should apply it to non-latin, or non-ascii (are there cases where latin non-ascii is used as a symbol rather than a letter?). It could maybe be done without too much fallout; if a title is actually greek (or something else non-ascii/non-latin), it should have a language marked, and that would disable title-casing anyway.
I tried the Σ method, but I do not get the desired results. Instead, I get:
@phdthesis{risbo_span_1994,
address = {Lyngby},
type = {Ph.{D}. dissertation},
title = {{\textless}span class="nocase"{\textgreater}$\Sigma${\textless}/span{\textgreater}-{\textless}span class="nocase"{\textgreater}$\Delta${\textless}/span{\textgreater} {Modulators}--{Stability} {Analysis} and {Optimization}},
......
so now the citekey uses the word 'span' as first word in the title and the generated code for the title is equally useless.
What am I doing wrong?
Paul
Best regards,
Paul
<span class="nocase">...</span>
. Can you try to install BBT (https://retorque.re/zotero-better-bibtex/installation/) and then export using "Better BibTeX" instead of "BibTeX"?Yes, quite obviously this works.
However, the question was posted for standard bibtex export using bibtex.js, not better bibtex. Better bibtex has other issues.
Is there a reason not to implement my suggestion in bibtex.js?
Best regards,
Paul
What other issues does BBT have?
Well, the original question suggested to edit bibtex.js. I don't think that file is used by better bibtex.
Better bibtex seems to use a similar trick since it generates {{$\Sigma\Delta$}} in the bib file.
The suggested better bibtex solution with span for the thesis "Σ-Δ Modulators--Stability Analysis and Optimization", changes the citekey to risbo_cite_1994 . As if the first word of the title is 'span'. The default key without the 'span' trick is: risbo_-_1994. I think this is preferable, but a zotero issue.
Issues in better bibtex:
Better bibtex does not replace dashes in the page range like bibtex.js does.
Better bibtex replaces µ with $\mathrm{\mu}$ instead of \textmu. This does not produce an upright µ for me. (issue already opened)
Best regards,
Paul
Ah true, I missed that
Similar in what sense?
That sounds like a bug. I'd appreciate it if you could open an issue for that on BBT.
That is correct -- BBT does replace dashes (including the space replacement you asked about elsewhere), but uses different rules. If those don't work out well for you, I'd appreciate a bug report.
Saw it, thanks; I need a bit more input, but I agree it's a bug and that can be fixed today.
With similar I meant that BBT adds curly braces around a math environment, which prevents changing of the Sigma and Delta from upper to lower case.
This is similar to the change in bibtex.js that I suggested:
"\u03A3":"$\\Sigma$", // GREEK Sigma
becomes
"\u03A3":"{$\\Sigma$}", // GREEK Sigma
With respect to risbo_cite_1994 because 'cite' is the first word in the title: isn't that a zotero bug, instead of a BBT bug?, since i have my key generation set to [zotero:clean].
Thanks for your replies, I will open a case on the dashes, but need to do some actual work first...
Paul
[zotero]
pattern generates the citekey exactly like Zotero does, but it's still BBT generating it, so this is a BBT bug.BBT only generates
{$...$}
instead of$...$
when it thinks it is in a case-protected section. If you added<span class="nocase">...</span>
around that section, that would be correct, otherwise, it's a bug. The similarity would then be the$\Sigma\Delta$
; BBT generates extra braces for the nocase span, stock bibtex treats the span as text. Correct? I'm asking because that seems significantly dissimilar to me.I just checked. The title (no`span'-stuff, just the plain greek characters ):
Σ-Δ Modulators--Stability Analysis and Optimization
becomes
title = {{$\Sigma$}-{{$\Delta$ Modulators}}--{{Stability Analysis}} and {{Optimization}}},
with better bibtex export.
Somehow every capitalized word seems to be case protected, even without using the span stuff. Is that how it was supposed to work?
With bibtex.js export, I get
title = {$\Sigma$-$\Delta$ {Modulators}--{Stability} {Analysis} and {Optimization}},
No case protection at all, right?.
The proposed change to bibtex.js would add case protection to $\Sigma$ and $\Delta$. That would then behave similar to BBT. But that's hypothetical, the two are completely different right now.
Best regards,
Paul
PS: how do I insert code in a post (the grey box)? Other forums have some kind of toolbar, but nothing like that on the zotero forum. I also didn't find a forum documentation page.
Sentence Case
to convert the title to sentence case. There is some case-protection there -- all capitalized words have brace protection. The math section doesn't have case-protection, but it looks like math sections don't need it.You can add code by using <code>...</code> tags. The forums accept most HTML tags; if you use firefox, and you're comfortable with markdown, you can install Markdown Editor for Firefox or Markdown Editor for Chrome, type your markdown there and paste the resulting HTML here; that's how I usually do it.
>if you capitalize words those are assumed to be words you want to be capitalized
The problem here is that most of the items in my database were auto-imported from a web browser, not typed by me. Should I conclude that the zotero import filter(s) do not follow zotero recommendations?
Paul
You can turn off BBT's export title casing and brace protection. Turning it off means that what BBT exports does not mean the same as it does in Zotero, and the fact that it usually works is an accident, depending on the style chosen. But you can turn it off.
title = {$\Sigma$-$\Delta$ {Modulators}--{Stability} {Analysis} and {Optimization}},
- Greek letters are not case protected
- the rest of the title is case protected.
When applying IEEEtran citation style, I get
L. Risbo, “σ-δ Modulators–Stability Analysis and Optimization,”
The greek letters should have been case protected, whereas the rest of the title should not have been case protected, since sentence case is IEEE citation style.
On the other hand, zotero recommends to store titles in sentence case, so probably the filter is expecting this and thinks that any explicit casing is intended by the user and thus should be preserved.
Is this correct?
Is there a bulk conversion option then?
Paul
There's no bulk conversion, no (it's also not possible to convert error free automatically given proper nouns). There is a pseudo-sentence case option for individual items by right-clicking on their title.
span
showing up in the citekey has been fixed on BBT master (not yet released), as has the treatment of µ. But for dashes in the pages field -- I see you have123 ---- 432
in the pages field, which becomes123---- 432
when Zotero generates a bibliography from it. BBT exports it aspages = {123 ---- 432},
-- currently, if you have dashes there, I assume you want them. I do translate en-dashes and em-dashes to their LaTeX counterparts, and<spaces><number><spaces><hyphen><spaces><number><spaces>
to<number><en-dash><number>
.The 123 ---- 432 is obviously a test case
Your translation to
<number><en-dash><number>
exactly how I like it. Thanks!Please send a notification when it is released.
Paul
I do appreciate the work being done on better bibtex, but the original suggestion seems to be ignored. Just to repeat:
Is it a good way to fix the capital-greek casing issue by changing
"\u03A3":"$\\Sigma$", // GREEK Sigma
to
"\u03A3":"{$\\Sigma$}", // GREEK Sigma
in Bibtex.js?
Paul