I've been a bit stuck getting labels to work properly with
org-mode
. Preferably, I want to use my own labels over anything that org
generates, so I naturally enable this in my personal configuration: (setq org-latex-prefer-user-labels t)
.
However, I cannot seem to get this to work on a file-local level. E.g., say that
I have the org-file and corresponding makefile
:
# -*- org-latex-prefer-user-labels:t -*-
#+TITLE: Test Doc
#+STARTUP: org-latex-prefer-user-labels t
#+OPTIONS: org-latex-prefer-user-labels t
#+BIND: org-latex-prefer-user-labels t
#+PROPERTY: org-latex-prefer-user-labels t
* Test
This is a test: \ref{fig:needed}.
#+CAPTION: Expecting to place a figure here.
#+LABEL: fig:needed
[[./needed.pdf]]
all: test.pdf
%.pdf: %.org
emacs --batch --visit=$< --eval='(org-latex-export-to-pdf)'
Now, the Emacs invocation that make runs will always report undefined
references, so clearly org-latex-prefer-user-labels
never gets set properly
when the exporter is run despite numerous different tags (and combinations of
them).
So, what is the correct way to specify this variable (and other, general variables) such that the exporter picks them up when run in batch-mode from e.g., a makefile?