From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [ANN] org-bibtex.el --- convert between Org headings and bibtex entries Date: Thu, 21 Apr 2011 15:06:19 -0600 Message-ID: <877hanwbyb.fsf@gmail.com> References: <87y6357q81.fsf@gmail.com> <027A8D96-05AB-452C-87D3-85D90D24AFB1@tsdye.com> <87vcy81xtv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QD15o-0005x5-S9 for emacs-orgmode@gnu.org; Thu, 21 Apr 2011 17:07:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QD15n-0004Dw-AI for emacs-orgmode@gnu.org; Thu, 21 Apr 2011 17:07:16 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:50418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QD15n-0004De-2X for emacs-orgmode@gnu.org; Thu, 21 Apr 2011 17:07:15 -0400 Received: by pwi10 with SMTP id 10so101807pwi.0 for ; Thu, 21 Apr 2011 14:07:14 -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: "Thomas S. Dye" Cc: Org Mode "Thomas S. Dye" writes: > Hi Eric, > > On Apr 20, 2011, at 9:00 AM, Eric Schulte wrote: > >> Hi Tom, >> >> "Thomas S. Dye" writes: >> >>> Hi Eric, >>> >>> This could be very useful and a significant enhancement to Org-mode >>> for note taking. With it, library time can be spent almost entirely >>> within Org-mode, capturing bibliographic information and taking >>> reading notes. It feels like the right level of functionality-- >>> lightweight and easy to use, with lots of prompting material. >>> >> >> Thanks, I hope so. >> >>> >>> I created an entry with org-bibtex-create and then another with org- >>> bibtex-read/write. When I ran org-bibtex, only the second entry was >>> exported. Also, the org-bibtex-read/write process mangled the bibtex >>> entry a bit, so the resulting .bib file wasn't useful. Note the >>> addition of {} around the publisher and year, and the truncation of >>> multi-line entries. >>> >> >> I /believe/ I have fixed this issue. I am now using pre-existing >> bibtex >> functions for reading in entries, and for cleaning up entries >> written by >> org-bibtex. >> > > The org-bibtex-read/write process doesn't work on the example I sent. > The read appears to work (though I can't find a buffer *org-bibtex- > entries* afterwards), but the write inserts the headline asterisk then > fails with progn: Wrong type argument: char-or-string-p, nil. > Hmm, I can't re-create this error, the read and write work for me... Are you placing the point immediately before the bibtex entry before calling org-bibtex-read? After calling the read, does the `*org-bibtex-entries*' variable appear to hold the information for the bibtex entry? Could you set `debug-on-error' to t, and then send me the entire error backtrace so I could see where this is going wrong? > >>> >>> Can I suggest some changes? >>> >>> 1) In our multi-user environment, where several authors are >>> contributing to a master bibtex file, we depend on the key generating >>> algorithm of bibtex-mode to help weed out duplicate entries. This >>> isn't 100% effective, but it catches lots of duplicates and saves us >>> time. Would it be possible to lift this mechanism and use it in org- >>> bibtex to generate the CUSTOM_ID? >>> >> >> I've added a new variable `org-bibtex-autogen-keys' which when set to >> t will result in auto-generated keys being used instead of prompting >> the user to input such keys. >> > > Beautiful! > >>> >>> 2) It might be better to use the (generated) key as the Org headline, >>> instead of the title. Titles can be longer than I find comfortable >>> for an Org-mode headline, whereas keys are usually about the right >>> length. >>> >> >> Hmm, I would tend to disagree here, but I think it may be a matter of >> taste. Note that if you include a TITLE property in a headline then >> it will be used instead of the contents of the headline, leaving you >> free to put whatever information you want into the headline. I've >> just updated the headline creation so that it will create such a >> title property as well as using the title as the headline, leaving >> you free to subsequently change the headline. >> > > That sounds right to me. Thanks. > >>> >>> 3) org-bibtex-cite seems like a natural next step, especially if it >>> offers a list of keys in the Org-mode buffer. >>> >> >> Meaning a function to allow tab-completion on keys... I could see >> this >> being useful but I would imagine that the bib entries would generally >> not live in the same buffer as the Org-mode text... rather I'd think >> some sort of global registry would be preferable. >> > > I guess it depends on how one uses the software. The use I envision > is for note taking while doing background reading for a project. > First, enter a reference with org-bibtex-create, then take notes while > reading, and finally write a summary that might later be used in the > project document. At this stage, org-bibtex hasn't been called, so > the only place the key is present is in the Org-mode buffer. > Inserting a reference then involves jumping back to the headline, > opening the properties drawer, selecting the value of CUSTOM_ID, > navigating back to the reference point and pasting in the key. A > function that collects keys and then presents them in a list like the > one used to choose TYPE would make this process very easy. > > Do you mind my asking what your workflow is with org-bibtex? > Currently I'm just using org-bibtex to collect all of my scattered reading notes into a single monolithic .org file, but I anticipate dumping out .bib files from here when writing in the future. I do see how an automated method of collecting bibtex keys, and then offering a tab-completing insertion could be useful... I'll make a note to this effect in my task file for org-bibtex. Best -- Eric > > All the best, > Tom >> Thanks for the suggestions, bug reports, and examples! >> >> Please do let me know if any of these issues remain -- Eric >> >>> >>> Here are the details of my test run: >>> >>> Existing bibtex entry: >>> >>> @Book{tuggle94:_cultur_resour_naval_air_station_barber_point, >>> author = {H. David Tuggle and M. J. Tomonari-Tuggle and >>> D. Colt Denfeld}, >>> title = {Cultural Resources of Naval Air Station, Barbers >>> Point: Summary, Assessment, and Inventory Research >>> Design: Task 1b: Archaeological Research Services >>> for the Proposed Cleanup, Disposal, and Reuse of >>> Naval Air Station, Barbers Point, O`ahu, Hawai`i}, >>> publisher = iarii, >>> year = 1994, >>> series = {Prepared for Belt Collins Hawaii}, >>> address = {Honolulu}, >>> month = {December}} >>> >>> Org-mode tree: >>> >>> >>> * Schulte bibtex >>> >>> ** A journal title >>> :PROPERTIES: >>> :type: article >>> :AUTHOR: A. N. Author >>> :JOURNAL: Journal of Statistical Software >>> :YEAR: 1998 >>> :CUSTOM_ID: author_10:article >>> :END: >>> >>> ** {Cultural Resources of Naval Air Station, Barbers >>> :PROPERTIES: >>> :TYPE: book >>> :CUSTOM_ID: tuggle94:_cultur_resour_naval_air_station_barber_point >>> :MONTH: December} >>> :ADDRESS: Honolulu >>> :SERIES: Prepared for Belt Collins Hawaii >>> :YEAR: 1994 >>> :PUBLISHER: iarii >>> :AUTHOR: {H. David Tuggle and M. J. Tomonari-Tuggle and >>> :END: >>> >>> Org-bibtex output: >>> >>> @book{tuggle94:_cultur_resour_naval_air_station_barber_point, >>> author={{H. David Tuggle and M. J. Tomonari-Tuggle and}, >>> title={{Cultural Resources of Naval Air Station, Barbers}, >>> publisher={iarii}, >>> year={1994}, >>> series={Prepared for Belt Collins Hawaii}, >>> address={Honolulu}, >>> month={December}} >>> } >>> >>> hth, >>> Tom >>> >>> On Apr 19, 2011, at 1:52 PM, Eric Schulte wrote: >>> >>>> Hi, >>>> >>>> In an attempt to organize my reading notes, I've written the >>>> following >>>> tool which allows both for exporting Org-mode headlines with bibtex >>>> meta-data to bibtex entries, and for reading existing bibtex entries >>>> into Org-mode headings. >>>> >>>> One nice feature of these functions is the ability to check that all >>>> required fields are present in a given headline based on the bibtex >>>> type >>>> (e.g., :article, :inproceedings), and prompt for missing fields. >>>> >>>> See the top of the elisp file for more usage information. >>>> https://github.com/eschulte/org-bibtex/blob/master/org-bibtex.el >>>> >>>> Cheers -- Eric >>>> >>>> -- >>>> Eric Schulte >>>> http://cs.unm.edu/~eschulte/ >>>> >>> >>> >> >> -- >> Eric Schulte >> http://cs.unm.edu/~eschulte/ > > -- Eric Schulte http://cs.unm.edu/~eschulte/