Re: [patch] add :url and :doi optional entries for export to BiBTeX

2021-07-02 Thread Eric S Fraga
On Thursday,  1 Jul 2021 at 23:16, Nicolas Goaziou wrote:
> Applied. Thanks to both of you.

Thank you!

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



Re: [patch] add :url and :doi optional entries for export to BiBTeX

2021-07-01 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> On Thursday,  1 Jul 2021 at 22:23, Timothy wrote:
>> I've not used Org for exporting to BibTeX, so I don't really know what
>> I'm on about, but is there any particular reason why only some entries
>> have :url ? Other than that, this seems like a fairly straightforward
>> patch.
>
> First of all, it's an optional entry so only exported if present. What
> I did was consider which types of publications would tend to have
> a URL instead of other bibliographic information and only include for
> those where it would likely necessary. For instance, journal articles
> will be given a DOI so a URL is less useful; technical reports,
> however, are likely to be hosted at an institution's web site so a URL
> is likely useful.
>
> But I must admit that I didn't spend much time thinking about which
> ones should have it. I didn't want all of them because I often store
> the URL for a journal article in the org file just for quick access
> but I do not want it exported to BiBTeX as it would be messy and
> superfluous when the paper were cited.
>
> I'm glad the patch seemed straightforward!  Thank you.

Applied. Thanks to both of you.

Regards,
-- 
Nicolas Goaziou



Re: [patch] add :url and :doi optional entries for export to BiBTeX

2021-07-01 Thread Eric S Fraga
On Thursday,  1 Jul 2021 at 22:23, Timothy wrote:
> I've not used Org for exporting to BibTeX, so I don't really know what
> I'm on about, but is there any particular reason why only some entries
> have :url ? Other than that, this seems like a fairly straightforward
> patch.

First of all, it's an optional entry so only exported if present.  What I did 
was consider which types of publications would tend to have a URL instead of 
other bibliographic information and only include for those where it would 
likely necessary.  For instance, journal articles will be given a DOI so a URL 
is less useful; technical reports, however, are likely to be hosted at an 
institution's web site so a URL is likely useful.

But I must admit that I didn't spend much time thinking about which ones should 
have it.  I didn't want all of them because I often store the URL for a journal 
article in the org file just for quick access but I do not want it exported to 
BiBTeX as it would be messy and superfluous when the paper were cited.

I'm glad the patch seemed straightforward!  Thank you.

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



Re: [patch] add :url and :doi optional entries for export to BiBTeX

2021-07-01 Thread Timothy


Hi Eric,

I've not used Org for exporting to BibTeX, so I don't really know what
I'm on about, but is there any particular reason why only some entries
have :url ? Other than that, this seems like a fairly straightforward
patch.

--
Timothy

Eric S Fraga  writes:

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



Re: [patch] add :url and :doi optional entries for export to BiBTeX

2021-06-28 Thread Eric S Fraga
I introduced an error in the previous patch.  Please use this one.
Thank you,
eric

-- 
: 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
>From ddad85139bd508a06db6e98ddef0131f7cc9946e Mon Sep 17 00:00:00 2001
From: Eric S Fraga 
Date: Mon, 28 Jun 2021 13:35:34 +0100
Subject: [PATCH] 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.
---
 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 @@
   '((:article
  (: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))
 (:book
  (: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))
 (:booklet
  (: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))
 (:conference
  (:description . "")
  (:required :author :title :booktitle :year)
- (:optional :editor :pages :organization :publisher :address :month :note))
+ (:optional :editor :pages :organization :publisher :address :month :note :doi :url))
 (: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 :edition :month :note))
+ (:optional :crossref (:volume :number) :series :type :address :edition :month :note :doi))
 (: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 :edition :month :note))
+ (:optional :crossref :editor (:volume :number) :series :type :chapter :pages :address :edition :month :note :doi))
 (:inproceedings
  (: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))
 (:manual
  (:description . "Technical documentation.")
  (:required :title)
- (:optional :author :organization :address :edition :month :year :note))
+ (:optional :author :organization :address :edition :month :year :note :doi :url))
 (:mastersthesis
  (:description . "A Master’s thesis.")
  (:required :author :title :school :year)
- (:optional :type :address :month :note))
+ (:optional :type :address :month :note :doi :url))
 (:misc
  (:description . "Use this type when nothing else fits.")
  (:required)
- (:optional :author :title :howpublished :month :year :note))
+ (:optional :author :title :howpublished :month :year :note :doi :url))
 (:phdthesis
  (:description . "A PhD thesis.")
  (:required :author :title :school :year)
- (:optional :type :address :month :note))
+ (:optional :type :address :month :note :doi :url))
 (:proceedings
  (: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 :publi

[patch] add :url and :doi optional entries for export to BiBTeX

2021-06-28 Thread Eric S Fraga
Hello all,

increasingly, I need URL and DOI BiBTeX entries to cite particular types
of publications.  Some BiBTeX styles now recognise these but the current
BiBTeX exporter in org does not export these.  I have added :url and
:doi entries to the list of optional entries to export when present to a
selection of the publication types.

I think this is not a breaking change but who knows...

-- 
: 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
>From ddad85139bd508a06db6e98ddef0131f7cc9946e Mon Sep 17 00:00:00 2001
From: Eric S Fraga 
Date: Mon, 28 Jun 2021 13:35:34 +0100
Subject: [PATCH] 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.
---
 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 @@
   '((:article
  (: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))
 (:book
  (: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))
 (:booklet
  (: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))
 (:conference
  (:description . "")
  (:required :author :title :booktitle :year)
- (:optional :editor :pages :organization :publisher :address :month :note))
+ (:optional :editor :pages :organization :publisher :address :month :note :doi :url))
 (: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 :edition :month :note))
+ (:optional :crossref (:volume :number) :series :type :address :edition :month :note :doi))
 (: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 :edition :month :note))
+ (:optional :crossref :editor (:volume :number) :series :type :chapter :pages :address :edition :month :note :doi))
 (:inproceedings
  (: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))
 (:manual
  (:description . "Technical documentation.")
  (:required :title)
- (:optional :author :organization :address :edition :month :year :note))
+ (:optional :author :organization :address :edition :month :year :note :doi :url))
 (:mastersthesis
  (:description . "A Master’s thesis.")
  (:required :author :title :school :year)
- (:optional :type :address :month :note))
+ (:optional :type :address :month :note :doi :url))
 (:misc
  (:description . "Use this type when nothing else fits.")
  (:required)
- (:optional :author :title :howpublished :month :year :note))
+ (:optional :author :title :howpublished :month :year :note :doi :url))
 (:phdthesis
  (:description . "A PhD thesis.")
  (:required :author :title :school :year)
- (:optional :type :address :month :note))
+ (:optional :type :address :month :not