emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Matt Price <moptop99@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-ref: citation types (insert full citation); bib style; bib scope
Date: Sat, 07 Jan 2017 08:23:38 -0500	[thread overview]
Message-ID: <m2r34fovfp.fsf@Johns-MacBook-Air.local> (raw)
In-Reply-To: <CAN_Dec_AS-YHm4b_P6kifx=t2d9n212zsTbsOK-quxrt2fn_bA@mail.gmail.com>

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

It is pretty weird about org-define-error. It is in org-compat.el. I am
using org-9.

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

I go back and forth on liking ivy/hydra vs helm.

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

could be, the key is related to the number/order of actions in helm-bibtex.
>>
>>
>>
>> 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!

org-ref has some support to export citations in latex, html, org,
md/pandoc and text. I do not know how good it is, but the framework for
it mostly exists.


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

  reply	other threads:[~2017-01-07 13:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 14:27 org-ref: citation types (insert full citation); bib style; bib scope Matt Price
2017-01-06 15:26 ` John Kitchin
2017-01-06 16:05   ` Matt Price
2017-01-06 16:10     ` John Kitchin
2017-01-06 20:42     ` John Kitchin
2017-01-07  3:13       ` Matt Price
2017-01-07 13:23         ` John Kitchin [this message]
2019-08-30 19:12           ` org-ref: conditionally add url to formatted citation Matt Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r34fovfp.fsf@Johns-MacBook-Air.local \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).