Preserve case of all titles #269
Comments
My motivation for this feature request is that I generate my
|
Actually the "untitlecase" feature in the BibTeX reader
is active only when lang is "en". So if you switch your
lang to something else (either with LANG or in the csl
file locale information) it won't do the case transform.
But that's probably not useful advice if you're writing
in English.
I note that Text.CSL.Input.Bibtex exports
readBibtexString :: Bool -> Bool -> String -> IO [Reference]
readBibtexString isBibtex caseTransform contents = do
What you'd need is a way to set 'caseTransform' to False.
But the only place this function is called, in
Text.CSL.Input.Bibutils, the parameter is set to True.
We could think about making this user-configurable, since
the hooks for this are there. But so far we've been trying
to imitate BibTeX's and BibLaTeX's behavior.
+++ Shaun Jackman [Nov 23 16 16:09 ]:
… I'm using this CSL file:
[1]http://www.zotero.org/styles/genome-research. It results in all
paper titles being converted to sentence case, that is, all capital
letters except the first are changed to lowercase laters. I'd like to
preserve the case as it is in my .bib file. I read the README.md about
using {foo} to protect case. Is there an option to preserve the case of
all titles? As a workaround I changed each title={…} to title={{…}},
which worked. The workaround is easy enough, so no worries if there is
no such option.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [2]view it on GitHub, or [3]mute the
thread.
References
1. http://www.zotero.org/styles/genome-research
2. #269
3. https://github.com/notifications/unsubscribe-auth/AAAL5OL6UheVi2S86Qh43Ia8ddETe0aaks5rBNW3gaJpZM4K7KYd
|
IIRC, pandoc-citeproc's "untitlecase" feature does not pay attention to What pandoc-citeproc does, correctly, is to look for per-entry information in the Hence adding
And this is precisely why I would not encourage making this user-configurable. |
+++ Nick Bart [Nov 24 16 01:30 ]:
IIRC, pandoc-citeproc' "untitlecase" feature does not pay attention to
LANG or csl file locale information - nor should it, since the
conversion only makes sense on a per-entry basis.
What pandoc-citeproc does, correctly, is to look for per-entry
information in the langid field (no "untitlecase" when langid contains
something other than english [or variants; for details, see the
biblatex manual]).
Hence adding langid={xx} to problematic entries should work just as
well as changing title={…} to title={{…}}.
... so far we've been trying to imitate BibTeX's and BibLaTeX's
behavior.
Thanks for the clarification, I had forgotten that!
And this is precisely why I would not encourage making this
user-configurable.
Still, I'm not sure there's no point to accommodating things
like doi.org's broken bibtex entries. You might think that
the answer is to get doi.org to fix their bibtex entries.
But I suspect the problem is that they can't. I assume
they've got these entries stored in their database as
regular titlecase strings, probably just taken from the
journal itself. In "On the Representation of de Bruijn
Graphs," there is nothing that tells you that the R in
"Representation" is just capitalized because of titlecase
while the B in "Bruijn" needs to stay capitalized. So they
really couldn't return something like
{On the Representation of de {B}ruijn Graphs}
even if they wanted to. Of course, they could return
{{On the Representation of de Bruijn Graphs}}
but that wouldn't be ideal either, since we need to
support bib formats that use sentence case. (On the
other hand, avoiding untitlecase would have the same
drawback.)
|
I'd say that, for the time being, curating your own database is the only answer if you want high-quality metadata. So far, publishers, and crossref etc. are just too unreliable: I've seen all kinds of things in titles from crossref: title-case, sentence-case, missing titles, titles in all-caps, etc. |
Just to illustrate this a bit further: The following are a small selection from a random sample of crossref entries (obtained via 2x
|
The work around is easy enough for me. Feel free to close this issue as |
This issue is still relevant to me. In case anyone stumbles on this issue, here's a simple # Concatentate the citations with and without DOI.
# Preserve title case.
%.bib: %.doi.bib %.other.bib
sort $^ \
| sed -E \
-e 's/title={([^}]*)},/title={{\1}},/' \
-e 's~http://dx.doi.org~https://doi.org~' \
>$@ |
Hi sjackman, how to use your code to work? I am new to this. I just started use pandoc and need to preserve the title too. Thanks. |
I'm using this CSL file: http://www.zotero.org/styles/genome-research. It results in all paper titles being converted to sentence case, that is, all capital letters except the first are changed to lowercase laters. I'd like to preserve the case as it is in my
.bib
file. I read the README.md about using{foo}
to protect case. Is there an option to preserve the case of all titles? As a workaround I changed eachtitle={…}
totitle={{…}}
, which worked. The workaround is easy enough, so no worries if there is no such option.The text was updated successfully, but these errors were encountered: