Re: [O] org-ref code

2014-05-15 Thread Eric S Fraga
On Wednesday, 14 May 2014 at 16:35, John Kitchin wrote:

[...]

 I wonder if you are adding another cite link later that overrides my cite
 link. do the other citation links export ok, e.g. autocite, citeyear,
 etc...?

The problem is not how links are handled but the fact that implicit
links, i.e. those not surrounded by [[...]], are not recognised as links
on export.  This applies to all citation links but not, for instance,
http:.  There has to be something in org that I need to set or that I
have set that affects this behaviour but I just do not seem to find it.

I am now bisecting my initialisation code to see if it is me setting
something but I do wonder if there is something you have set to tell org
to recognise implicitly defined links?

In any case, would it be possible to have org-ref insert proper links,
i.e. [[cite:joe-2014]], maybe as an option?  I often use superscripts
for citation references and a space before the superscript looks ugly!
And my problem would be solved... :)

thanks again,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread Eric S Fraga
John,

I am in the process of bisecting my initialisation.  Something I have
set definitely stops org (whether 8.2.5c which comes with emacs
24.4.50.2 or 8.2.6-958) from recognising cite:... etc. as links.

However, I have been re-building up from no initialisation bit by
bit.  Right from the start, I get the error I posted yesterday:

--8---cut here---start-8---
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  re-search-forward(nil 10001 t)
  tex-main-file()
  reftex-TeX-master-file()
  reftex-tie-multifile-symbols()
  reftex-access-scan-info((16))
  reftex-parse-all()
  (and (buffer-file-name) (file-exists-p (buffer-file-name)) 
(global-auto-revert-mode t) (reftex-parse-all))
  org-mode-reftex-setup()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook 
