emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-ref: citation types (insert full citation); bib style; bib s


From: Matt Price
Subject: Re: [O] org-ref: citation types (insert full citation); bib style; bib scope
Date: Fri, 6 Jan 2017 22:13:57 -0500

Wow, this is pretty awesome, thank you.

A couple of notes inline

On Fri, Jan 6, 2017 at 3:42 PM, John Kitchin <address@hidden> wrote:
>
> New org-ref update ;)
>
> I overhauled the formatted citation support in org-ref today.
>
> Now, you can do the following things:
>
> 1. from the C-c ] interface (helm-bibtex, helm-cite or ivy-cite) you can
> mark some entries and choose an action that inserts formatted strings.
> The default backend for this is text, but you can change that to
> org, and add new backends to the variable
> org-ref-formatted-citation-formats. The backend is defined in the variable
> org-ref-formatted-citation-backend.
>
> It is better than it was (we used to use org-ref-reftex-format-citation
> which had limited fields and character codes). Now the templates use
> s-format and the bibtex-completion code, so you can access any bibtex
> field that is there. This is not a real substitute for a citation
> processor, e.g. if your template has ${volume}(${issue}), and those
> fields do not exist, they will just be empty, e.g. 5(). I don't have
> plans to address this limitation at this point.
>
As you say, it's imperfect, but still pretty good, thank you!
 
>
> 2. If you click on a citation link, you can select an action to copy the
> formatted entry for that key.


I had trouble with this. I constructed a minimal emacs config:

#+BEGIN_SRC emacs-lisp
;;; elpa interface
(setq package-archives ())
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
;; basic initialization, (require) non-ELPA packages, etc.
(package-initialize)

(require 'cl)
(require 'org)
(require 'helm-config)
(require 'helm)
(require 'helm-bibtex)

;; see org-ref for use of these variables
(setq org-ref-bibliography-notes "~/Bibliography/notes.org"
      org-ref-default-bibliography '("~/Bibliography/Bibliography.bib")
      org-ref-pdf-directory "~/Bibliography/files/")

(setq bibtex-completion-bibliography "~/Bibliography/Bibliography.bib"
      bibtex-completion-library-path "~/Bibliography/files"
      )

;; org-define-error
;; for whatever reason, org wasn't finding this
(defun org-define-error (name message)
  "Define NAME as a new error signal.
MESSAGE is a string that will be output to the echo area if such
an error is signaled without being caught by a `condition-case'.
Implements `define-error' for older emacsen."
  (if (fboundp 'define-error) (define-error name message)
    (put name 'error-conditions
     (copy-sequence (cons name (get 'error 'error-conditions))))))

(setq org-ref-formatted-citation-backend "org")
(setq org-ref-completion-library 'org-ref-helm-bibtex)

(require 'org-ref)

#+END_SRC

The action proceeds without errors, but nothing seems to be copied ot the clipboard.

>
> 3. On a bibtex entry, you can use the org-ref-bibtex-hydra/body to copy
> a formatted string of the entry.
>
this works great.  Obviously I need to learn how to use hydra...
>
>
> >> > Does anyone know what the other options are? In particular, for the
> >> syllabi
> >> > I'm currently creating I'd like to just insert the org-formatted citation
> >> > information itself -- is this possible?
> >>
> >> Can you give an example?
> >>
> >>
> > I htink I'm looking for something impossible.  org-zotxt allowed me to use
> > a link type "citation", which just inserted the full citation in org syntax:
> >
> > Hayles, K. (1999). /How we became posthuman: virtual bodies in cybernetics,
> > literature, and informatics/. Chicago, Ill.: University of Chicago Press. [[
> > http://search.library.utoronto.ca/details?7949488&uuid=5aaa42cf-ffd2-41e3-ac6b-60e649f9f289
> > ]]
>
> You would want to have these settings with a new org-ref:
> (setq org-ref-formatted-citation-backend "org")
>
> (setf (cdr (assoc "book" (cdr (assoc "org"
> org-ref-formatted-citation-formats))))
>  "${author} ${year}. /${title}/, ${address}:${publisher}. [[${url}]]")
>
> Then you can insert the citation and get this (there is no address for
> the publisher in my entry). With helm bibtex as the backend, you would
> type C-c ], select an entry, and press f8 (or tab and select the insert
> formatted action). In the ivy backend, you type M-o f. Both of them
> support multiple selections.

Yeah, this is awesome, thank you.  it's F7 though, not F8. 
>
>
> There is not a way to control the casing of the title here, it is
> sentence cased by the bibtex-completion library. I also don't have plans
> to address that.
>
> >
> > rather than generating a link.  If I had an option to do this in my
> > syllabi, it would greatly simplify my work flow.
> >
> >
> >> > I'd like to be able to point my
> >> > students directly to my github repo, and it will ultimately be more
> >> > convenient to have the links already present in the source code, since
> >> > github doesn't reoslve org-ref
> >>
> >> What I mean is, that I'd like to stop building course websites and instead
> >> just point students to github repos where my docs live in an org format.
> >> This means I reallywant the citatiion information, and not citation links.
> >> E.g.:
> >>
> >
> > https://github.com/titaniumbones/New113/blob/master/New113Syllabus.org#2017-01-26-thu-state-surveillance
>
> Does this mean you have an entry with the url in it? Say you have it as
> a misc entry.
>
> @misc{ase,
>   Title =        {Atomic Simulation Environment},
>   Howpublished = {https://wiki.fysik.dtu.dk/ase/},
>   note =         {The Atomic Simulation Environment is a set of Python libraries
>                   for running molecular simulations and analyzing the results.}
> }
>
> That entry type isn't defined in the formats (there should be a default
> entry, but it isn't formatted the way you want), but you could add it like this:
>
>
> (push '("misc" . "${author} ${year}. /${title}/, [[${howpublished}]]")(cdr (assoc "org"
> org-ref-formatted-citation-formats)))
>

got it now.  This is great, thanks.  Moving forward now that you've solved my last problem... for properly formatted citations, is latex the only fully supported publication type? What about, say, pandoc md or odt?

Thank you thank you thank you!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]