emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-ref not working when exporting to LaTeX
@ 2022-05-11 17:41 Alessandro Bertulli
  2022-05-11 18:14 ` Daniel Fleischer
  0 siblings, 1 reply; 6+ messages in thread
From: Alessandro Bertulli @ 2022-05-11 17:41 UTC (permalink / raw)
  To: emacs-orgmode

Hi all!

I'm trying to set up an academic workflow, and being unsure about which
framework to use, I gave org-ref a try. However, I can't make it produce
a correct LaTeX PDF file.

I'm going to post my setup in a minute. The
point is: when exporting the org file to LaTeX (C-c C-e l o), a PDF file
gets produced, but it doesn't process the citation keys. For example, in
my file (see below), I got the key "acm:code" literally printed on the
PDF file, in a bold font.

What am I doing wrong?

This is my setup:

init.el ------------------------
(require 'org-ref)
(setq bibtex-completion-bibliography '("~/Library/debug.bib"))
(require 'org-ref-ivy)

(define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link-hydra/body)

(setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))

(setq org-ref-insert-link-function 'org-ref-insert-link-hydra/body
      org-ref-insert-cite-function 'org-ref-cite-insert-ivy
      org-ref-insert-label-function 'org-ref-insert-label-link
      org-ref-insert-ref-function 'org-ref-insert-ref-link
      org-ref-cite-onclick-function (lambda (_) (org-ref-citation-hydra/body)))

org-ref-test-file.org ----------------------------

#+title: Org-ref test file
#+bibliography:~/Library/debug.bib
#+latex_header: \usepackage[citestyle=authoryear-icomp,bibstyle=authoryear, hyperref=true,backref=true,maxcitenames=3,url=true,backend=biber,natbib=true] {biblatex}
#+latex_header: \addbibresource{~/Library/debug.bib}

* Introduction
Lorem ipsum dolor sit amet [[cite:&acm:code]], consectetur adipisci elit, sed do eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrum exercitationem ullamco laboriosam, nisi ut aliquid ex ea commodi consequatur. Duis aute irure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

~/Library/debug.bib ------------------------

@book{acm:code,
  title = {{{ACM}} Code of Ethics and Professional Conduct. {{Affirming}} Our Obbligation to Use Our Skills to Benefit Society},
  editor = {{Association for Computing Machinery}},
  date = {2018},
  doi = {10.1145/3274591},
  url = {https://www.acm.org/binaries/content/assets/about/acm-code-of-ethics-booklet.pdf},
  shorteditor = {ACM}
}

@article{acm:teachingethics,
  title = {How to Teach Computer Ethics through Science Fiction},
  author = {Burton, Emanuelle and Goldsmith, Judy and Mattei, Nicholas},
  date = {2018-07},
  journaltitle = {Communications of The Acm},
  shortjournal = {Commun. ACM},
  volume = {61},
  number = {8},
  pages = {54--64},
  publisher = {{Association for Computing Machinery}},
  location = {{New York, NY, USA}},
  issn = {0001-0782},
  doi = {10.1145/3154485},
  url = {https://doi.org/10.1145/3154485},
  abstract = {Science fiction in particular offers students a way to cultivate their capacity for moral imagination.},
  issue_date = {August 2018},
  pagetotal = {11}
}

---------------------------------

Thanks for your patience,

Alessandro Bertulli


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org-ref not working when exporting to LaTeX
  2022-05-11 17:41 Alessandro Bertulli
@ 2022-05-11 18:14 ` Daniel Fleischer
  2022-05-11 18:17   ` John Kitchin
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Fleischer @ 2022-05-11 18:14 UTC (permalink / raw)
  To: Alessandro Bertulli; +Cc: emacs-orgmode

Alessandro Bertulli [2022-05-11 Wed 19:41] wrote:

> I'm going to post my setup in a minute. The
> point is: when exporting the org file to LaTeX (C-c C-e l o), a PDF file
> gets produced, but it doesn't process the citation keys. For example, in
> my file (see below), I got the key "acm:code" literally printed on the
> PDF file, in a bold font.

Hi, org-ref uses its own export engine which you call via (C-c C-e r p).
Please try that and report back if there are still issues. 

-- 

Daniel Fleischer


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org-ref not working when exporting to LaTeX
  2022-05-11 18:14 ` Daniel Fleischer