org-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#buffer t.org ~/s/test/t.org nil nil 
~/synced/test/t.org (10095713 2055))
  find-file-noselect(~/s/test/t.org nil nil t)
  find-file(~/s/test/t.org t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
--8---cut here---end---8---

This happens when I try to visit any org file *once* I have loaded
org-ref the first time.  It doesn't happen before org-ref is loaded.

I am starting to despair, I must admit!  I wonder if there is a conflict
between Emacs 24.4.50 and org-ref?  Or do you have some other setting
for reftex that is not the default?

Anyway, I have to get some work done so I will do without org-ref for
the time being.  I'll revisit later.

thanks again for all your time,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread Bastien
Hi John,

John Kitchin jkitc...@andrew.cmu.edu writes:

 I would prefer to keep org-ref where it is until it stabilizes.

I hope it will stabilize before Org 8.3 so that we can add org-ref
to contrib/ and give it exposure in the release notes.

Thanks,

-- 
 Bastien



Re: [O] org-ref code

2014-05-15 Thread John Kitchin
That is pretty strange. I used this to get a minimally working install of
org-ref. I deleted ~/.emacs.d, and ran emacs -q and then executed this code
block.

* installation

You need the dash package. Use these repositories, and  install dash.

#+BEGIN_SRC emacs-lisp
  (require 'package)

  (setq package-archives
'((org . http://orgmode.org/elpa/;)
  (gnu . http://elpa.gnu.org/packages/;)
  (melpa . http://melpa.milkbox.net/packages/;)
  ))
  (package-refresh-contents)
  (package-install 'dash)

  (org-babel-load-file ~/Dropbox/kitchingroup/jmax/org-ref.org)

  ;; this function is normally run as a hook. we run it manually here to
  ;; get started.
  (org-mode-reftex-setup)
#+END_SRC

#+RESULTS:
: org-ref-insert-cite-link

After that, it works like I expect.

Your error seems to be coming from reftex. I wonder if you have something
set that is making it look for a TeX-master or something, which eventually
results in nil, which is failing here: re-search-forward(nil 10001 t). Or
maybe you need to set something to turn that off. Perhaps some default
changed?


John

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



On Thu, May 15, 2014 at 4:17 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 John,

 I am in the process of bisecting my initialisation.  Something I have
 set definitely stops org (whether 8.2.5c which comes with emacs
 24.4.50.2 or 8.2.6-958) from recognising cite:... etc. as links.

 However, I have been re-building up from no initialisation bit by
 bit.  Right from the start, I get the error I posted yesterday:

 --8---cut here---start-8---
 Debugger entered--Lisp error: (wrong-type-argument stringp nil)
   re-search-forward(nil 10001 t)
   tex-main-file()
   reftex-TeX-master-file()
   reftex-tie-multifile-symbols()
   reftex-access-scan-info((16))
   reftex-parse-all()
   (and (buffer-file-name) (file-exists-p (buffer-file-name))
 (global-auto-revert-mode t) (reftex-parse-all))
   org-mode-reftex-setup()
   run-hooks(change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook)
   apply(run-hooks (change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook))
   run-mode-hooks(org-mode-hook)
   org-mode()
   set-auto-mode-0(org-mode nil)
   set-auto-mode()
   normal-mode(t)
   after-find-file(nil t)
   find-file-noselect-1(#buffer t.org ~/s/test/t.org nil nil
 ~/synced/test/t.org (10095713 2055))
   find-file-noselect(~/s/test/t.org nil nil t)
   find-file(~/s/test/t.org t)
   call-interactively(find-file nil nil)
   command-execute(find-file)
 --8---cut here---end---8---

 This happens when I try to visit any org file *once* I have loaded
 org-ref the first time.  It doesn't happen before org-ref is loaded.

 I am starting to despair, I must admit!  I wonder if there is a conflict
 between Emacs 24.4.50 and org-ref?  Or do you have some other setting
 for reftex that is not the default?

 Anyway, I have to get some work done so I will do without org-ref for
 the time being.  I'll revisit later.

 thanks again for all your time,
 eric

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org
 release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread Eric S Fraga
On Thursday, 15 May 2014 at 09:05, John Kitchin wrote:

[...]

 Your error seems to be coming from reftex. I wonder if you have something
 set that is making it look for a TeX-master or something, which eventually
 results in nil, which is failing here: re-search-forward(nil 10001 t). Or
 maybe you need to set something to turn that off. Perhaps some default
 changed?

Yes, that is my feeling as well but I am totally unable to find what may
be causing it.

I haven't yet looked to see whether there have been any changes in
reftex itself in the latest emacs.

I continue to investigate!

thanks,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread John Kitchin
I can see the desire to avoid the space with a superscript, but that is a
latex specific formatting issue, that is probably taken care of with some
package. In the packages we use (usually natmove), citations are moved to
the correct side of punctuation, for example, so we always put them on the
left where the logically make sense (eg because it is grouped in the
sentence being cited. the latex package moves the superscripts to the
right. I think it also works on spaces In org-mode some
text[[cite:yoo-2014-theor-analy]] is also ugly ;) and harder to read.
That gives us the best of both worlds (org and latex)

I don't think I have done anything to make the naked links work.

John

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



On Thu, May 15, 2014 at 2:58 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Wednesday, 14 May 2014 at 16:35, John Kitchin wrote:

 [...]

  I wonder if you are adding another cite link later that overrides my cite
  link. do the other citation links export ok, e.g. autocite, citeyear,
  etc...?

 The problem is not how links are handled but the fact that implicit
 links, i.e. those not surrounded by [[...]], are not recognised as links
 on export.  This applies to all citation links but not, for instance,
 http:.  There has to be something in org that I need to set or that I
 have set that affects this behaviour but I just do not seem to find it.

 I am now bisecting my initialisation code to see if it is me setting
 something but I do wonder if there is something you have set to tell org
 to recognise implicitly defined links?

 In any case, would it be possible to have org-ref insert proper links,
 i.e. [[cite:joe-2014]], maybe as an option?  I often use superscripts
 for citation references and a space before the superscript looks ugly!
 And my problem would be solved... :)

 thanks again,
 eric
 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org
 release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread Eric S Fraga
On Thursday, 15 May 2014 at 09:05, John Kitchin wrote:
 Your error seems to be coming from reftex. 

Well, it seems that if you are going to use reftex in emacs 24.4.x, you
need to define some variables.  I put the following in your
org-mode-reftex-setup function:

(setq-local tex-start-of-header %\\*\\*start of header)
(setq-local tex-end-of-header %\\*\\*end of header)

immediately after loading reftex and things work better (I haven't
checked whether everything works yet).

The problem is that tex-mode assumes that it is active in a mode that
has been derived from tex-mode (such as latex-mode or plain-tex-mode)
and those modes define the variables above.  Org-mode doesn't!

This may be a change in tex-mode for the latest emacs versions?  I
cannot verify this.

Am I correct in believing that you are using emacs 24.3?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread John Kitchin
yes, I am using emacs 24.3.

John

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



On Thu, May 15, 2014 at 9:30 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Thursday, 15 May 2014 at 09:05, John Kitchin wrote:
  Your error seems to be coming from reftex.

 Well, it seems that if you are going to use reftex in emacs 24.4.x, you
 need to define some variables.  I put the following in your
 org-mode-reftex-setup function:

 (setq-local tex-start-of-header %\\*\\*start of header)
 (setq-local tex-end-of-header %\\*\\*end of header)

 immediately after loading reftex and things work better (I haven't
 checked whether everything works yet).

 The problem is that tex-mode assumes that it is active in a mode that
 has been derived from tex-mode (such as latex-mode or plain-tex-mode)
 and those modes define the variables above.  Org-mode doesn't!

 This may be a change in tex-mode for the latest emacs versions?  I
 cannot verify this.

 Am I correct in believing that you are using emacs 24.3?

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org
 release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread Eric S Fraga
On Thursday, 15 May 2014 at 10:19, John Kitchin wrote:
 yes, I am using emacs 24.3.

Can you have a look at tex-mode.el and see if the variables:

 (setq-local tex-start-of-header %\\*\\*start of header)
 (setq-local tex-end-of-header %\\*\\*end of header)

are (a) used and (b) defined somewhere other than in the definitions of
derived modes?

By the way, I have no idea how these are being used but maybe they could
be adapted to org syntax (# start of header, say)?

In any case, some good news!  I have tracked down the problem with
citations not being picked up by the exporter.

If I load ox-latex *before* org-ref, cite: and other new links are not
picked up.  If I load org-ref before ox-latex, everything seems to work
fine.  It would seem that ox-latex is defining the links that are valid
and this is not being updated subsequently?  I've not tracked this down
yet but maybe Nicolas should have a look?

We're getting there!

thanks,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-15 Thread Eric S Fraga
On Thursday, 15 May 2014 at 15:31, Eric S Fraga wrote:

[...]

 If I load ox-latex *before* org-ref, cite: and other new links are not
 picked up.  If I load org-ref before ox-latex, everything seems to work
 fine.  It would seem that ox-latex is defining the links that are valid
 and this is not being updated subsequently?  I've not tracked this down
 yet but maybe Nicolas should have a look?

Following up on myself: org-ref has to be loaded *before* ox.el which
means also before any ox-*.el files.

I thought the problem was that the link types regexps used by org were
not being updated but invoking org-make-link-regexps after loading
org-ref had no effect.  Oh well.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-14 Thread John Kitchin
I think you are restricted to single characters. That key is used by
reftex, so it would be a limitation in reftex. You can always define your
own function with a key-binding for something specific.

John

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



On Tue, May 13, 2014 at 11:39 PM, Andreas Reuleaux andr...@a-rx.infowrote:

 John Kitchin jkitc...@andrew.cmu.edu writes:

  with the most recent org-ref, it should be sufficient to put this in your
  init file:
 
  (org-ref-define-citation-link textcite ?I)
  (org-ref-define-citation-link citeauthorfull ?F)
 
  this will create a textcite link and create a reftex menu you select with
  the key I, and the other link with the key F. these should automatically
 be
  links, and have completion functions. These will get exported as
  \textcite{label} and \citeauthorfull{label}. The
  org-ref-define-citation-link function adds the link, creates the
 functions
  necessary, and adds the types to the right places.
 
  You do not need to do the manual additions unless you manually define the
  link like you did with org-add-link-type.
 


 OK, I see, and works fine, thanks.

 One minor thing: Am I restricted to single-letter keystrokes
 above ? like:

   I (...?I)
   F (... ?F)
   C-t   (... ?\C-t)

 I tried to get working something like

  C-r C-t

 with something like this

   (... ?(kbd C-r C-t))

 with no success, but I am unsure, if there is just something simple
 missing like a quote or a backslash, or if it's just not possible
 at this point.

 -Andreas





Re: [O] org-ref code

2014-05-14 Thread John Kitchin
I also run emacs 24.3.

nearly my whole setup is here: https://github.com/jkitchin/jmax

If you are on windows, you should be able to clone that repository, and run
jmax.bat which will run the emacs binary in that repository and load the
jmax code which includes org-ref. You may not want to use my setup all the
time, but it might help figure out what is different with your setup.

For Macs or Linux, you just need to run something like emacs -q -l
path/to/jmax/init.el to try it out.

John

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



On Tue, May 13, 2014 at 11:58 PM, Andreas Reuleaux andr...@a-rx.infowrote:

 Eric,

 I don't have auctex installed, and org-ref works fine for me.

 But I do run a recent self-compiled emacs 24 (haven't tested yet,
 if it works with my older emacs24 from debian as well),
 and I get updated packages like dash relatively often via cask
 ( https://github.com/cask/cask , http://cask.github.io/ ),
 i. e. I have in my Cask file

   (depends-on dash)

 so it wouldn't have happend to me to have an outdated dash pkg,
 isolating your problem and pointing at what exactly is causing your
 trouble is of course more difficult (and creating a minimal config that
 works for me takes more time than I currently have, sorry).

 Hope this helps, nevertheless


 -Andreas



 Eric S Fraga e.fr...@ucl.ac.uk writes:

  John,
 
  another data point.  When I try to load an org file, once org-ref is
  loaded, I get the following problem:
 
  Debugger entered--Lisp error: (wrong-type-argument stringp nil)
re-search-forward(nil 10001 t)
tex-main-file()
reftex-TeX-master-file()
reftex-tie-multifile-symbols()
reftex-access-scan-info((16))
reftex-parse-all()
(and (buffer-file-name) (file-exists-p (buffer-file-name))
  (global-auto-revert-mode t) (reftex-parse-all))
org-mode-reftex-setup()
run-hooks(change-major-mode-after-body-hook text-mode-hook
  outline-mode-hook org-mode-hook)
apply(run-hooks (change-major-mode-after-body-hook text-mode-hook
  outline-mode-hook org-mode-hook))
run-mode-hooks(org-mode-hook)
 
  Because of this, org-ref doesn't get initialised properly.
 
  Any idea what may be causing this?  Do I need to configure auctex or
  similar?
 
  thanks,
  eric





Re: [O] org-ref code

2014-05-14 Thread Andreas Reuleaux
OK, thanks.

-Andreas


John Kitchin jkitc...@andrew.cmu.edu writes:

 I think you are restricted to single characters. That key is used by
 reftex, so it would be a limitation in reftex. You can always define your
 own function with a key-binding for something specific.

 John




Re: [O] org-ref code

2014-05-14 Thread Eric S Fraga
On Tuesday, 13 May 2014 at 20:28, John Kitchin wrote:
 interesting. I do have auxtex installed, but I don't think I configure it
 anywhere. I do require reftex and reftex-cite in my init files. I also set
 the default reftex bibliography.

 (setq reftex-default-bibliography
 '(~/Dropbox/bibliography/references.bib))

 I will try to reproduce this tomorrow.

Hi John,

In case this helps, if I start emacs with -q and evaluate the contents
of emacs-minimal.el (attached) and then visit orgref.org (attached), I can 
insert a
reference (references.bib also attached) but the resulting latex doesn't
work because bibtex complains about missing bibstyle.  

If I add the LaTeX directive to specify the bibliography style (as the
attached file has), everthing works.  This includes C-u C-c ] asking for
type of citation.  

How do I specify the bibstyle for org-ref?

When I say that everything works, it works with this minimal
configuration but not yet in my full configuration.  But that's my
problem.  Somehow, I am making the latex exporter not handle cite:
links.  Very strange.  I'll get back to you on this in due course!

I am actually using Emacs 24.4, not 24.3.  I'm tracking emacs-snapshot
which is the development version as I like to live dangerously ;-)

thanks again for org-ref,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git
# -*- org-latex-pdf-process: (pdflatex %b bibtex %b pdflatex %b pdflatex %b) -*-
#+title: test out org-ref
* Introduction
The paper by somebody 
cite:aaltola-2002 is most interesting.  Also, autocite:aaltola-2002 is exciting.
* References

#+latex: \bibliographystyle{acm}
bibliography:references.bib
@Article{aaltola-2002,
  author = 	 {J. Aaltola},
  title = 	 {Simultaneous synthesis of flexible heat exchanger network},
  journal = 	 {Applied Thermal Engineering},
  year = 	 2002,
  volume =	 22,
  number =	 8,
  pages =	 {907-918}
}


emacs-minimal.el
Description: application/emacs-lisp


Re: [O] org-ref code

2014-05-14 Thread Andreas Reuleaux
Eric S Fraga e.fr...@ucl.ac.uk writes:


 How do I specify the bibstyle for org-ref?


I am not sure if I understand your question correctly
and John certainly has more insight here, but I have in
my org document

#+LaTeX_HEADER: \include{ltxhdr}

and within that ltxhdr.tex I have among other config settings

  \usepackage[backend=bibtex,style=authoryear]{biblatex}
  \addbibresource{refs.bib}

I could have written several lines of 

#+LaTeX_HEADER: \usepackage[backend=bibtex,style=authoryear]{biblatex}
#+LaTeX_HEADER: \addbibresource{refs.bib}

instead.

There is no specific bibstyle of org-ref (correct, John?), that's the
job of latex, you will be happy if:

* your org mode has clickable citations links,

* let's you insert citations in a comfortably manner

* you can jump between refs and labels etc.

* all of those citations get exported to their latex
  equivalents

If for some reason your citations get exported to latex, say
cite:foo to \cite{foo}, but still don't appear in your
final pdf, than you have to tweek your latex settings,
obviously. - Maybe forgot to call bibtex(8) on your document?

I run these:
* an emacs batch script, tex.el to get the document.tex
  from document.org
* xelatex -8bit -shell-escape document.tex
* bibtex8 document
* xelatex document
  again, etc.

You can check your latex toolchain independently from
your org-ref config.

HTH,
  -Andreas
  




Re: [O] org-ref code

2014-05-14 Thread Sharon Kimble
Andreas Reuleaux andr...@a-rx.info writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:


 How do I specify the bibstyle for org-ref?


 I am not sure if I understand your question correctly
 and John certainly has more insight here, but I have in
 my org document

 #+LaTeX_HEADER: \include{ltxhdr}

 and within that ltxhdr.tex I have among other config settings

   \usepackage[backend=bibtex,style=authoryear]{biblatex}
   \addbibresource{refs.bib}

 I could have written several lines of 

 #+LaTeX_HEADER: \usepackage[backend=bibtex,style=authoryear]{biblatex}
 #+LaTeX_HEADER: \addbibresource{refs.bib}

 instead.

 There is no specific bibstyle of org-ref (correct, John?), that's the
 job of latex, you will be happy if:

 * your org mode has clickable citations links,

 * let's you insert citations in a comfortably manner

 * you can jump between refs and labels etc.

 * all of those citations get exported to their latex
   equivalents

 If for some reason your citations get exported to latex, say
 cite:foo to \cite{foo}, but still don't appear in your
 final pdf, than you have to tweek your latex settings,
 obviously. - Maybe forgot to call bibtex(8) on your document?

 I run these:
 * an emacs batch script, tex.el to get the document.tex
   from document.org
 * xelatex -8bit -shell-escape document.tex
 * bibtex8 document
 * xelatex document
   again, etc.

 You can check your latex toolchain independently from
 your org-ref config.

 HTH,
   -Andreas

That seems a very long winded way round things! For your information
this is a batch script that I'm using for generating a PDF in pure
latex, and all I have to do is to cd to the directory where the
files are, and then just enter pdfbuild in the command-line. It
does all the rest itself, and you could easily adapt it for your
circumstances
--8---cut here---start-8---
#!/bin/bash
set -e
#set -x

#variables
filename=uh2014

#
xelatex $filename
biber $filename
biber $filename
xelatex $filename 
biber $filename
xelatex $filename 
makeindex $filename
makeindex $filename
xelatex $filename
makeglossaries $filename
xelatex $filename
xelatex $filename
--8---cut here---end---8---

It handles and generates the references, the glossary, and the index
as well as the body of the document. 

All you have to do is enter your foo.tex where foo is the name of
your generated tex file, and then let the script take over.

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, Fluxbox 1.3.5, emacs 24.3.91.1


signature.asc
Description: PGP signature


Re: [O] org-ref code

2014-05-14 Thread Andreas Reuleaux
Well, I know how to write shell scripts,
and have something similar encoded in a shake file
(haskell make replacement), for that matter,
but prefer to have xelatex not called 5 times
during every little development step.
Anyway thanks a lot.

My point here really was, that org-ref and
the latex chains are separate and can be
separately tested.

-Andreas


Sharon Kimble boudic...@skimble.plus.com writes:

 Andreas Reuleaux andr...@a-rx.info writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:


 How do I specify the bibstyle for org-ref?


 I am not sure if I understand your question correctly
 and John certainly has more insight here, but I have in
 my org document

 #+LaTeX_HEADER: \include{ltxhdr}

 and within that ltxhdr.tex I have among other config settings

   \usepackage[backend=bibtex,style=authoryear]{biblatex}
   \addbibresource{refs.bib}

 I could have written several lines of 

 #+LaTeX_HEADER: \usepackage[backend=bibtex,style=authoryear]{biblatex}
 #+LaTeX_HEADER: \addbibresource{refs.bib}

 instead.

 There is no specific bibstyle of org-ref (correct, John?), that's the
 job of latex, you will be happy if:

 * your org mode has clickable citations links,

 * let's you insert citations in a comfortably manner

 * you can jump between refs and labels etc.

 * all of those citations get exported to their latex
   equivalents

 If for some reason your citations get exported to latex, say
 cite:foo to \cite{foo}, but still don't appear in your
 final pdf, than you have to tweek your latex settings,
 obviously. - Maybe forgot to call bibtex(8) on your document?

 I run these:
 * an emacs batch script, tex.el to get the document.tex
   from document.org
 * xelatex -8bit -shell-escape document.tex
 * bibtex8 document
 * xelatex document
   again, etc.

 You can check your latex toolchain independently from
 your org-ref config.

 HTH,
   -Andreas

 That seems a very long winded way round things! For your information
 this is a batch script that I'm using for generating a PDF in pure
 latex, and all I have to do is to cd to the directory where the
 files are, and then just enter pdfbuild in the command-line. It
 does all the rest itself, and you could easily adapt it for your
 circumstances
 #!/bin/bash
 set -e
 #set -x

 #variables
 filename=uh2014

 #
 xelatex $filename
 biber $filename
 biber $filename
 xelatex $filename 
 biber $filename
 xelatex $filename 
 makeindex $filename
 makeindex $filename
 xelatex $filename
 makeglossaries $filename
 xelatex $filename
 xelatex $filename

 It handles and generates the references, the glossary, and the index
 as well as the body of the document. 

 All you have to do is enter your foo.tex where foo is the name of
 your generated tex file, and then let the script take over.

 Sharon.




Re: [O] org-ref code

2014-05-14 Thread John Kitchin
Good. I am glad to hear you are making some progress!

you have to specify the bibliography style for latex export somewhere in
the document. You can use a bibliographystyle link for bibtex, eg.
bibliographystyle:unsrt. That will get exported to
\bibliographystyle{unsrt}. That link does not do anything but export to
latex. or you can simply put \bibliographystyle{unsrt} above the
bibliography link. For any other thing like biblatex, just put the code
that specifies the style where it belongs, e.g. in the header with
#+latex_header: or at the end with the raw latex commands. Not all
documents require a style, article classes do, but the revtex4-1 class, for
example defines the style for you.

I wonder if you are adding another cite link later that overrides my cite
link. do the other citation links export ok, e.g. autocite, citeyear,
etc...?

John

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



On Wed, May 14, 2014 at 2:17 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Tuesday, 13 May 2014 at 20:28, John Kitchin wrote:
  interesting. I do have auxtex installed, but I don't think I configure it
  anywhere. I do require reftex and reftex-cite in my init files. I also
 set
  the default reftex bibliography.
 
  (setq reftex-default-bibliography
  '(~/Dropbox/bibliography/references.bib))
 
  I will try to reproduce this tomorrow.

 Hi John,

 In case this helps, if I start emacs with -q and evaluate the contents
 of emacs-minimal.el (attached) and then visit orgref.org (attached), I
 can insert a
 reference (references.bib also attached) but the resulting latex doesn't
 work because bibtex complains about missing bibstyle.

 If I add the LaTeX directive to specify the bibliography style (as the
 attached file has), everthing works.  This includes C-u C-c ] asking for
 type of citation.

 How do I specify the bibstyle for org-ref?

 When I say that everything works, it works with this minimal
 configuration but not yet in my full configuration.  But that's my
 problem.  Somehow, I am making the latex exporter not handle cite:
 links.  Very strange.  I'll get back to you on this in due course!

 I am actually using Emacs 24.4, not 24.3.  I'm tracking emacs-snapshot
 which is the development version as I like to live dangerously ;-)

 thanks again for org-ref,
 eric
 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org
 release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-14 Thread Eric S Fraga
On Wednesday, 14 May 2014 at 20:03, Andreas Reuleaux wrote:
 Eric S Fraga e.fr...@ucl.ac.uk writes:
 How do I specify the bibstyle for org-ref?

[...]

 There is no specific bibstyle of org-ref (correct, John?), that's the

That's what I wanted to confirm.  And it has been confirmed (by both you
and another email from John).  Thanks.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-13 Thread Eric S Fraga
On Monday, 12 May 2014 at 13:26, John Kitchin wrote:
 that should work out of the box, and that link is defined in org-ref as

 (org-add-link-type
  cite
  'org-ref-cite-onclick-minibuffer-menu
  'org-ref-cite-link-format)

And I used to have my own already in any case.


 I am not sure why it would not work out of the box.

Neither do I.  The more annoying thing is that I cannot get org-ref to
work at all with emacs -q and a minimal org document.  Would you maybe
post the minimum setup for getting org-ref to work, along with a minimal
org document?

thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559



Re: [O] org-ref code

2014-05-13 Thread John Kitchin
You can see a document I wrote using org-ref here:
http://kitchingroup.cheme.cmu.edu/org/2014/05/13/Using-org-ref-for-citations-and-references.org

You will want to pull a current version. I added some code so it is in
principle easy for you to add your own citation types and use the org-ref
machinery to insert citations.


I made a little screencast here: http://screencast.com/t/bxfafVydE

j

John

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



On Tue, May 13, 2014 at 7:00 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Monday, 12 May 2014 at 13:26, John Kitchin wrote:
  that should work out of the box, and that link is defined in org-ref as
 
  (org-add-link-type
   cite
   'org-ref-cite-onclick-minibuffer-menu
   'org-ref-cite-link-format)

 And I used to have my own already in any case.

 
  I am not sure why it would not work out of the box.

 Neither do I.  The more annoying thing is that I cannot get org-ref to
 work at all with emacs -q and a minimal org document.  Would you maybe
 post the minimum setup for getting org-ref to work, along with a minimal
 org document?

 thanks,
 eric

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559



Re: [O] org-ref code

2014-05-13 Thread Eric S Fraga
On Tuesday, 13 May 2014 at 14:51, John Kitchin wrote:
 You can see a document I wrote using org-ref here:
 http://kitchingroup.cheme.cmu.edu/org/2014/05/13/Using-org-ref-for-citations-and-references.org

 You will want to pull a current version. I added some code so it is in
 principle easy for you to add your own citation types and use the org-ref
 machinery to insert citations.

Thanks for this.

It didn't work but I have now figured out why!

Your code requires dash version 2.6.0 and I had version 2.4.0.  The need
for the latest version is noted in a comment in your code but the code
itself doesn't check (and probably cannot?).  With 2.6.0, I'm much
further!  Links are now recognised properly.

I still have a problem in that a very minimal file, with one cite: link
and a bibliography: link, doesn't compile because bibtex complains of no
\bibstyle.  Not sure why it's complaining but I will continue debugging.

thanks,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-13 Thread Eric S Fraga
John,

another data point.  When I try to load an org file, once org-ref is
loaded, I get the following problem:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  re-search-forward(nil 10001 t)
  tex-main-file()
  reftex-TeX-master-file()
  reftex-tie-multifile-symbols()
  reftex-access-scan-info((16))
  reftex-parse-all()
  (and (buffer-file-name) (file-exists-p (buffer-file-name)) 
(global-auto-revert-mode t) (reftex-parse-all))
  org-mode-reftex-setup()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook 
org-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)

Because of this, org-ref doesn't get initialised properly.

Any idea what may be causing this?  Do I need to configure auctex or
similar?

thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-13 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:

 You can see a document I wrote using org-ref here:
 http://kitchingroup.cheme.cmu.edu/org/2014/05/13/Using-org-ref-for-citations-and-references.org

 You will want to pull a current version. I added some code so it is in
 principle easy for you to add your own citation types and use the org-ref
 machinery to insert citations.


 I made a little screencast here: http://screencast.com/t/bxfafVydE


Thanks for the sample file and the screencast, very nice.

still a bit confused about org-ref-cite-types:

Say, I want to add two new link types:


  textcite - somehow standard in biblatex,
 cf. the biblatex.pdf manual, p 81

  citeauthorfull - my own creation - author with first- and lastname,
   cf below.


from my document.org I load some latex preparation stuff like this

  #+LaTeX_HEADER: \include{ltxhdr}

I was just getting tired of prefixing so many lines with #+LaTeX_HEADER:
and collected some of those in a lxthdr.tex file.
there I have prepared something for this citeauthorfull thingy:


  %% cf
  %% 
http://tex.stackexchange.com/questions/24979/citing-authors-full-name-in-biblatex
  %% called citeauthorfirstlast... there


  \DeclareCiteCommand{\citeauthorfull}
{\boolfalse{citetracker}%
 \boolfalse{pagetracker}%
 \DeclareNameAlias{labelname}{first-last}%
 \usebibmacro{prenote}}
{\ifciteindex
   {\indexnames{labelname}}
   {}%
 \printnames{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}

this does the job, don't ask me details.

now back to org-ref:

with your advice I add:

  ;; add new format
  (setf (nth 2 (assoc 'org reftex-cite-format-builtin))
(append (nth 2 (assoc 'org reftex-cite-format-builtin))
'(

  ;; C-t like text
  (?\C-t  . textcite:%l)


  ;; f like full
  (?f  . citeauthorfull:%l)

  )))

and I get the comfort of two additional citation formats to chose from
when typing C-u C-c ] - nice, indeed. this is basically what you
said in your e-mail before, now also on the org-ref.org webpage,
(just shortcut and don't define that format variable)

Now I can add these:

  (add-to-list 'org-ref-cite-types textcite)
  (add-to-list 'org-ref-cite-types citeauthorfull)

but this is of limited use to me currently, at least I don't get
the point, not sure if I am doing something wrong:

say, I have added a few of these

  textcite:foo

  citeauthorfull:bar

in my document.org, there are some problems with these:

* first: they don't appear blue and clickable in my document.org

* second: they don't get exported in the latex in a reasonable way,
  they appear there just as

textcite:foo
citeauthorfull:bar

Well I can cure the situation by adding by adding


(org-add-link-type
 textcite
 'org-ref-cite-onclick-minibuffer-menu
 ;; formatting
 (lambda (keyword desc format)
   (cond
((eq format 'html) (format (textcite%s/textcite) path))
((eq format 'latex)
 (concat \\textcite{
 (mapconcat (lambda (key) key) (org-ref-split-and-strip-string 
keyword) ,)
 })



(org-add-link-type
 citeauthorfull
 'org-ref-cite-onclick-minibuffer-menu
 ;; formatting
 (lambda (keyword desc format)
   (cond
((eq format 'html) (format (citeauthorfull%s/citeauthorfull) path))
((eq format 'latex)
 (concat \\citeauthorfull{
 (mapconcat (lambda (key) key) (org-ref-split-and-strip-string 
keyword) ,)
 })


now they appear clickable in blue, and get properly exported
to \textcite{...} and \citeauthorfull{...}

Now, what was the deal of this adding them  to 'org-ref-cite-types
in the first place, if I had to take care of the details by hand anyway?
Is there anything I could have left out / shortcut / I have forgotten maybe?

Thanks.

-Andreas




Re: [O] org-ref code

2014-05-13 Thread John Kitchin
interesting. I do have auxtex installed, but I don't think I configure it
anywhere. I do require reftex and reftex-cite in my init files. I also set
the default reftex bibliography.

(setq reftex-default-bibliography
'(~/Dropbox/bibliography/references.bib))

I will try to reproduce this tomorrow.

John

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



On Tue, May 13, 2014 at 4:11 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 John,

 another data point.  When I try to load an org file, once org-ref is
 loaded, I get the following problem:

 Debugger entered--Lisp error: (wrong-type-argument stringp nil)
   re-search-forward(nil 10001 t)
   tex-main-file()
   reftex-TeX-master-file()
   reftex-tie-multifile-symbols()
   reftex-access-scan-info((16))
   reftex-parse-all()
   (and (buffer-file-name) (file-exists-p (buffer-file-name))
 (global-auto-revert-mode t) (reftex-parse-all))
   org-mode-reftex-setup()
   run-hooks(change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook)
   apply(run-hooks (change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook))
   run-mode-hooks(org-mode-hook)

 Because of this, org-ref doesn't get initialised properly.

 Any idea what may be causing this?  Do I need to configure auctex or
 similar?

 thanks,
 eric

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org
 release_8.2.6-958-g7c8559-git



Re: [O] org-ref code

2014-05-13 Thread John Kitchin
with the most recent org-ref, it should be sufficient to put this in your
init file:

(org-ref-define-citation-link textcite ?I)
(org-ref-define-citation-link citeauthorfull ?F)

this will create a textcite link and create a reftex menu you select with
the key I, and the other link with the key F. these should automatically be
links, and have completion functions. These will get exported as
\textcite{label} and \citeauthorfull{label}. The
org-ref-define-citation-link function adds the link, creates the functions
necessary, and adds the types to the right places.

You do not need to do the manual additions unless you manually define the
link like you did with org-add-link-type.

John

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



On Tue, May 13, 2014 at 7:33 PM, Andreas Reuleaux andr...@a-rx.info wrote:

 John Kitchin jkitc...@andrew.cmu.edu writes:

  You can see a document I wrote using org-ref here:
 
 http://kitchingroup.cheme.cmu.edu/org/2014/05/13/Using-org-ref-for-citations-and-references.org
 
  You will want to pull a current version. I added some code so it is in
  principle easy for you to add your own citation types and use the org-ref
  machinery to insert citations.
 
 
  I made a little screencast here: http://screencast.com/t/bxfafVydE
 

 Thanks for the sample file and the screencast, very nice.

 still a bit confused about org-ref-cite-types:

 Say, I want to add two new link types:


   textcite - somehow standard in biblatex,
  cf. the biblatex.pdf manual, p 81

   citeauthorfull - my own creation - author with first- and lastname,
cf below.


 from my document.org I load some latex preparation stuff like this

   #+LaTeX_HEADER: \include{ltxhdr}

 I was just getting tired of prefixing so many lines with #+LaTeX_HEADER:
 and collected some of those in a lxthdr.tex file.
 there I have prepared something for this citeauthorfull thingy:


   %% cf
   %%
 http://tex.stackexchange.com/questions/24979/citing-authors-full-name-in-biblatex
   %% called citeauthorfirstlast... there


   \DeclareCiteCommand{\citeauthorfull}
 {\boolfalse{citetracker}%
  \boolfalse{pagetracker}%
  \DeclareNameAlias{labelname}{first-last}%
  \usebibmacro{prenote}}
 {\ifciteindex
{\indexnames{labelname}}
{}%
  \printnames{labelname}}
 {\multicitedelim}
 {\usebibmacro{postnote}}

 this does the job, don't ask me details.

 now back to org-ref:

 with your advice I add:

   ;; add new format
   (setf (nth 2 (assoc 'org reftex-cite-format-builtin))
 (append (nth 2 (assoc 'org reftex-cite-format-builtin))
 '(

   ;; C-t like text
   (?\C-t  . textcite:%l)


   ;; f like full
   (?f  . citeauthorfull:%l)

   )))

 and I get the comfort of two additional citation formats to chose from
 when typing C-u C-c ] - nice, indeed. this is basically what you
 said in your e-mail before, now also on the org-ref.org webpage,
 (just shortcut and don't define that format variable)

 Now I can add these:

   (add-to-list 'org-ref-cite-types textcite)
   (add-to-list 'org-ref-cite-types citeauthorfull)

 but this is of limited use to me currently, at least I don't get
 the point, not sure if I am doing something wrong:

 say, I have added a few of these

   textcite:foo

   citeauthorfull:bar

 in my document.org, there are some problems with these:

 * first: they don't appear blue and clickable in my document.org

 * second: they don't get exported in the latex in a reasonable way,
   they appear there just as

 textcite:foo
 citeauthorfull:bar

 Well I can cure the situation by adding by adding


 (org-add-link-type
  textcite
  'org-ref-cite-onclick-minibuffer-menu
  ;; formatting
  (lambda (keyword desc format)
(cond
 ((eq format 'html) (format (textcite%s/textcite) path))
 ((eq format 'latex)
  (concat \\textcite{
  (mapconcat (lambda (key) key) (org-ref-split-and-strip-string
 keyword) ,)
  })



 (org-add-link-type
  citeauthorfull
  'org-ref-cite-onclick-minibuffer-menu
  ;; formatting
  (lambda (keyword desc format)
(cond
 ((eq format 'html) (format (citeauthorfull%s/citeauthorfull)
 path))
 ((eq format 'latex)
  (concat \\citeauthorfull{
  (mapconcat (lambda (key) key) (org-ref-split-and-strip-string
 keyword) ,)
  })


 now they appear clickable in blue, and get properly exported
 to \textcite{...} and \citeauthorfull{...}

 Now, what was the deal of this adding them  to 'org-ref-cite-types
 in the first place, if I had to take care of the details by hand anyway?
 Is there anything I could have left out / shortcut / I have forgotten
 maybe?

 Thanks.

 -Andreas





Re: [O] org-ref code

2014-05-13 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:

 with the most recent org-ref, it should be sufficient to put this in your
 init file:

 (org-ref-define-citation-link textcite ?I)
 (org-ref-define-citation-link citeauthorfull ?F)

 this will create a textcite link and create a reftex menu you select with
 the key I, and the other link with the key F. these should automatically be
 links, and have completion functions. These will get exported as
 \textcite{label} and \citeauthorfull{label}. The
 org-ref-define-citation-link function adds the link, creates the functions
 necessary, and adds the types to the right places.

 You do not need to do the manual additions unless you manually define the
 link like you did with org-add-link-type.



OK, I see, and works fine, thanks.

One minor thing: Am I restricted to single-letter keystrokes
above ? like:

  I (...?I)
  F (... ?F)
  C-t   (... ?\C-t)

I tried to get working something like

 C-r C-t 

with something like this

  (... ?(kbd C-r C-t))

with no success, but I am unsure, if there is just something simple
missing like a quote or a backslash, or if it's just not possible
at this point.

-Andreas




Re: [O] org-ref code

2014-05-13 Thread Andreas Reuleaux
Eric,

I don't have auctex installed, and org-ref works fine for me.

But I do run a recent self-compiled emacs 24 (haven't tested yet,
if it works with my older emacs24 from debian as well),
and I get updated packages like dash relatively often via cask
( https://github.com/cask/cask , http://cask.github.io/ ),
i. e. I have in my Cask file

  (depends-on dash)

so it wouldn't have happend to me to have an outdated dash pkg,
isolating your problem and pointing at what exactly is causing your
trouble is of course more difficult (and creating a minimal config that
works for me takes more time than I currently have, sorry).

Hope this helps, nevertheless


-Andreas



Eric S Fraga e.fr...@ucl.ac.uk writes:

 John,

 another data point.  When I try to load an org file, once org-ref is
 loaded, I get the following problem:

 Debugger entered--Lisp error: (wrong-type-argument stringp nil)
   re-search-forward(nil 10001 t)
   tex-main-file()
   reftex-TeX-master-file()
   reftex-tie-multifile-symbols()
   reftex-access-scan-info((16))
   reftex-parse-all()
   (and (buffer-file-name) (file-exists-p (buffer-file-name))
 (global-auto-revert-mode t) (reftex-parse-all))
   org-mode-reftex-setup()
   run-hooks(change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook)
   apply(run-hooks (change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook))
   run-mode-hooks(org-mode-hook)

 Because of this, org-ref doesn't get initialised properly.

 Any idea what may be causing this?  Do I need to configure auctex or
 similar?

 thanks,
 eric




Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:


 C-c ] should be bound by default to org-ref-insert-cite-link. It is defined
 in a hook function in line 104 of org-ref.org.

 I made a custom variable to store the key-binding, but I realized it
 probably doesn't help, since the binding



 1. C-u on it does not give me a choice of citation method


 If you type C-u M-x  org-ref-insert-cite-link

 do you get a choice?

 I just tried this on a fresh pull and it does work for me. I am not sure
 why this wouldn't work for you.  Do you tangle the .el file from the .org
 file? I have this code somewhere else to build it when needed:


I can confirm that C-c ] and C-u C-c ]
work fine for me.

my setup if fairly simple (with org-ref.el tangled from org-ref.org)

  (require 'org-ref)

  (custom-set-variables
   '(org-ref-bibliography-notes notes.org)
   '(org-ref-default-bibliography  (list refs.bib))
   ;; '(org-ref-pdf-directory ...)
   ;; '(org-ref-default-citation-link ...)
   ;; '(org-ref-insert-cite-key ...)
   )

looking forward to discover more of org-ref.

FWIW, I was using textcite:... (with biblatex) as well, helped myself by
just inserting a cite:... and then changing the link with C-c C-l from
cite to textcite. But I really need read up on all those different
citations commands once more, maybe textcite is not really necessary?
Could I add it somehow to the list of choices available in C-u C-c ] ?
(I realized there are citetext, citep*, citep as well, that I yet have
to discover).

By the way: the org-ref.org literate programming docs are fine
for someone interested in the gory details / relatively experienced.
Ist there a simpler document just describing its usage - that
you would hand out to your chemistry students e. g. ?

Somehting maybe explaining the differences from the other approaches
that can be found e g in 

  
http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/

  
http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/

Thanks for org-ref.

-Andreas




Re: [O] org-ref code

2014-05-12 Thread Eric S Fraga
On Sunday, 11 May 2014 at 14:48, John Kitchin wrote:

[...]

 C-c ] should be bound by default to org-ref-insert-cite-link. It is defined
 in a hook function in line 104 of org-ref.org.

Yes.  It is.  

I don't use this binding.  I use evil mode and don't like chorded
commands.  I have org-ref-insert-cite-link bound to , r but that's
beside the point, in any case.

 1. C-u on it does not give me a choice of citation method

 If you type C-u M-x  org-ref-insert-cite-link
 do you get a choice?

No.  I get prompted for the expression to search for and then I get
prompted for an optional argument and the final text inserted in my org
buffer is \cite{}, not cite:

 I just tried this on a fresh pull and it does work for me. I am not sure
 why this wouldn't work for you.  Do you tangle the .el file from the .org
 file? I have this code somewhere else to build it when needed:

I do tangle and then eval-buffer just to make sure I have the right code
loaded.

 2. the link inserted looks like a link (it's blue) but there are
  actually no [[...]] characters surrounding it.

 There are no [[...]]. The links work fine without them for me. Are they
 necessary for some reason? I can add them, but since they do not do
 anything but disappear in this case, I leave them out.  

Well, I obviously have something not quite configured properly in my
environment.  The cite: text is highlighted as a link in the org buffer
(as it should with org-highlight-links set) but is treated as simple
text when exported so that I simply get cite:... in the latex
output.  If I C-c C-l it and don't add a description, the org buffer
*looks* the same but the export works because org and/or the exporter
know that it's a link.

Is there some org variable I have not set that tells org to treat cite:
plain text as a link on export?  Obviously org already recognises it as
a link but the export doesn't...  org-link-protocols and org-link-types
look fine.

I am most puzzled... :(

By the way, in my use case, even if the above would work properly, it
would still definitely help if the [[...]] were inserted as I sometimes
use superscript indices and in those cases I do not want any whitespace
between the text and the citation that follows.  Anyway, this is
secondary.

thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-949-g751506



Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Is there some org variable I have not set that tells org to treat cite:
 plain text as a link on export?  Obviously org already recognises it as
 a link but the export doesn't...  org-link-protocols and org-link-types
 look fine.


Being just a org-ref beginner, I don't know if there is a more
straightforward solution but, I have configured:


  (org-add-link-type
   cite
   'org-ref-cite-onclick-minibuffer-menu
   ;; formatting
   (lambda (keyword desc format)
 (cond
  ((eq format 'html) (format (cite%s/cite) path))
  ((eq format 'latex)
   (concat \\cite{
   (mapconcat (lambda (key) key) (org-ref-split-and-strip-string 
keyword) ,)
   })


and similarily for autocite and textcite (the citation types that I am
using), that works for me. Adapted (copied) from the org-add-link-type
for autocite given in the org-ref.org description.  Not sure if this
should just work out of the box (without configuration), but then, it's
not that much code.

-Andreas





Re: [O] org-ref code

2014-05-12 Thread John Kitchin
that should work out of the box, and that link is defined in org-ref as

(org-add-link-type
 cite
 'org-ref-cite-onclick-minibuffer-menu
 'org-ref-cite-link-format)

I am not sure why it would not work out of the box.



John

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



On Mon, May 12, 2014 at 1:20 PM, Andreas Reuleaux andr...@a-rx.info wrote:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

  Is there some org variable I have not set that tells org to treat cite:
  plain text as a link on export?  Obviously org already recognises it as
  a link but the export doesn't...  org-link-protocols and org-link-types
  look fine.
 

 Being just a org-ref beginner, I don't know if there is a more
 straightforward solution but, I have configured:


   (org-add-link-type
cite
'org-ref-cite-onclick-minibuffer-menu
;; formatting
(lambda (keyword desc format)
  (cond
   ((eq format 'html) (format (cite%s/cite) path))
   ((eq format 'latex)
(concat \\cite{
(mapconcat (lambda (key) key)
 (org-ref-split-and-strip-string keyword) ,)
})


 and similarily for autocite and textcite (the citation types that I am
 using), that works for me. Adapted (copied) from the org-add-link-type
 for autocite given in the org-ref.org description.  Not sure if this
 should just work out of the box (without configuration), but then, it's
 not that much code.

 -Andreas






Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:

 that should work out of the box, and that link is defined in org-ref as

 (org-add-link-type
  cite
  'org-ref-cite-onclick-minibuffer-menu
  'org-ref-cite-link-format)

 I am not sure why it would not work out of the box.


They *do* work out of the box, as I can see now.


-Andreas




Re: [O] org-ref code

2014-05-12 Thread John Kitchin
Here is a way you can add new citation formats to the reftex format:

;; get builtin formats
(setq formats (nth 2 (assoc 'org reftex-cite-format-builtin)))

;; add new format
(setf (nth 2 (assoc 'org reftex-cite-format-builtin))
  (append formats '((?W  . textcite:%l)
(?z  . newcite:%l

This does not define the links, but it does add the formats to the reftex
menu.

I have figured out how to add new citation links without alot of cut and
pasted code. I do not use biblatex much though. What are the common
citation formats, and are they mostly written as \citation{label}?

John

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



On Mon, May 12, 2014 at 4:12 AM, Andreas Reuleaux andr...@a-rx.info wrote:

 John Kitchin jkitc...@andrew.cmu.edu writes:


  C-c ] should be bound by default to org-ref-insert-cite-link. It is
 defined
  in a hook function in line 104 of org-ref.org.
 
  I made a custom variable to store the key-binding, but I realized it
  probably doesn't help, since the binding
 
 
 
  1. C-u on it does not give me a choice of citation method
 
 
  If you type C-u M-x  org-ref-insert-cite-link
 
  do you get a choice?
 
  I just tried this on a fresh pull and it does work for me. I am not sure
  why this wouldn't work for you.  Do you tangle the .el file from the .org
  file? I have this code somewhere else to build it when needed:


 I can confirm that C-c ] and C-u C-c ]
 work fine for me.

 my setup if fairly simple (with org-ref.el tangled from org-ref.org)

   (require 'org-ref)

   (custom-set-variables
'(org-ref-bibliography-notes notes.org)
'(org-ref-default-bibliography  (list refs.bib))
;; '(org-ref-pdf-directory ...)
;; '(org-ref-default-citation-link ...)
;; '(org-ref-insert-cite-key ...)
)

 looking forward to discover more of org-ref.

 FWIW, I was using textcite:... (with biblatex) as well, helped myself by
 just inserting a cite:... and then changing the link with C-c C-l from
 cite to textcite. But I really need read up on all those different
 citations commands once more, maybe textcite is not really necessary?
 Could I add it somehow to the list of choices available in C-u C-c ] ?
 (I realized there are citetext, citep*, citep as well, that I yet have
 to discover).

 By the way: the org-ref.org literate programming docs are fine
 for someone interested in the gory details / relatively experienced.
 Ist there a simpler document just describing its usage - that
 you would hand out to your chemistry students e. g. ?

 Somehting maybe explaining the differences from the other approaches
 that can be found e g in


 http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/


 http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/

 Thanks for org-ref.

 -Andreas





Re: [O] org-ref code

2014-05-11 Thread John Kitchin
On Sat, May 10, 2014 at 10:44 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Thursday,  1 May 2014 at 13:07, John Kitchin wrote:
  I implemented some of this partially. I made it so you can specify the
  default cite link in a user variable, with a default of cite. When you
 type
  C-c ], this format will automatically be used. If you want to choose
  another format, type C-u C-c ] which will prompt you for a type, and then

 Hi John,

 I am having problems with org-ref and am obviously missing something
 trivial.  I downloaded the latest version yesterday (Friday).  You don't
 say, in the above, what function you actually bound to C-c ] but I bound
 org-ref-insert-cite-link and that doesn't seem to work:


C-c ] should be bound by default to org-ref-insert-cite-link. It is defined
in a hook function in line 104 of org-ref.org.

I made a custom variable to store the key-binding, but I realized it
probably doesn't help, since the binding



 1. C-u on it does not give me a choice of citation method


If you type C-u M-x  org-ref-insert-cite-link

do you get a choice?

I just tried this on a fresh pull and it does work for me. I am not sure
why this wouldn't work for you.  Do you tangle the .el file from the .org
file? I have this code somewhere else to build it when needed:
(if (or
 (not (file-exists-p org-ref.el))
 ( (float-time (nth 5 (file-attributes org-ref.el)))
(float-time (nth 5 (file-attributes org-ref.org)
(progn
  (org-babel-tangle-file (expand-file-name org-ref.org
starter-kit-dir))
  (load-file (expand-file-name org-ref.el starter-kit-dir)))
  (require 'org-ref))

That retangles the org file if the org-file is newer than the el file.


 2. the link inserted looks like a link (it's blue) but there are
  actually no [[...]] characters surrounding it.


There are no [[...]]. The links work fine without them for me. Are they
necessary for some reason? I can add them, but since they do not do
anything but disappear in this case, I leave them out.  That is actually
not totally true, if you write your link as [[cite:key][page 23]] the page
23 gets formatted in latex as \cite[page23]{key}.



 What am I missing?  Am I expected to type the [[]] or use C-c C-l?

 I don't think you need the [[]], and you do not have to use C-c C-l. The
only thing that C-c C-l offers is autocompletion on bibtex keys for the
cite link (I have not figured out a way to avoid a lot of cut and paste
code for the other types, and I rarely use this feature, but I am leaving
it in so I do not forget how I did it ;). I guess C-c C-l might help
entering the description too.



 I would like to C-u C-c ], choose autocite and my refs and have your
 code insert [[autocite:blah-2001,joe-2010,moe-2014]] into my org
 buffer.  I know I can change the default citation link type through
 org-ref-default-citation-link but I want the C-u functionality.


You should be able to do all those things. The C-u functionality works
independently of the default type, and it should let you get something
other than the default.



 Finally, looking at the code, it would appear that appending new
 citations will only work for cite: links as the cite: is hard-coded
 into the code?


This is correct in the version you have. The current workaround is to use
C-u C-c ], and select the A format, which will output a leading comma and
your selections. I have pushed a fix for this, that adds a requirement of
dash.el and checks of the link is in a list of cite types defined in
org-ref. Thanks for making me think of a solution to that!


 thanks again,
 eric

 PS - I'm a fellow Chemical Engineer but unfortunately have not yet had
 the opportunity to cite any of your papers but look forward to doing so
 sometime soon using org-ref ;-)


That would be great! I hope the comments above help!


 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11



Re: [O] org-ref code

2014-05-10 Thread Eric S Fraga
On Thursday,  1 May 2014 at 13:07, John Kitchin wrote:
 I implemented some of this partially. I made it so you can specify the
 default cite link in a user variable, with a default of cite. When you type
 C-c ], this format will automatically be used. If you want to choose
 another format, type C-u C-c ] which will prompt you for a type, and then

Hi John,

I am having problems with org-ref and am obviously missing something
trivial.  I downloaded the latest version yesterday (Friday).  You don't
say, in the above, what function you actually bound to C-c ] but I bound
org-ref-insert-cite-link and that doesn't seem to work:

1. C-u on it does not give me a choice of citation method
2. the link inserted looks like a link (it's blue) but there are
 actually no [[...]] characters surrounding it.

What am I missing?  Am I expected to type the [[]] or use C-c C-l?

I would like to C-u C-c ], choose autocite and my refs and have your
code insert [[autocite:blah-2001,joe-2010,moe-2014]] into my org
buffer.  I know I can change the default citation link type through
org-ref-default-citation-link but I want the C-u functionality.

Finally, looking at the code, it would appear that appending new
citations will only work for cite: links as the cite: is hard-coded
into the code?

thanks again,
eric

PS - I'm a fellow Chemical Engineer but unfortunately have not yet had
the opportunity to cite any of your papers but look forward to doing so
sometime soon using org-ref ;-)
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11



Re: [O] org-ref code

2014-05-08 Thread Vikas Rawal

 
 All the talk about citations in org-mode inspired me to finish and polish 
 some code I have been working on for my group for a while on 
 bibtex/reftex/org-mode integration. I packaged it up in a literate 
 programming org-file here: 
 https://github.com/jkitchin/jmax/blob/master/org-ref.org.
 

Thanks John. This looks very useful. 

Do you plan to add this to org-mode/contrib?

I was wondering if it would be useful to change the default keybinding C-c ] to 
C-c ) instead, since C-c ] is by default bound to org-remove-file.

Vikas



Re: [O] org-ref code

2014-05-08 Thread John Kitchin
I added a user variable for that key-binding. I like C-c ] because there is
no shift to get ). You can set org-ref-insert-cite-key to what ever
shortcut you prefer now.

I would prefer to keep org-ref where it is until it stabilizes. This
summer my group will be using it pretty extensively for writing papers, so
I anticipate by this fall it will be pretty stable.

John

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



On Thu, May 8, 2014 at 4:31 AM, Vikas Rawal vikasra...@gmail.com wrote:



 All the talk about citations in org-mode inspired me to finish and polish
 some code I have been working on for my group for a while on
 bibtex/reftex/org-mode integration. I packaged it up in a literate
 programming org-file here:
 https://github.com/jkitchin/jmax/blob/master/org-ref.org.


 Thanks John. This looks very useful.

 Do you plan to add this to org-mode/contrib?

 I was wondering if it would be useful to change the default keybinding C-c
 ] to C-c ) instead, since C-c ] is by default bound to org-remove-file.

 Vikas




Re: [O] org-ref code

2014-05-01 Thread Eric S Fraga
On Wednesday, 30 Apr 2014 at 16:59, John Kitchin wrote:
 Greetings,

 All the talk about citations in org-mode inspired me to finish and polish
 some code I have been working on for my group for a while on
 bibtex/reftex/org-mode integration. I packaged it up in a literate
 programming org-file here:
 https://github.com/jkitchin/jmax/blob/master/org-ref.org.

Hi John,

Thanks for this.  I'll play with it as it looks like a really nice
collection of utilities for links and I must admit that I still find I
under-use org links.  I'll post any feedback here in due course.

One quick comment: I think it's bad practice to define global bindings
for Fxx keys in a package.  Let the user define these keys outside the
package maybe?  I have F10 and F12 defined to some very common actions
for me (recentf and org-clock).

Thanks again,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11



Re: [O] org-ref code

2014-05-01 Thread Eric S Fraga
John,

I've been playing with the package although, so far, only for
citations.  A few points:

1. Do you have any support for choosing the type of citation entry
 (i.e. \cite versus \autocite versus ...) when inserting a
 citation in the text?
 
2. You define org-link-types.  Unfortunately, this overwrites my own
 definitions, especially for cite.  I wonder whether this type
 of customisation belongs in org-ref itself.  This is similar to
 my earlier comment about key bindings, I guess. 

3. I sometimes use biblatex instead of bibtex.  As a result, I do not
 use \bibliography and use \addbibresource instead.  I have
 defined my bibliography files in org-ref-default-bibliography but
 this is only picked up on initialisation.  It is difficult to
 update this for a document in progress (I had to locally set
 reftex-default-bibliography manually).

4. The customisation interface for org-ref-default-bibliography should be
 list aware...

Otherwise, seems to working just fine.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11



Re: [O] org-ref code

2014-05-01 Thread Seb Frank
Hi Eric,

Now that you have mentioned it, do you have a good web resource / manual
for your set up, or would you mind sharing bits of it? It looks eminently
useful. I have a set up largely following this

http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/

but I wouldn't know how to get some of the things you mention (type of
citation entry, biblatex vs latex etc.) to work.

Thanks,
  Seb

On Thu, May 1, 2014 at 6:01 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 John,

 I've been playing with the package although, so far, only for
 citations.  A few points:

 1. Do you have any support for choosing the type of citation entry
  (i.e. \cite versus \autocite versus ...) when inserting a
  citation in the text?

 2. You define org-link-types.  Unfortunately, this overwrites my own
  definitions, especially for cite.  I wonder whether this type
  of customisation belongs in org-ref itself.  This is similar to
  my earlier comment about key bindings, I guess.

 3. I sometimes use biblatex instead of bibtex.  As a result, I do not
  use \bibliography and use \addbibresource instead.  I have
  defined my bibliography files in org-ref-default-bibliography but
  this is only picked up on initialisation.  It is difficult to
  update this for a document in progress (I had to locally set
  reftex-default-bibliography manually).

 4. The customisation interface for org-ref-default-bibliography should be
  list aware...

 Otherwise, seems to working just fine.

 Thanks,
 eric

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11




Re: [O] org-ref code

2014-05-01 Thread John Kitchin
Thanks for the feedback. I moved the key-bindings for f10-12 out of org-ref.


On Thu, May 1, 2014 at 6:01 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 John,

 I've been playing with the package although, so far, only for
 citations.  A few points:

 1. Do you have any support for choosing the type of citation entry
  (i.e. \cite versus \autocite versus ...) when inserting a
  citation in the text?


Not at the moment. There are a few ways I can see doing this. With the
existing code, you can do M-x reftex-citation, select the format you want
and select the references. We could easily enough define additional formats
for other citation types. I found this way of inserting citations annoying,
because 99.99% of the time I want a simple cite link, and pressing  C-c ]
return regexp marking return was too much for me (




 2. You define org-link-types.  Unfortunately, this overwrites my own
  definitions, especially for cite.  I wonder whether this type
  of customisation belongs in org-ref itself.  This is similar to
  my earlier comment about key bindings, I guess.

 3. I sometimes use biblatex instead of bibtex.  As a result, I do not
  use \bibliography and use \addbibresource instead.  I have
  defined my bibliography files in org-ref-default-bibliography but
  this is only picked up on initialisation.  It is difficult to
  update this for a document in progress (I had to locally set
  reftex-default-bibliography manually).

 4. The customisation interface for org-ref-default-bibliography should be
  list aware...

 Otherwise, seems to working just fine.

 Thanks,
 eric

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11



Re: [O] org-ref code

2014-05-01 Thread John Kitchin
sorry, premature send!


On Thu, May 1, 2014 at 8:36 AM, John Kitchin jkitc...@andrew.cmu.eduwrote:

 Thanks for the feedback. I moved the key-bindings for f10-12 out of
 org-ref.


 On Thu, May 1, 2014 at 6:01 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 John,

 I've been playing with the package although, so far, only for
 citations.  A few points:

 1. Do you have any support for choosing the type of citation entry
  (i.e. \cite versus \autocite versus ...) when inserting a
  citation in the text?


 Not at the moment. There are a few ways I can see doing this. With the
 existing code, you can do M-x reftex-citation, select the format you want
 and select the references. We could easily enough define additional formats
 for other citation types. I found this way of inserting citations annoying,
 because 99.99% of the time I want a simple cite link, and pressing  C-c ]
 return regexp marking return was too much for me (I cite a lot). I also
 found this method was not flexible, in the sense that it was not easy to
 add citations to an existing citation. That is why there is an ?a option to
 append citations in the code.


an alternative would be to use a prefix command that gave you an option to
change the cite format, similar to the minibuffer menu for cite links. I
have not written much prefix code before, but I will try that out.





 2. You define org-link-types.  Unfortunately, this overwrites my own
  definitions, especially for cite.  I wonder whether this type
  of customisation belongs in org-ref itself.  This is similar to
  my earlier comment about key bindings, I guess.


In the end, the link definitions can be as short as this:

#+BEGIN_SRC emacs-lisp :tangle org-ref.el
(org-add-link-type
 cite
 'org-ref-cite-onclick-minibuffer-menu
 'org-ref-cite-link-format)
#+END_SRC

I wrote this for my research group to use, and eventually the links have to
be defined somewhere. I am not sure what the best place would be. It is an
interesting issue of reproducibility though. Two people with different link
definitions would get different results.


 3. I sometimes use biblatex instead of bibtex.  As a result, I do not
  use \bibliography and use \addbibresource instead.  I have
  defined my bibliography files in org-ref-default-bibliography but
  this is only picked up on initialisation.  It is difficult to
  update this for a document in progress (I had to locally set
  reftex-default-bibliography manually).


It should be easy enough to make an addbibresource link that does the same
thing as the bibliography link. And maybe to modify the find-bibliography
code to check for that too. I have never used biblatex though, so I dont
have any experience with it.



 4. The customisation interface for org-ref-default-bibliography should be
  list aware...


I think I fixed this.



 Otherwise, seems to working just fine.

 Thanks,
 eric

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org
 release_8.2.6-923-g233c11





Re: [O] org-ref code

2014-05-01 Thread Eric S Fraga
On Thursday,  1 May 2014 at 08:47, John Kitchin wrote:

[...]

Hi John,

thanks for your quick response!

 an alternative would be to use a prefix command that gave you an option to
 change the cite format, similar to the minibuffer menu for cite links. I
 have not written much prefix code before, but I will try that out.

This would be good, with many a way of stating the default one would
like?  For instance, for grant proposals, I often use autocite in
biblatex for generating citations as footnotes whereas for research
papers I use cite most often.  

 In the end, the link definitions can be as short as this:

 #+BEGIN_SRC emacs-lisp :tangle org-ref.el
 (org-add-link-type
  cite
  'org-ref-cite-onclick-minibuffer-menu
  'org-ref-cite-link-format)
 #+END_SRC

My comment was not so much the definitions you used but that you were
overwriting those that I had already defined.  Your definitions were
arguably better than mine so maybe I was being a bit picky here... :)

 I wrote this for my research group to use, and eventually the links have to
 be defined somewhere. I am not sure what the best place would be. It is an
 interesting issue of reproducibility though. Two people with different link
 definitions would get different results.

Yes, this is true but there is so much that can be customised in org
that you will never have reproducibility at this level (e.g. handling of
latex snippets, code listings, even latex classes).  I would leave
something like this to a separate set of code that is not part of
org-ref.

 It should be easy enough to make an addbibresource link that does the same
 thing as the bibliography link. And maybe to modify the find-bibliography
 code to check for that too. I have never used biblatex though, so I dont
 have any experience with it.

I have only started using biblatex recently, and that was because I
wanted to use autocite.  The only change I had to make was \bibliography
to \addbibresource.  I still use the same bibtex files.  Of course,
others may be making more effective use of biblatex...

 4. The customisation interface for org-ref-default-bibliography should be
  list aware...

 I think I fixed this.

Thanks!
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11



Re: [O] org-ref code

2014-05-01 Thread Eric S Fraga
On Thursday,  1 May 2014 at 08:21, Seb Frank wrote:
 Hi Eric,

 Now that you have mentioned it, do you have a good web resource / manual
 for your set up, or would you mind sharing bits of it? It looks eminently
 useful. I have a set up largely following this

 http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/

 but I wouldn't know how to get some of the things you mention (type of
 citation entry, biblatex vs latex etc.) to work.

Hi Seb,

I don't have much of a setup, actually.  You already do much more than I
do!

I tend to do things manually until somebody else posts something useful
already configured (like John has just done).  For instance, I simply
use C-c C-l to store a link manually, typing in the type of link (cite
vs autocite) and the bibtex key directly.  I used to use reftex with org
but found it got in the way although I cannot now remember how or why!

When in doubt, I resort to LaTeX.  I have been using LaTeX for 30 years
or so.  The beauty of org is that it allows me to fall back to LaTeX
without any hassle for most things.

I suffer (or have suffered badly in the past) from RSI so my main
concern is having things that are easy to type but paradoxically I don't
have a problem with typing normal text and I do touch type quickly.  I
use evil mode which means I can avoid most chorded commands.  To use
org, I have bound many org commands to keys in the normal state mode map
in evil.  For instance, I have org-export-dispatch assigned to , e so
I can export to pdf and view it in emacs by typing , e l o.  I have
similar key bindings for many org commands.  For instance, t on a
headline will invoke org-todo.  , n and , p move to next and
previous headlines,  to org-metaleft, etc.  The aim is to avoid all
or most M- and especially M-S- key bindings which kill my hands.  C- is
not so bad but I avoid even these if possible.

I use a few yasnippets and make significant use of abbrev mode in Emacs
to help with typing.  I also make use of org's own snippet system.

Sorry I cannot be more helpful and thanks for the link to your setup.

eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11



Re: [O] org-ref code

2014-05-01 Thread John Kitchin
I implemented some of this partially. I made it so you can specify the
default cite link in a user variable, with a default of cite. When you type
C-c ], this format will automatically be used. If you want to choose
another format, type C-u C-c ] which will prompt you for a type, and then
use the reftex-citation command to complete it. I added most of the
citation types I know of to this. Most of those will not work with
completion. I did make the cite link completion function use the default
link type, so that it will at least do what you want. I might add
completion functions for all the link types, it is just a lot of cut and
pasting. and I do not use that much. I just wanted to see if I could do it
;)

I also added addbibresource as a link type, and updated org-ref to be able
to use that instead of bibliography.

Thanks for the ideas!

John

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



On Thu, May 1, 2014 at 9:30 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Thursday,  1 May 2014 at 08:47, John Kitchin wrote:

 [...]

 Hi John,

 thanks for your quick response!

  an alternative would be to use a prefix command that gave you an option
 to
  change the cite format, similar to the minibuffer menu for cite links. I
  have not written much prefix code before, but I will try that out.

 This would be good, with many a way of stating the default one would
 like?  For instance, for grant proposals, I often use autocite in
 biblatex for generating citations as footnotes whereas for research
 papers I use cite most often.

  In the end, the link definitions can be as short as this:
 
  #+BEGIN_SRC emacs-lisp :tangle org-ref.el
  (org-add-link-type
   cite
   'org-ref-cite-onclick-minibuffer-menu
   'org-ref-cite-link-format)
  #+END_SRC

 My comment was not so much the definitions you used but that you were
 overwriting those that I had already defined.  Your definitions were
 arguably better than mine so maybe I was being a bit picky here... :)

  I wrote this for my research group to use, and eventually the links have
 to
  be defined somewhere. I am not sure what the best place would be. It is
 an
  interesting issue of reproducibility though. Two people with different
 link
  definitions would get different results.

 Yes, this is true but there is so much that can be customised in org
 that you will never have reproducibility at this level (e.g. handling of
 latex snippets, code listings, even latex classes).  I would leave
 something like this to a separate set of code that is not part of
 org-ref.

  It should be easy enough to make an addbibresource link that does the
 same
  thing as the bibliography link. And maybe to modify the find-bibliography
  code to check for that too. I have never used biblatex though, so I dont
  have any experience with it.

 I have only started using biblatex recently, and that was because I
 wanted to use autocite.  The only change I had to make was \bibliography
 to \addbibresource.  I still use the same bibtex files.  Of course,
 others may be making more effective use of biblatex...

  4. The customisation interface for org-ref-default-bibliography should
 be
   list aware...
 
  I think I fixed this.

 Thanks!
 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11