From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: org-bibtex: "TYPE" property conflicting with bibtex's "type" parameter Date: Tue, 20 Sep 2011 09:20:59 -0600 Message-ID: <87ty87tf38.fsf@gmail.com> References: <87ipoo1fk2.fsf@ginnungagap.bsc.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R628P-0001Kq-U7 for emacs-orgmode@gnu.org; Tue, 20 Sep 2011 11:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R628O-0003yx-3n for emacs-orgmode@gnu.org; Tue, 20 Sep 2011 11:21:21 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:61371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R628N-0003yr-QA for emacs-orgmode@gnu.org; Tue, 20 Sep 2011 11:21:19 -0400 Received: by ywe9 with SMTP id 9so514015ywe.0 for ; Tue, 20 Sep 2011 08:21:18 -0700 (PDT) In-Reply-To: <87ipoo1fk2.fsf@ginnungagap.bsc.es> (=?utf-8?Q?=22Llu=C3=ADs?= =?utf-8?Q?=22's?= message of "Mon, 19 Sep 2011 21:46:05 +0200") 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: =?utf-8?Q?Llu=C3=ADs?= Cc: emacs-orgmode@gnu.org Llu=C3=ADs writes: > The current org-bibtex code uses the value of the "TYPE" property for two= different purposes: > > * identify the type of bibtex entry > * give a value to the "type" parameter in a bibtex entry > > Using the "TYPE" property for both has the unfortunate effect that on > an entry type like "phdthesis" (which has an optional "type" > parameter), the resulting text contains the "phdthesis" text insteaad > of the default "PhD thesis" text produced by bibtex when the "type" > parameter is not set. > > For example, this: > > #+bein_source org > * One Title > :PROPERTIES: > :TITLE: One Title > :TYPE: phdthesis > :AUTHOR: John Doe > :SCHOOL: University of Somewhere > :YEAR: 2011 > :CUSTOM_ID: myid > :END: > #+end_source > > results in the following bibtex entry: > > #+begin_source bibtex > @phdthesis{myid, > author =3D {John Doe}, > title =3D {One Title}, > school =3D {University of Somewhere}, > year =3D 2011, > type =3D {phdthesis} > } > #+end_source > > which is processed into the following text: > > #+begin_source fundamental > [1] J. Doe. One Title. phdthesis, University of Somewhere, 2011. > #+end_source > > instead of the desired: > > #+begin_source fundamental > [1] J. Doe. One Title. PhD thesis, University of Somewhere, 2011. > #+end_source > > The only way out I see is to use different properties for the bibtex > entry type and bibtex's "type" parameter. Preferably using a different > property for org-bibtex to identify the entry type (e.g., > "BIBTEX_TYPE"). > Hi Lluis, Thanks for catching this! I should have checked for this conflict when initially creating this package. I'm making the name of the "type" property configurable and setting the default value to "btype". For those who want to keep using "type" on existing files the following should restore the current behavior after updating Org-mode. #+begin_src emacs-lisp (setf org-bibtex-type-property-name "btype") #+end_src For those who want to switch to the new property name please update org-mode and ensure that `org-bibtex-type-property-name' has a value, then call the following function in every Org-mode file which has bibtex entries. #+begin_src emacs-lisp (defun org-bibtex-replace-type-with-btype () (interactive) (replace-regexp (concat "^" (regexp-quote " :TYPE:")) (format " :%s:" (upcase org-bibtex-type-property-name)= ))) #+end_src Sorry for the breaking change but this should be an improvement moving forward. Best -- Eric > > > Thanks a lot, > Lluis > > PS: I'm not subscribed to the list, so please put me in CC if you want me= to read you. --=20 Eric Schulte http://cs.unm.edu/~eschulte/