From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leonard Randall Subject: Bug: Error with org-bibtex export with tags when using custom bibtypes [8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /Users/leonardaveryrandall/.emacs.d/elpa/org-plus-contrib-20140324/)] Date: Tue, 25 Mar 2014 21:03:11 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d044280600d37b304f574aec1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSYXF-0000Sp-FM for emacs-orgmode@gnu.org; Tue, 25 Mar 2014 17:05:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSYVA-0005bl-Jc for emacs-orgmode@gnu.org; Tue, 25 Mar 2014 17:03:23 -0400 Received: from mail-oa0-x234.google.com ([2607:f8b0:4003:c02::234]:34010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSYVA-0005bZ-9h for emacs-orgmode@gnu.org; Tue, 25 Mar 2014 17:03:16 -0400 Received: by mail-oa0-f52.google.com with SMTP id l6so1297997oag.25 for ; Tue, 25 Mar 2014 14:03:12 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --f46d044280600d37b304f574aec1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello, When I attempt to run M-x org-bibtex on a .org file with non-standard bibtex types that have a tag, they fail to export if org-bibtex-tags-are-keywords is set to t. This persists even if I add the bibtex type to org-bibtex-types. I checked, and this problem persists with a minimal init file, and a minimal org file. I have also checked, and I get the same problem with Emacs 24.3.5 from emacsforosx. I just started using org-bibtex so I do not know how far the bug goes back. Here is a minimal example that gets the bug. ** Critique of Practical Reason :ex: :PROPERTIES: :TITLE: Critique of Practical Reason :BOOKTITLE: Practical Philosophy :BTYPE: bookinbook :CUSTOM_ID: Kant:1996a :AUTHOR: Kant, Immanuel :PAGES: 133--276 :TRANSLATOR: Gregor, Mary J :EDITOR: Gregor, Mary J :YEAR: 1996 :PUBLISHER: Cambridge University Press :ADDRESS: Cambridge UK :END: I press ``M-x org-bibtex'' it returns ``Bibtex error on "Critique of Practical Reason"". This error does not occur if I change ``BTYPE" to ``book'' or if I remove the tag ``:ex:'' from the headline. As I noted above, I added ``bookinbook'' to the org-bibtex-types and added the appropriate fields there and in org-bibtex-fields. Here is a minimal init: (setq org-bibtex-types '((:article (:description . "An article from a journal or magazine") (:required :author :title :journal :year) (:optional :volume :number :pages :month :note :annote :url :abstract :keywords :file :uri)) (:book (:description . "A book with an explicit publisher") (:required (:editor :author) :title :publisher :year) (:optional (:volume :number) :series (:address :location) :edition :month :note :annote :url :abstract :keywords :file :uri)) (:bookinbook (:description . "A part of a book, which could be, and once was, its own book.") (:required :title (:chapter :pages) :publisher :year :booktitle) (:optional :crossref :author :editor :volume :translator :number :series :type :address :location :edition :note :annote :url :abstract :keywords :file :uri)) (:booklet (:description . "A work that is printed and bound, but without a named publisher or sponsoring institution.") (:required :title) (:optional :author :howpublished (:address :location) :month :year :note :annote :url :abstract :keywords :file :uri)) (:conference (:description . "") (:required :author :title :booktitle :year) (:optional :editor :pages :organization :publisher (:address :location) :month :note :annote :url :abstract :keywords :file :uri)) (:inbook (: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 :location) :edition :month :note :annote :url :abstract :keywords :file :uri)) (:incollection (: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 :location) :edition :month :note :annote :url :abstract :keywords :file :uri)) (:inproceedings (:description . "An article in a conference proceedings") (:required :author :title :booktitle :year) (:optional :crossref :editor (:volume :number) :series :pages (:address :location) :month :organization :publisher :note :annote :url :abstract :keywords :file :uri)) (:manual (:description . "Technical documentation.") (:required :title) (:optional :author :organization (:address :location) :edition :month :year :note :annote :url :abstract :keywords :file :uri)) (:mastersthesis (:description . "A Master=E2 EURO (tm)s thesis.") (:required :author :title :school :year) (:optional :type (:address :location) :month :note :annote :url :abstract :keywords :file :uri)) (:misc (:description . "Use this type when nothing else fits.") (:required) (:optional :author :crossref :booktitle :date :title :howpublished :month :year :note :annote :location :url :abstract :keywords :file :uri)) (:phdthesis (:description . "A PhD thesis.") (:required :author :title :school :year) (:optional :type (:address :location) :month :note :annote :url :abstract :keywords :file :uri)) (:proceedings (:description . "The proceedings of a conference.") (:required :title :year) (:optional :editor (:volume :number) :series (:address :location) :month :organization :publisher :note :annote :url :abstract :keywords :file :uri)) (:techreport (:description . "A report published by a school or other institution."= ) (:required :author :title :institution :year) (:optional :type (:address :location) :month :note :annote :url :abstract :keywords :file :uri)) (:unpublished (:description . "A document having an author and title, but not formally published.") (:required :author :title :note) (:optional :month :year :annote :url :abstract :keywords :file :uri))) ) (setq org-bibtex-fields '((:address . "Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.") (:annote . "An annotation. It is not used by the standard bibliography styles, but may be used by others that produce an annotated bibliography.") (:author . "The name(s) of the author(s), in the format described in the LaTeX book. Remember, all names are separated with the and keyword, and not commas.") (: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.") (: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.") (:institution . "The sponsoring institution of a technical report.") (:journal . "A journal name.") (:key . "Used for alphabetizing, cross-referencing, and creating a label when the author information is missing. This field should not be confused with the key that appears in the \cite command and at the beginning of the database entry.") (:month . "The month in which the work was published or, for an unpublished work, in which it was written. You should use the standard three-letter abbreviation,") (:note . "Any additional information that can help the reader. The first word should be capitalized.") (:number . "Any additional information that can help the reader. The first word should be capitalized.") (:organization . "The organization that sponsors a conference or that publishes a manual.") (:pages . "One or more page numbers or range of numbers, such as 42-111 or 7,41,73-97 or 43+ (the =E2 EURO ~+=E2 EURO (tm) in this last exam= ple indicates pages following that don=E2 EURO (tm)t form simple range). BibTEX requires = double dashes for page ranges (--).") (:publisher . "The publisher=E2 EURO (tm)s name.") (:school . "The name of the school where a thesis was written.") (:series . "The name of a series or set of books. When citing an entire book, the 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=E2 EURO (tm)s title, typed as explained in t= he LaTeX book.") (:type . "The type of a technical report for example, 'Research Note'.") (: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)'") (:url . "A URL for the reference") (:uri . "Another common url field") (:annote . "Annotation is typically not exported") (:abstract . "Abstract for annotated bibliography") (:keywords . "Keywords for sorting with ebib") (:file . "A local file path used by ebib to open the reference in an appropriate application") (:location . "The location published") )) (setq org-bibtex-tags-are-keywords t) (setq org-bibtex-export-arbitrary-fields nil) (setq org-bibtex-prefix nil) It may also be useful to note that if I set ``org-bibtex-prefix'' to "bib" and set ``org-bibtex-export-arbitrary-fields'' to t (and of course edit the property names in my .org file appropriately), I get an error even with standard bib types. Below is the bug report. Thanks so much for your help, All the best, Leonard Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. ------------------------------------------------------------------------ Emacs : GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19) of 2014-03-15 on macintosh-2.home Package: Org-mode version 8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /Users/leonardaveryrandall/.emacs.d/elpa/org-plus-contrib-20140324/) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-confirm-shell-link-function 'yes-or-no-p org-after-todo-state-change-hook '(org-clock-out-if-current) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-hide-inline-tasks org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-bibtex-tags-are-keywords t ) --f46d044280600d37b304f574aec1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

When I attempt to run M-x org-bibtex on a .org file with non-standard bibte= x types that have a tag, they fail to export if org-bibtex-tags-are-keyword= s is set to t. This persists even if I add the bibtex type to org-bibtex-ty= pes.  I checked, and this problem persists with a minimal init file, a= nd a minimal org file. I have also checked, and I get the same problem with= Emacs 24.3.5 from emacsforosx.  I just started using org-bibtex so I = do not know how far the bug goes back.
=
Here is a minimal example that gets the bug.


** Critique of Practical Reason  :ex:
= :PROPERTIES:
:TITLE: Critique of Practical Reason
:BOOKTITLE: Practical Philosophy
:BTYPE: bookinbook
:CUSTOM_ID: K= ant:1996a
= :AUTHOR: Kant, Immanuel
:PAGES: 133--276
:TRANSLATOR: Gregor, Mary J
:EDITOR: Gregor, Mary J
:YEAR:  = 1996
= :PUBLISHER: Cambridge University Press
:ADDRESS: Cambridge UK
:END: 



I press ``M-x org-bibtex'' it returns ``Bibtex error on &= quot;Critique of Practical Reason"". This error does not occur if= I change ``BTYPE" to ``book'' or if I remove the tag ``:ex:&#= 39;' from the headline. As I noted above, I added ``bookinbook''= ; to the org-bibtex-types and added the appropriate fields there and in org= -bibtex-fields.
=


Here is a minimal init:

(setq org-bibtex-types
  '((:article
&nbs= p;    (:description . "An article from a journal or magazine= ")
     (:required :author :title :journal :y= ear)
     (:optional :volume :number :pages :month= :note :annote :url :abstract :keywords :file :uri))
    (:book
     (:description . &qu= ot;A book with an explicit publisher")
     (= :required (:editor :author) :title :publisher :year)
   = ;  (:optional (:volume :number) :series (:address :location) :edition = :month :note :annote :url :abstract :keywords :file :uri))
    (:bookinbook
     (:description= . "A part of a book, which could be, and once was, its own book."= ;)
     (:required :title (:chapter :pages) :publi= sher :year :booktitle)
     (:optional :crossref := author :editor :volume :translator :number :series :type :address :location= :edition :note :annote :url :abstract :keywords :file :uri))
    (:booklet
     (:description . = "A work that is printed and bound, but without a named publisher or sp= onsoring institution.")
     (:required :titl= e)
     (:optional :author :howpublished (:address= :location) :month :year :note :annote :url :abstract :keywords :file :uri)= )
    (:conference
     (:description= . "")
     (:required :author :title :b= ooktitle :year)
     (:optional :editor :pages :or= ganization :publisher (:address :location) :month :note :annote :url :abstr= act :keywords :file :uri))
    (:inbook
     (:description . &= quot;A part of a book, which may be a chapter (or section or whatever) and/= or a range of pages.")
     (:required (:auth= or :editor) :title (:chapter :pages) :publisher :year)
     (:optional :crossref (:volume :number) :series :ty= pe (:address :location) :edition :month :note :annote :url :abstract :keywo= rds :file :uri))
        (:incollection
=
     (:description . "A part of a book having its = own title.")
     (:required :author :title :booktitle :publisher :y= ear)
     (:optional :crossref :editor (:volume :n= umber) :series :type :chapter :pages (:address :location) :edition :month := note :annote :url :abstract :keywords :file :uri))
    (:inproceedings
     (:descript= ion . "An article in a conference proceedings")
  =    (:required :author :title :booktitle :year)
  &= nbsp;  (:optional :crossref :editor (:volume :number) :series :pages (= :address :location) :month :organization :publisher :note :annote :url :abs= tract :keywords :file :uri))
    (:manual
     (:description . &= quot;Technical documentation.")
     (:requir= ed :title)
     (:optional :author :organization (= :address :location) :edition :month :year :note :annote :url :abstract :key= words :file :uri))
    (:mastersthesis
     (:descript= ion . "A Master=E2€™s thesis.")
   = ;  (:required :author :title :school :year)
    &n= bsp;(:optional :type (:address :location) :month :note :annote :url :abstra= ct :keywords :file :uri))
    (:misc
     (:description . &qu= ot;Use this type when nothing else fits.")
    &nb= sp;(:required)
     (:optional :author :crossref := booktitle :date :title :howpublished :month :year :note :annote :location := url :abstract :keywords :file :uri))
    (:phdthesis
     (:description = . "A PhD thesis.")
     (:required :auth= or :title :school :year)
     (:optional :type (:a= ddress :location) :month :note :annote :url :abstract :keywords :file :uri)= )
    (:proceedings
     (:descriptio= n . "The proceedings of a conference.")
    &= nbsp;(:required :title :year)
     (:optional :edi= tor (:volume :number) :series (:address :location) :month :organization :pu= blisher :note :annote :url :abstract :keywords :file :uri))
    (:techreport
     (:description= . "A report published by a school or other institution.")
<= div>     (:required :author :title :institution :year)
=
     (:optional :type (:address :location) :month :note= :annote :url :abstract :keywords :file :uri))
    (:unpublished
     (:descriptio= n . "A document having an author and title, but not formally published= .")
     (:required :author :title :note)
     (:optional :month :year :annote :url :abstract := keywords :file :uri))) )

(setq org-bibtex-fields
  '((:addres= s      . "Usually the address of the publisher or other= type of institution.  For major publishing houses, van Leunen recomme= nds omitting the information entirely.  For small publishers, on the o= ther hand, you can help the reader by giving the complete address.")
    (:annote       . "An annotation. &nb= sp;It is not used by the standard bibliography styles, but may be used by o= thers that produce an annotated bibliography.")
   = ; (:author       . "The name(s) of the author(s), in th= e format described in the LaTeX book.  Remember, all names are separat= ed with the and keyword, and not commas.")
    (:booktitle    . "Title of a book, part o= f which is being cited.  See the LaTeX book for how to type titles. &n= bsp;For book entries, use the title field instead.")
  =   (:chapter      . "A chapter (or section or whate= ver) number.")
    (:crossref     . "The database key of the= entry being cross referenced.")
    (:edition &nb= sp;    . "The edition of a book for example, 'Second'= ;.  This should be an ordinal, and should have the first letter capita= lized, as shown here; the standard styles convert to lower case when necess= ary.")
    (: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 pu= blished.  The first word should be capitalized.")
 = ;   (:institution  . "The sponsoring institution of a techni= cal report.")
    (:journal      . "A journal name.")<= /div>
    (:key          . "Use= d for alphabetizing, cross-referencing, and creating a label when the autho= r information is missing.  This field should not be confused with the = key that appears in the \cite command and at the beginning of the database = entry.")
    (:month        . "The month in = which the work was published or, for an unpublished work, in which it was w= ritten.  You should use the standard three-letter abbreviation,")=
    (:note         . "Any add= itional information that can help the reader.  The first word should b= e capitalized.")
    (:number       . "Any additional inf= ormation that can help the reader.  The first word should be capitaliz= ed.")
    (:organization . "The organization = that sponsors a conference or that publishes a manual.")
    (:pages        . "One or more p= age numbers or range of numbers, such as 42-111 or 7,41,73-97 or 43+ (the = =E2€˜+=E2€™ in this last example indicates pages foll= owing that don=E2€™t form simple range). BibTEX requires double = dashes for page ranges (--).")
    (:publisher    . "The publisher=E2€&= trade;s name.")
    (:school       = . "The name of the school where a thesis was written.")
    (:series       . "The name of a series o= r set of books.  When citing an entire book, the 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=E2&e= uro;™s title, typed as explained in the LaTeX book.")
=     (:type         . "The type of a tech= nical report for example, 'Research Note'.")
  =   (:volume       . "The volume of a journal or mul= ti-volume book.")
    (:year         . "The year of p= ublication or, for an unpublished work, the year it was written.  Gene= rally it should consist of four numerals, such as 1984, although the standa= rd styles can handle any year whose last four nonpunctuation characters are= numerals, such as '(about 1984)'")
    (:url          . "A URL fo= r the reference")
    (:uri       &= nbsp;  . "Another common url field")
   = (:annote       . "Annotation is typically not exported= ")
    (:abstract     . "Abstract for annotated bibli= ography")
    (:keywords     . "Key= words for sorting with ebib")
    (:file   &n= bsp;     . "A local file path used by ebib to open the refer= ence in an appropriate application")
    (:location     . "The location published&= quot;)

))

(setq org-bibte= x-tags-are-keywords t)
(setq org-bibtex-export-arbitrary-fields n= il)
(setq org-bibtex-prefix nil)



It may also be useful to note that if I set ``org-bibtex-prefix&#= 39;' to "bib" and set ``org-bibtex-export-arbitrary-fields= 9;' to t (and of course edit the property names in my .org file appropr= iately), I get an error even with standard bib types. 
=
Below is the bug report.

Thanks so much for your help,
All the best,
Leonard

Remember to cover the basics, that is, what you= expected to happen and
what in fact did happen.  You don't know how to make a good r= eport?  See


Your bug report will be posted to the Org-mode mailing = list.
-----------------------------------------------------------= -------------


Emacs  : GNU Ema= cs 24.3.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19)
 of 2014-03-15 on macintosh-2.home
Package: Org-mode ve= rsion 8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /Users/leonardaveryrandall/.emac= s.d/elpa/org-plus-contrib-20140324/)

current state= :
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(setq
&= nbsp;org-tab-first-hook '(org-hide-block-toggle-maybe
      org-src-na= tive-tab-command-maybe
      org-babel-hide-result-toggle-maybe
     &nbs= p;org-babel-header-arg-expand)
 org-speed-command-hook '= (org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
&nbs= p;org-metaup-hook '(org-babel-load-in-session-maybe)
 or= g-confirm-shell-link-function 'yes-or-no-p
 org-after-to= do-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
     org= -src-mode-configure-edit-buffer)
 org-agenda-before-write-ho= ok '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org= -mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change= -major-mode-hook org-show-block-all
    appen= d local]
 &nbs= p; 5]
 #[nil &= quot;\300\301\302\303\304$\207"
   [org-add-ho= ok change-major-mode-hook
=     org-babel-show-result-all append local]
   5]
 org-babel-result-h= ide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook = '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-= hide-drawers
 =  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-a= fter-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 = ;org-metadown-hook '(org-babel-pop-to-session-maybe)
 or= g-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 = ;org-bibtex-tags-are-keywords t
 )
--f46d044280600d37b304f574aec1--