From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: Citations with org-ref in apa style) Date: Sat, 17 Jun 2017 12:17:34 -0400 Message-ID: References: <6dc0a293c50c44f3bffeb638fed1b744@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87o9ugrj0o.fsf@t3610> <20170525195704.GB14793@lamasti.net> <20170526112403.GE14793@lamasti.net> <20170616124025.GA2693@lamasti.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMGPt-0004TT-D1 for emacs-orgmode@gnu.org; Sat, 17 Jun 2017 12:17:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMGPo-0000JX-OT for emacs-orgmode@gnu.org; Sat, 17 Jun 2017 12:17:41 -0400 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]:36828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMGPo-0000JH-IT for emacs-orgmode@gnu.org; Sat, 17 Jun 2017 12:17:36 -0400 Received: by mail-io0-x232.google.com with SMTP id y77so44796266ioe.3 for ; Sat, 17 Jun 2017 09:17:36 -0700 (PDT) In-reply-to: <20170616124025.GA2693@lamasti.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Lars =?utf-8?Q?Bj=C3=B8rndal?= Cc: "emacs-orgmode@gnu.org" I think what you want in this case is to redefine how the bibliography link is exported. Maybe something like this: (org-link-set-parameters "bibliography" :export (lambda (bibfile desc format) (cond ((eq format 'html) (org-ref-get-html-bibliography)) ((eq format 'latex) "")))) That way you will get nothing exported for latex (so you have to keep the same heading info for biblatex), and you get the html bibliography too. Lars Bj=C3=B8rndal writes: > On Fri, May 26, 2017 at 01:24:03PM +0200, Lars Bj=C3=B8rndal wrote: > > [...] > >> After a bit of fiddling, I got it. The headers I have now, and which >> work, are: >> >> #+LANGUAGE: no >> #+OPTIONS: toc:nil timestamp:nil time:nil >> #+LATEX_CLASS: article >> #+LaTeX_CLASS_OPTIONS: [a4paper,norsk,12pt,listings-bw,microtype] >> #+LATEX_HEADER: \usepackage{babel} >> #+LATEX_HEADER: \usepackage{fancyhdr} >> #+LATEX_HEADER: \usepackage{csquotes} >> #+LATEX_HEADER: \usepackage[backend=3Dbiber,style=3Dapa]{biblatex} >> #+LATEX_HEADER: \DeclareLanguageMapping{norsk}{norsk-apa} >> >> #+LATEX_HEADER: \usepackage{lastpage} >> #+LATEX_HEADER: \usepackage{hyperref} >> #+LATEX_HEADER: \usepackage{url} >> #+Latex_header: \addbibresource{~/mydoc/smartlaring/ref.bib} >> #+BIBLIOGRAPHY: ~/mydoc/smartlaring/ref apa >> #+Latex_header: \linespread{1.4} > > If I want HTML export with citations, I need to use > `bibliography:ref.bib' at the end, where I want the list of > references. However, when exporting to pdf, it works only if I have > \printbibliography at the end. If I use bibliograph:ref.bib, I get the > following error from pdflatex: > > ! LaTeX Error: Can be used only in preamble. > > See the LaTeX manual or LaTeX Companion for explanation. > Type H for immediate help. > ... > > l.368 \bibliography > {ref} > ? > > If I type H, I get: Your command was ignored. > > What can I do to fix this? > > Thanks and regards, Lars > > >> > On Thu, May 25, 2017 at 05:36:07PM +0100, Eric S Fraga wrote: >> > > On Thursday, 25 May 2017 at 11:47, Lars Bj=C3=B8rndal wrote: >> > > > Hi, list! >> > > > >> > > > I'm currently writing an exam in org-mode with org-ref, >> > installed from >> > > > elpa. I think the institution expects to get the referances in >> > apa >> > > > style. So I wonder if I can do that, and how I can do it. >> > > >> > > Have you tried? What happens? >> > Well, to be honest, I don't know what to replace the line in >> > question >> > with. I'm a novice both in LaTeX and in org-mode/org-ref. >> > Lars >> > >> > References >> > >> > 1. http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/biblatex-contr= ib/biblatex-apa/biblatex-apa.pdf >> > 2. http://kitchingroup.cheme.cmu.edu/ >> > 3. mailto:lars@lamasti.net >> -- 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