emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* capitalization of titles in org-ref
@ 2016-12-02 14:20 Georg W. Otto
  2016-12-02 14:28 ` John Kitchin
  0 siblings, 1 reply; 5+ messages in thread
From: Georg W. Otto @ 2016-12-02 14:20 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I am not completely sure if the problem is caused by org-ref or
somwehere else in the process, but here it is:

When importing a paper by doi using

doi-utils-add-bibtex-entry-from-doi

the title is capitalized. I want to switch off this behaviour, leaving
the paper title in its original capitalization state. Any idea how I can
do this?

Cheers,

Georg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: capitalization of titles in org-ref
  2016-12-02 14:20 capitalization of titles in org-ref Georg W. Otto
@ 2016-12-02 14:28 ` John Kitchin
  2016-12-03 18:33   ` Georg W. Otto
  0 siblings, 1 reply; 5+ messages in thread
From: John Kitchin @ 2016-12-02 14:28 UTC (permalink / raw)
  To: Georg W. Otto; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

That happens because of the function org-ref-title-case-article in the
variable org-ref-clean-bibtex-entry-hook.

Just set org-ref-clean-bibtex-entry-hook to have what you want in it in
your init files to prevent the title casing from occurring.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Fri, Dec 2, 2016 at 9:20 AM, Georg W. Otto <g.otto@ucl.ac.uk> wrote:

> Hi,
>
> I am not completely sure if the problem is caused by org-ref or
> somwehere else in the process, but here it is:
>
> When importing a paper by doi using
>
> doi-utils-add-bibtex-entry-from-doi
>
> the title is capitalized. I want to switch off this behaviour, leaving
> the paper title in its original capitalization state. Any idea how I can
> do this?
>
> Cheers,
>
> Georg
>
>
>

[-- Attachment #2: Type: text/html, Size: 1592 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: capitalization of titles in org-ref
  2016-12-02 14:28 ` John Kitchin
@ 2016-12-03 18:33   ` Georg W. Otto
  2016-12-03 20:35     ` John Kitchin
  0 siblings, 1 reply; 5+ messages in thread
From: Georg W. Otto @ 2016-12-03 18:33 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> That happens because of the function org-ref-title-case-article in the
> variable org-ref-clean-bibtex-entry-hook.
>
> Just set org-ref-clean-bibtex-entry-hook to have what you want in it
> in your init files to prevent the title casing from occurring.
>

Thanks a lot for your answer. Unfortunately I am not very elisp-savy, so
excuse me if I did something silly. I set
org-ref-clean-bibtex-entry-hook in my init file and commented out
org-ref-title-case-article like this:

(setq bibtex-dialect 'biblatex)

(setq org-ref-clean-bibtex-entry-hook
  '(orcb-key-comma
    org-ref-replace-nonascii
    orcb-&
    orcb-%
    ;; org-ref-title-case-article
    orcb-clean-year
    orcb-key
    orcb-clean-doi
    orcb-clean-pages
    org-ref-sort-bibtex-entry))

(setq bibtex-align-at-equal-sign t
      bibtex-autokey-name-year-separator ""
      bibtex-autokey-year-title-separator ""
      bibtex-autokey-titleword-separator ""
      bibtex-autokey-titleword-first-ignore '("the" "a" "if" "and" "an")
      bibtex-autokey-titleword-length 30
      bibtex-autokey-titlewords 3
      bibtex-autokey-titleword-case-convert-function (quote identity)
      bibtex-autokey-name-case-convert-function (quote capitalize)
      bibtex-autokey-year-length 4
      )

As intended, the title words do not get capitalized, but now the bibtex
key only contains <author><yyyy><first title word>. Instead I need the
first three title words, in order to stay compatible with my existing
bibtex library. Any idea?

Cheers,

Georg

-- 
Georg Otto
The UCL Institute of Child Health

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: capitalization of titles in org-ref
  2016-12-03 18:33   ` Georg W. Otto
@ 2016-12-03 20:35     ` John Kitchin
  2016-12-04 17:51       ` Georg W. Otto
  0 siblings, 1 reply; 5+ messages in thread
From: John Kitchin @ 2016-12-03 20:35 UTC (permalink / raw)
  To: Georg W. Otto; +Cc: emacs-orgmode

you could try commenting out orcb-key too. it should be using the
bibtex-autokey settings though.

Georg W. Otto writes:

> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> That happens because of the function org-ref-title-case-article in the
>> variable org-ref-clean-bibtex-entry-hook.
>>
>> Just set org-ref-clean-bibtex-entry-hook to have what you want in it
>> in your init files to prevent the title casing from occurring.
>>
>
> Thanks a lot for your answer. Unfortunately I am not very elisp-savy, so
> excuse me if I did something silly. I set
> org-ref-clean-bibtex-entry-hook in my init file and commented out
> org-ref-title-case-article like this:
>
> (setq bibtex-dialect 'biblatex)
>
> (setq org-ref-clean-bibtex-entry-hook
>   '(orcb-key-comma
>     org-ref-replace-nonascii
>     orcb-&
>     orcb-%
>     ;; org-ref-title-case-article
>     orcb-clean-year
>     orcb-key
>     orcb-clean-doi
>     orcb-clean-pages
>     org-ref-sort-bibtex-entry))
>
> (setq bibtex-align-at-equal-sign t
>       bibtex-autokey-name-year-separator ""
>       bibtex-autokey-year-title-separator ""
>       bibtex-autokey-titleword-separator ""
>       bibtex-autokey-titleword-first-ignore '("the" "a" "if" "and" "an")
>       bibtex-autokey-titleword-length 30
>       bibtex-autokey-titlewords 3
>       bibtex-autokey-titleword-case-convert-function (quote identity)
>       bibtex-autokey-name-case-convert-function (quote capitalize)
>       bibtex-autokey-year-length 4
>       )
>
> As intended, the title words do not get capitalized, but now the bibtex
> key only contains <author><yyyy><first title word>. Instead I need the
> first three title words, in order to stay compatible with my existing
> bibtex library. Any idea?
>
> Cheers,
>
> Georg


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: capitalization of titles in org-ref
  2016-12-03 20:35     ` John Kitchin
@ 2016-12-04 17:51       ` Georg W. Otto
  0 siblings, 0 replies; 5+ messages in thread
From: Georg W. Otto @ 2016-12-04 17:51 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> you could try commenting out orcb-key too. it should be using the
> bibtex-autokey settings though.
>

If I do that, the key is omitted altogether. I did some further
searching and testing, and I came to the conclusion that the autokey
generator ignores all non-capitalized words in its default setting

(defcustom bibtex-autokey-titleword-ignore
  '("A" "An" "On" "The" "Eine?" "Der" "Die" "Das"
    "[^A-Z].*" ".*[^a-zA-Z0-9].*")

so in my init file I set it like this:

(setq bibtex-autokey-titleword-ignore '("A" "An" "On" "The" "of"))

Now it works the way I want it.

Thanks for your help.

Georg

-- 
Georg Otto
The UCL Institute of Child Health

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-04 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-02 14:20 capitalization of titles in org-ref Georg W. Otto
2016-12-02 14:28 ` John Kitchin
2016-12-03 18:33   ` Georg W. Otto
2016-12-03 20:35     ` John Kitchin
2016-12-04 17:51       ` Georg W. Otto

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).