[O] Change latex export to use cref

2013-06-25 Thread Derek Thomas
Is there a variable that can be set so that latex export uses \cref instead
of \ref?  Thanks,

Derek


Re: [O] Change latex export to use cref

2013-06-25 Thread Eric Schulte
Derek Thomas derekctho...@gmail.com writes:

 Is there a variable that can be set so that latex export uses \cref instead
 of \ref?  Thanks,


Adding the following to your config should work.

;; -*- emacs-lisp -*-
(defun org-latex-ref-to-cref (text backend info)
  Use \\cref instead of \\ref in latex export.
  (when (org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string ref{ cref{ text)))

(add-to-list 'org-export-filter-final-output-functions
 'org-latex-ref-to-cref)

Hope this helps,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte