emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Change latex export to use cref
@ 2013-06-26  4:57 Derek Thomas
  2013-06-26  5:43 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Derek Thomas @ 2013-06-26  4:57 UTC (permalink / raw)
  To: Org Mode

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

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

Derek

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

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

* Re: Change latex export to use cref
  2013-06-26  4:57 Change latex export to use cref Derek Thomas
@ 2013-06-26  5:43 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2013-06-26  5:43 UTC (permalink / raw)
  To: Derek Thomas; +Cc: Org Mode

Derek Thomas <derekcthomas@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

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

end of thread, other threads:[~2013-06-26  5:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-26  4:57 Change latex export to use cref Derek Thomas
2013-06-26  5:43 ` Eric Schulte

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).