Browse Source

ol-bibtex: Added url and doi as optional entries for BiBTeX export

* 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.
Eric S Fraga 3 năm trước cách đây
mục cha
commit
d1900adfbe
2 tập tin đã thay đổi với 20 bổ sung14 xóa
  1. 3 0
      etc/ORG-NEWS
  2. 17 14
      lisp/ol-bibtex.el

+ 3 - 0
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.
 Async evaluation is disabled during export.
 
 
 ** Miscellaneous
 ** 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=
 *** Missing or empty placeholders in "eval" macros are now =nil=
 They used to be the empty string.
 They used to be the empty string.
 *** =org-goto-first-child= now works before first heading
 *** =org-goto-first-child= now works before first heading

+ 17 - 14
lisp/ol-bibtex.el

@@ -145,59 +145,59 @@
   '((:article
   '((:article
      (:description . "An article from a journal or magazine")
      (:description . "An article from a journal or magazine")
      (:required :author :title :journal :year)
      (:required :author :title :journal :year)
-     (:optional :volume :number :pages :month :note))
+     (:optional :volume :number :pages :month :note :doi))
     (:book
     (:book
      (:description . "A book with an explicit publisher")
      (:description . "A book with an explicit publisher")
      (:required (:editor :author) :title :publisher :year)
      (:required (:editor :author) :title :publisher :year)
-     (:optional (:volume :number) :series :address :edition :month :note))
+     (:optional (:volume :number) :series :address :edition :month :note :doi))
     (:booklet
     (:booklet
      (:description . "A work that is printed and bound, but without a named publisher or sponsoring institution.")
      (:description . "A work that is printed and bound, but without a named publisher or sponsoring institution.")
      (:required :title)
      (:required :title)
-     (:optional :author :howpublished :address :month :year :note))
+     (:optional :author :howpublished :address :month :year :note :doi :url))
     (:conference
     (:conference
      (:description . "")
      (:description . "")
      (:required :author :title :booktitle :year)
      (:required :author :title :booktitle :year)
-     (:optional :editor :pages :organization :publisher :address :month :note))
+     (:optional :editor :pages :organization :publisher :address :month :note :doi :url))
     (:inbook
     (:inbook
      (:description . "A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.")
      (: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)
      (: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))
     (:incollection
     (:incollection
      (:description . "A part of a book having its own title.")
      (:description . "A part of a book having its own title.")
      (:required :author :title :booktitle :publisher :year)
      (: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))
     (:inproceedings
     (:inproceedings
      (:description . "An article in a conference proceedings")
      (:description . "An article in a conference proceedings")
      (:required :author :title :booktitle :year)
      (: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))
     (:manual
     (:manual
      (:description . "Technical documentation.")
      (:description . "Technical documentation.")
      (:required :title)
      (:required :title)
-     (:optional :author :organization :address :edition :month :year :note))
+     (:optional :author :organization :address :edition :month :year :note :doi :url))
     (:mastersthesis
     (:mastersthesis
      (:description . "A Master’s thesis.")
      (:description . "A Master’s thesis.")
      (:required :author :title :school :year)
      (:required :author :title :school :year)
-     (:optional :type :address :month :note))
+     (:optional :type :address :month :note :doi :url))
     (:misc
     (:misc
      (:description . "Use this type when nothing else fits.")
      (:description . "Use this type when nothing else fits.")
      (:required)
      (:required)
-     (:optional :author :title :howpublished :month :year :note))
+     (:optional :author :title :howpublished :month :year :note :doi :url))
     (:phdthesis
     (:phdthesis
      (:description . "A PhD thesis.")
      (:description . "A PhD thesis.")
      (:required :author :title :school :year)
      (:required :author :title :school :year)
-     (:optional :type :address :month :note))
+     (:optional :type :address :month :note :doi :url))
     (:proceedings
     (:proceedings
      (:description . "The proceedings of a conference.")
      (:description . "The proceedings of a conference.")
      (:required :title :year)
      (:required :title :year)
-     (:optional :editor (:volume :number) :series :address :month :organization :publisher :note))
+     (:optional :editor (:volume :number) :series :address :month :organization :publisher :note :doi))
     (:techreport
     (:techreport
      (:description . "A report published by a school or other institution.")
      (:description . "A report published by a school or other institution.")
      (:required :author :title :institution :year)
      (:required :author :title :institution :year)
-     (:optional :type :address :month :note))
+     (:optional :type :address :month :note :doi :url))
     (:unpublished
     (:unpublished
      (:description . "A document having an author and title, but not formally published.")
      (:description . "A document having an author and title, but not formally published.")
      (:required :author :title :note)
      (:required :author :title :note)
-     (:optional :month :year)))
+     (:optional :month :year :doi :url)))
   "Bibtex entry types with required and optional parameters.")
   "Bibtex entry types with required and optional parameters.")
 
 
 (defvar org-bibtex-fields
 (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.")
     (: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.")
     (:chapter      . "A chapter (or section or whatever) number.")
     (:crossref     . "The database key of the entry being cross referenced.")
     (: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.")
     (: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.")
     (: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.")
     (: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.")
     (: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.")
     (:title        . "The work’s title, typed as explained in the LaTeX book.")
     (:type         . "The type of a technical report for example, 'Research Note'.")
     (: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.")
     (: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)'"))
     (: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.")
   "Bibtex fields with descriptions.")
@@ -507,6 +509,7 @@ ARG, when non-nil, is a universal prefix argument.  See
       (org-link-store-props
       (org-link-store-props
        :key (cdr (assoc "=key=" entry))
        :key (cdr (assoc "=key=" entry))
        :author (or (cdr (assoc "author" entry)) "[no author]")
        :author (or (cdr (assoc "author" entry)) "[no author]")
+       :doi (or (cdr (assoc "doi" entry)) "[no doi]")
        :editor (or (cdr (assoc "editor" entry)) "[no editor]")
        :editor (or (cdr (assoc "editor" entry)) "[no editor]")
        :title (or (cdr (assoc "title" entry)) "[no title]")
        :title (or (cdr (assoc "title" entry)) "[no title]")
        :booktitle (or (cdr (assoc "booktitle" entry)) "[no booktitle]")
        :booktitle (or (cdr (assoc "booktitle" entry)) "[no booktitle]")