1

I'm new to using LaTeX for writing papers and I'm trying to get a workflow going using LaTeX in Doom Emacs on Arch Linux (all the required texlive packages having first been installed via pacman). However I cannot get LaTeX to render 'citep:' entries - at all!. I want to tangle references as I write and insert them into the thesis as and when I need to. So I'm experimenting with the following dummy org document:

#+TITLE: Workflow Sample
#+PROPERTY: header-args :exports none :tangle "~/Documents/org/bibliography/HAD/references.bib"
#+LATEX_CLASS_OPTIONS: [12pt]
#+LATEX_HEADER: \usepackage[natbib=true]{biblatex} \DeclareFieldFormat{apacase}{#1} \addbibresource{~/Documents/org/bibliography/HAD/references.bib}
#+LATEX_HEADER: \usepackage{parskip}
#+OPTIONS: <:nil c:nil todo:nil H:5
* Generative Methods
** Probability
*** Basic probabilistic methods as a path to musical variation citep:temp2007ElementaryProbability
#+begin_src bibtex
@book{temp2007ElementaryProbability,
title = {Elementary Probability},
author = {Temperley D.},
booktitle = {Music and Probability},
keywords = {probability, probabilistic methods},
year = {2007},
}
#+end_src
There are several basic concepts that are useful to know when thinking about the relationship between probability and musical variation.
Three of the most important ones are: the probability function, the distribution, and joint probability citep:temp2007ElementaryProbability.
* References
:PROPERTIES:
:UNNUMBERED: t
:END:
#+LaTeX: \printbibliography[heading=none]

The above template tangles the natbib entry to the references.bib file OK. It also generates a .tex file with the correct \citep{temp2007DElementaryProbability} entry as expected and a PDF. This would suggest that LaTeX with natbib is working OK. Nevertheless in the PDF output 'citep:temp2007ElementaryProbability' is quoted literally and is not interpreted. Am I missing some configuration in Emacs to get the citep directive to work or what? Any suggestion as to how to solve this issue would be great as it is driving me v-e-r-y s-l-o-w-l-y nuts. Thx in advance...

2
  • That is an org-ref citep link. Do you have org-ref installed and loaded? Commented Mar 7, 2022 at 12:48
  • Hi John. Yes I do with the 'org-ref-default-bibliography' and 'org-ref-pdf-directory' paths correctly set in config.el. If I click on the citep link in the org document I get the Citation menu in emacs with available references displayed so paths are good. I've played with things a bit since posting the question. I have replaced \usepackage[natbib=true]{biblatex} with [round]{natbib} to see if that works but I am now, instead of getting the citep entry displayed literally, I'm getting question marks where each reference should be.
    – KammO
    Commented Mar 7, 2022 at 13:34

1 Answer 1

0

I guess there is a conflict with the default packages you use in org-mode, probably natbib. Try building your file like this:

(let ((org-latex-default-packages-alist nil)
      (org-latex-pdf-process '("latexmk -f -pdf -%latex -bibtex -interaction=nonstopmode -output-directory=%o %f")))
  (org-open-file (org-latex-export-to-pdf)))

In this example, I use a no-default package setup.

https://raw.githubusercontent.com/jkitchin/org-ref/master/examples/biblatex-example.org

8
  • Sounds reasonable John. U mean like in line 4 of my example?
    – KammO
    Commented Mar 7, 2022 at 17:29
  • I'll take a closer look at your model :)
    – KammO
    Commented Mar 7, 2022 at 17:38
  • you are right, I didn't see that line 4 at the end. see the updated answer for a probable reason it is not working for you. Commented Mar 7, 2022 at 18:53
  • Thx for reply John. Unfortunately the setting 'org-latex-default-packages-alist nil' has resulted in no PDF being generated at all. I've had to reload the entire OS-twice since I was enable to reverse this!. I'm at a complete loss as to why clicking on a citep link brings up the Citations Actions menu which in turn displays all the available references in the .bib file as expected but when the PDF is generated the links cant be found. I'm wondering precisely what package or bit of functionality resolves the link in the PDF?
    – KammO
    Commented Mar 9, 2022 at 18:06
  • you should try building your pdf manually from the latex file, it will tell you what the problem is. Clicking and exporting are unrelated, and your problem is certainly on the LaTeX side. If you use the code above, there is no way it should result in something that has to be undone, that is a temporary modification of the variables. Commented Mar 9, 2022 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.