emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [patch] add :url and :doi optional entries for export to BiBTeX
Date: Mon, 28 Jun 2021 13:59:51 +0100	[thread overview]
Message-ID: <87lf6u16wo.fsf@ucl.ac.uk> (raw)
In-Reply-To: <87tuli17pp.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Mon, 28 Jun 2021 13:42:26 +0100")

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

I introduced an error in the previous patch.  Please use this one.
Thank you,

: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-571-gc591be
: Latest paper written in org: https://arxiv.org/abs/2106.05096

[-- Attachment #2: 0001-ol-bibtex-Added-url-and-doi-as-optional-entries-for-.patch --]
[-- Type: text/x-diff, Size: 7803 bytes --]

From ddad85139bd508a06db6e98ddef0131f7cc9946e Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Mon, 28 Jun 2021 13:35:34 +0100
Subject: [PATCH] ol-bibtex: Added url and doi as optional entries for BiBTeX

* lisp/ol-bibtex.el: :doi and :url entries added to optional list of
entries to export to BiBTeX when present in the properties.

* etc/ORG-NEWS: added news item noting this change.
 etc/ORG-NEWS      |  3 +++
 lisp/ol-bibtex.el | 31 +++++++++++++++++--------------
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 956f1cf19..3f3971961 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -349,6 +349,9 @@ argument is present.  You can also set =:async no= to force it off
 Async evaluation is disabled during export.
 ** Miscellaneous
+*** =org-bibtex= includes =doi= and =url= entries when exporting to BiBTeX
+=doi= and =url= entries have been made optional for some publication
+types and will be exported if present for those types.
 *** Missing or empty placeholders in "eval" macros are now =nil=
 They used to be the empty string.
 *** =org-goto-first-child= now works before first heading
diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el
index 57b240d92..bad4c7e54 100644
--- a/lisp/ol-bibtex.el
+++ b/lisp/ol-bibtex.el
@@ -145,59 +145,59 @@
      (:description . "An article from a journal or magazine")
      (:required :author :title :journal :year)
-     (:optional :volume :number :pages :month :note))
+     (:optional :volume :number :pages :month :note :doi))
      (:description . "A book with an explicit publisher")
      (:required (:editor :author) :title :publisher :year)
-     (:optional (:volume :number) :series :address :edition :month :note))
+     (:optional (:volume :number) :series :address :edition :month :note :doi))
      (:description . "A work that is printed and bound, but without a named publisher or sponsoring institution.")
      (:required :title)
-     (:optional :author :howpublished :address :month :year :note))
+     (:optional :author :howpublished :address :month :year :note :doi :url))
      (:description . "")
      (:required :author :title :booktitle :year)
-     (:optional :editor :pages :organization :publisher :address :month :note))
+     (:optional :editor :pages :organization :publisher :address :month :note :doi :url))
      (:description . "A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.")
      (:required (:author :editor) :title (:chapter :pages) :publisher :year)
-     (:optional :crossref (:volume :number) :series :type :address :edition :month :note))
+     (:optional :crossref (:volume :number) :series :type :address :edition :month :note :doi))
      (:description . "A part of a book having its own title.")
      (:required :author :title :booktitle :publisher :year)
-     (:optional :crossref :editor (:volume :number) :series :type :chapter :pages :address :edition :month :note))
+     (:optional :crossref :editor (:volume :number) :series :type :chapter :pages :address :edition :month :note :doi))
      (:description . "An article in a conference proceedings")
      (:required :author :title :booktitle :year)
-     (:optional :crossref :editor (:volume :number) :series :pages :address :month :organization :publisher :note))
+     (:optional :crossref :editor (:volume :number) :series :pages :address :month :organization :publisher :note :doi))
      (:description . "Technical documentation.")
      (:required :title)
-     (:optional :author :organization :address :edition :month :year :note))
+     (:optional :author :organization :address :edition :month :year :note :doi :url))
      (:description . "A Master’s thesis.")
      (:required :author :title :school :year)
-     (:optional :type :address :month :note))
+     (:optional :type :address :month :note :doi :url))
      (:description . "Use this type when nothing else fits.")
-     (:optional :author :title :howpublished :month :year :note))
+     (:optional :author :title :howpublished :month :year :note :doi :url))
      (:description . "A PhD thesis.")
      (:required :author :title :school :year)
-     (:optional :type :address :month :note))
+     (:optional :type :address :month :note :doi :url))
      (:description . "The proceedings of a conference.")
      (:required :title :year)
-     (:optional :editor (:volume :number) :series :address :month :organization :publisher :note))
+     (:optional :editor (:volume :number) :series :address :month :organization :publisher :note :doi))
      (:description . "A report published by a school or other institution.")
      (:required :author :title :institution :year)
-     (:optional :type :address :month :note))
+     (:optional :type :address :month :note :doi :url))
      (:description . "A document having an author and title, but not formally published.")
      (:required :author :title :note)
-     (:optional :month :year)))
+     (:optional :month :year :doi :url)))
   "Bibtex entry types with required and optional parameters.")
 (defvar org-bibtex-fields
@@ -207,6 +207,7 @@
     (:booktitle    . "Title of a book, part of which is being cited.  See the LaTeX book for how to type titles.  For book entries, use the title field instead.")
     (:chapter      . "A chapter (or section or whatever) number.")
     (:crossref     . "The database key of the entry being cross referenced.")
+    (:doi          . "The digital object identifier.")
     (:edition      . "The edition of a book for example, 'Second'.  This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.")
     (:editor       . "Name(s) of editor(s), typed as indicated in the LaTeX book.  If there is also an author field, then the editor field gives the editor of the book or collection in which the reference appears.")
     (:howpublished . "How something strange has been published.  The first word should be capitalized.")
@@ -223,6 +224,7 @@
     (:series       . "The name of a series or set of books.  When citing an entire book, the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.")
     (:title        . "The work’s title, typed as explained in the LaTeX book.")
     (:type         . "The type of a technical report for example, 'Research Note'.")
+    (:url          . "Uniform resource locator.")
     (:volume       . "The volume of a journal or multi-volume book.")
     (:year         . "The year of publication or, for an unpublished work, the year it was written.  Generally it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four nonpunctuation characters are numerals, such as '(about 1984)'"))
   "Bibtex fields with descriptions.")
@@ -507,6 +509,7 @@ ARG, when non-nil, is a universal prefix argument.  See
        :key (cdr (assoc "=key=" entry))
        :author (or (cdr (assoc "author" entry)) "[no author]")
+       :doi (or (cdr (assoc "doi" entry)) "[no doi]")
        :editor (or (cdr (assoc "editor" entry)) "[no editor]")
        :title (or (cdr (assoc "title" entry)) "[no title]")
        :booktitle (or (cdr (assoc "booktitle" entry)) "[no booktitle]")

  reply	other threads:[~2021-06-28 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 12:42 [patch] add :url and :doi optional entries for export to BiBTeX Eric S Fraga
2021-06-28 12:59 ` Eric S Fraga [this message]
2021-07-01 14:23   ` Timothy
2021-07-01 15:54     ` Eric S Fraga
2021-07-01 21:16       ` Nicolas Goaziou
2021-07-02  7:59         ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf6u16wo.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


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).