John.
Thank you for a most informative and useful post. Using your method
I've just created the "cat.org" with 14 bibliographic records! I've
amended it slightly, which I'll document in line. 

John Hendy <jw.he...@gmail.com> writes:

> On Mon, May 5, 2014 at 5:23 PM, Sharon Kimble
> <boudic...@skimble.plus.com> wrote:
>> Eric S Fraga <e.fr...@ucl.ac.uk> writes:
>>
>
> [...]
>
>>>
>>>> and this is the bibliography file
>>>> @Article{,
>>>
>>> change this line to
>>>
>>>   @Article{1,
>>>
>>> although I would recommend a more description label personally...
>>
>> I've set it up with the articles author and year, but it is still
>> failing. I'm attaching the original org file, the generated tex and
>> pdf, and the bib file. Hopefully this will help find a solution?
>
> I've been following this from a distance, as I'm interested in
> eventually getting into this. I would kindly ask that you slow down
> your pace, check things over, and proceed *simply* to solve your
> problem. Eric advocated using @Article{1, ...
>
> Without ever having used biblatex, I immediately wondered whether a
> comma delimited bibliography would tolerate:
>
> @Article{MacRae K, et al;2002, ...
>
> The answer is that it will not. You also have multiple lines loading
> the same package:
>
> #+LaTeX_HEADER: \usepackage{biblatex}
> #+LATEX_HEADER:
> \usepackage[citestyle=authoryear-icomp,bibstyle=authoryear,hyperref=true,backref=true,maxcitenames=3,url=true,backend=biber,natbib=true]{biblatex}
> # #+LaTeX_HEADER: \usepackage[backend=bibtex,style=verbose]{biblatex}
>
> Lastly, I would highly suggest limiting your requests for help to
> extremely simple examples. For example, remove packages that do not
> affect the behavior of the problem, such as bussproofs, babel,
> fancyhdr, etc.
>
> I was able to get your file working via the following method:
>
> - Modified cat.bib:
>
> @Article{1,
>   author = {MacRae K. Pattison J.},
>   title = {Home chemotherapy.},
>   journaltitle = {Nursing Times},
>   year = {2002},
>   key = {1},
>   volume = {98},
>   number = {35},
>   pages = {34-35},
> }
>
> - Modified/shortened/simplified cat.org:
>
> # -*- mode:org; mode:reftex; indent-tabs-mode:nil; tab-width:2 -*-
> #+OPTIONS: toc:nil num:nil ^:{}
> #+TITLE: Cat on the mat - 2014
> #+AUTHOR: Sharon Kimble & Sarah ?
> #+LATEX_CLASS: article
> #+LATEX_CLASS_OPTIONS: [a4paper]
> #+LaTeX_HEADER: 
> \usepackage[backend=biber,style=verbose,style=numeric]{biblatex}
> #+LaTeX_HEADER: \bibliography{/home/jwhendy/Downloads/cat.bib} %%% <-
> change this path
> #+LaTeX_HEADER: \bibliography{cat
>
>
> * Chapter 1
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
> nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.\cite{1}
>
> * Bibliography
> \printbibliography
>
> Note that you needed to load biblatex before your bibliography (which
> you sort of did, but then re-loaded it with a bunch of options and
> then perhaps again at the end depending on how Org deals with the #
> symbol before #+ lines. You can tweak the options to biblatex however
> you'd like; I just simplified a bit to single down to one line loading
> it.
>
> \bibliography needed to call the file cat, not bibliography.
>
> In addition, I had to run C-c C-e l p to export to latex, then check
> the buffer *Org PDF LaTeX Output* for messages regarding the failed
> citation. It suggested to run biber on the file cat, which I did from
> the command line.
>
When you add references to "cat.bib" you have to run C-c C-e l p
again to generate "cat.blg".

> # note that I saved all your stuff in my download folder
> $ cd ~/Downloads
> $ biber cat
>
> Make sure you have the biber executable installed. I didn't know
> anything about it and thought biblatex might provide it. I had to
> explicitly install biber. You should be a path as the response to the
> following if you have it:
>
> $ which biber
>
> Running biber generated .bbl.

Then run "biber cat" on the command line to generate "cat.bbl". Then
you can run "C-c C-e l p" on "cat.org" which generates "cat.pdf"
which includes the bibliography! Yahay! Success! 
>
> Then, re-running C-c C-e l p from Org works for me (at least I think;
> see attached to verify).
>
> Lastly, when I encountered an error, I googled to find out what to do:
> - Using biber: http://tex.stackexchange.com/questions/26516/how-to-use-biber
> - Why \bibliography was giving me an error:
> http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3907111
>
> If this works, someone can chime in regarding how to modify Org so
> that it will run the necessary biber/biblatex commands so you don't
> have to jump to a command line every time. Or perhaps that's a one
> time thing -- maybe as long as biber generates the .bbl file, you can
> refer to anything you want in that file from then on?

If you have this in your ".emacs"
--8<---------------cut here---------------start------------->8---
;; org to latex customisations, -shell-escape needed for minted
(setq org-export-dispatch-use-expert-ui t ; non-intrusive export dispatch
      org-latex-pdf-process             ; for regular export
      '("xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
                 "biber %b" 
        "xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
        "xelatex -shell-escape -interaction nonstopmode -output-directory %o 
%f"))
--8<---------------cut here---------------end--------------->8---

it will generate the file "cat.bbl" and include the bibliography in
the pdf, without you having to run "biber" from the
command-line. You still need to keep an eye on "*Org PDF LaTeX
Output*" as it is here where it lists any errors it finds, and what
its done and what it recommends you to do.

And I have just generated a complete working "foo.bbl" for my book
that I'm writing using the above code without calling "biber" from
the command-line. It works!
>
> Hope that helps,
> John
>
Yes, John, it very much does. It all works now!

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

Attachment: signature.asc
Description: PGP signature

Reply via email to