emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-bibtex: "TYPE" property conflicting with bibtex's "type" parameter
@ 2011-09-19 19:46 Lluís
  2011-09-20 15:20 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Lluís @ 2011-09-19 19:46 UTC (permalink / raw)
  To: emacs-orgmode

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 =       {John Doe},
  title =        {One Title},
  school =       {University of Somewhere},
  year =         2011,
  type =         {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").


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.

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

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

* Re: org-bibtex: "TYPE" property conflicting with bibtex's "type" parameter
  2011-09-19 19:46 org-bibtex: "TYPE" property conflicting with bibtex's "type" parameter Lluís
@ 2011-09-20 15:20 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-09-20 15:20 UTC (permalink / raw)
  To: Lluís; +Cc: emacs-orgmode

Lluís <xscript@gmx.net> 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 =       {John Doe},
>   title =        {One Title},
>   school =       {University of Somewhere},
>   year =         2011,
>   type =         {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.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

end of thread, other threads:[~2011-09-20 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-19 19:46 org-bibtex: "TYPE" property conflicting with bibtex's "type" parameter Lluís
2011-09-20 15:20 ` Eric Schulte

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