@ 2022-05-11 18:17   ` John Kitchin
  2022-05-11 18:48     ` Daniel Fleischer
  2022-05-11 18:59     ` Bruce D'Arcus
  0 siblings, 2 replies; 6+ messages in thread
From: John Kitchin @ 2022-05-11 18:17 UTC (permalink / raw)
  To: Daniel Fleischer; +Cc: Alessandro Bertulli, org-mode-email

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

The regular export is preferred for LaTeX (C-c C-e l o) is preferred for
LaTeX export as it generates the LaTeX cite commands. The version in C-c
C-e r p uses CSL for the formatting, not LaTeX, and it allows you to get
nicely formatted results without using bibtex/biblatex as the citation
processor.

John

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



On Wed, May 11, 2022 at 2:15 PM Daniel Fleischer <danflscr@gmail.com> wrote:

> Alessandro Bertulli [2022-05-11 Wed 19:41] wrote:
>
> > I'm going to post my setup in a minute. The
> > point is: when exporting the org file to LaTeX (C-c C-e l o), a PDF file
> > gets produced, but it doesn't process the citation keys. For example, in
> > my file (see below), I got the key "acm:code" literally printed on the
> > PDF file, in a bold font.
>
> Hi, org-ref uses its own export engine which you call via (C-c C-e r p).
> Please try that and report back if there are still issues.
>
> --
>
> Daniel Fleischer
>
>

[-- Attachment #2: Type: text/html, Size: 1805 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org-ref not working when exporting to LaTeX
  2022-05-11 18:17   ` John Kitchin
@ 2022-05-11 18:48     ` Daniel Fleischer
  2022-05-11 18:59     ` Bruce D'Arcus
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Fleischer @ 2022-05-11 18:48 UTC (permalink / raw)
  To: John Kitchin; +Cc: Alessandro Bertulli, org-mode-email

John Kitchin [2022-05-11 Wed 14:17] wrote:

> The regular export is preferred for LaTeX (C-c C-e l o) is preferred for LaTeX export as it generates the LaTeX cite
> commands. The version in C-c C-e r p uses CSL for the formatting, not LaTeX, and it allows you to get nicely formatted
> results without using bibtex/biblatex as the citation processor.

Oops! Thanks for correcting my answer and mentioning the difference
between the CSL and bibtex engines. 

-- 

Daniel Fleischer


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org-ref not working when exporting to LaTeX
  2022-05-11 18:17   ` John Kitchin
  2022-05-11 18:48     ` Daniel Fleischer
@ 2022-05-11 18:59     ` Bruce D'Arcus
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce D'Arcus @ 2022-05-11 18:59 UTC (permalink / raw)
  To: John Kitchin; +Cc: Daniel Fleischer, Alessandro Bertulli, org-mode-email

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]

This is an aside, but I recently learned about citeproc-lua, which adds CSL
processing directly to tex and latex.

https://github.com/zepinglee/citeproc-lua

Now included in texlive 2022.

As that evolves more (there are still missing features), it could be
another viable alternative.

On Wed, May 11, 2022 at 2:19 PM John Kitchin <jkitchin@andrew.cmu.edu>
wrote:
>
> The regular export is preferred for LaTeX (C-c C-e l o) is preferred for
LaTeX export as it generates the LaTeX cite commands. The version in C-c
C-e r p uses CSL for the formatting, not LaTeX, and it allows you to get
nicely formatted results without using bibtex/biblatex as the citation
processor.
>
> John
>
> -----------------------------------
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Wed, May 11, 2022 at 2:15 PM Daniel Fleischer <danflscr@gmail.com>
wrote:
>>
>> Alessandro Bertulli [2022-05-11 Wed 19:41] wrote:
>>
>> > I'm going to post my setup in a minute. The
>> > point is: when exporting the org file to LaTeX (C-c C-e l o), a PDF
file
>> > gets produced, but it doesn't process the citation keys. For example,
in
>> > my file (see below), I got the key "acm:code" literally printed on the
>> > PDF file, in a bold font.
>>
>> Hi, org-ref uses its own export engine which you call via (C-c C-e r p).
>> Please try that and report back if there are still issues.
>>
>> --
>>
>> Daniel Fleischer
>>

[-- Attachment #2: Type: text/html, Size: 2343 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org-ref not working when exporting to LaTeX
@ 2022-05-12 14:40 Alessandro Bertulli
  0 siblings, 0 replies; 6+ messages in thread
From: Alessandro Bertulli @ 2022-05-12 14:40 UTC (permalink / raw)
  To: jkitchin, danflscr; +Cc: emacs-orgmode

Thank you professor Kitchin.

Our org-LaTeX-pdf-process differ only for the "-f" option, so I don't
think that's the cause. However, it turned out that biber was NOT
installed with my TeX distribution. After installing it, it all worked
well. Sorry if this actually silly error got some headaches.

Daniel, thanks for your suggestion. Your advice and professor Kitchin's
answer actually questioned me: I know basically nothing about the
differences between LaTeX, biblatex and CSL, so I think I need to
investigate that before deciding wich one to use.

Thanks again,
Alessandro Bertulli


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-12 14:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-12 14:40 Org-ref not working when exporting to LaTeX Alessandro Bertulli
  -- strict thread matches above, loose matches on Subject: below --
2022-05-11 17:41 Alessandro Bertulli
2022-05-11 18:14 ` Daniel Fleischer
2022-05-11 18:17   ` John Kitchin
2022-05-11 18:48     ` Daniel Fleischer
2022-05-11 18:59     ` Bruce D'Arcus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).