emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: jeffspencerd@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: Reftex in Org-Mode exporting and recognizing figures or equations
Date: Sun, 05 Aug 2012 12:18:41 +0100	[thread overview]
Message-ID: <87wr1d37u6.fsf@pank.eu> (raw)
In-Reply-To: <CALmFPZ3wsDxEQwSQrJi5+OO4SMCk=1UXTX+coKAO36gYQYNQkw@mail.gmail.com> (Jeffrey Spencer's message of "Sun, 5 Aug 2012 19:02:53 +1000")

Jeffrey Spencer <jeffspencerd@gmail.com> writes:

> When I use your setup and insert a citation then export to latex I get:
> [[cite:Paper]]
> turns into:
> \ref{cite-Paper}

You need to add them as link types:

See Worg.  Here's my setup

#+begin_src emacs-lisp

;; add latex:link-type [[latex:textsc][small caps]]
(org-add-link-type
 "latex" nil
 (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "<span class=\"%s\">%s</span>" path desc))
    ((eq format 'latex)
     (format "\\%s{%s}" path desc)))))


(org-add-link-type
 "citepos" 'ebib
 (lambda (path desc format)
   (cond
    ((eq format 'latex)
     (if (or (not desc) (equal 0 (search "citepos:" desc)))
         (format "\\posscite{%s}" path)
       (format "\\posscite[%s]{%s}" desc path)
       )))))


(org-add-link-type
 "citep" 'ebib
 (lambda (path desc format)
   (cond
    ((eq format 'latex)
     (if (or (not desc) (equal 0 (search "citep:" desc)))
         (format "\\citep{%s}" path)
       (format "\\citep[%s]{%s}" desc path)
       )))))

(org-add-link-type
 "citet" 'ebib
 (lambda (path desc format)
   (cond
    ((eq format 'latex)
     (if (or (not desc) (equal 0 (search "citet:" desc)))
         (format "\\citet{%s}" path)
       (format "\\citet[%s]{%s}" desc path)
       )))))


(org-add-link-type
 "citeauthor" 'ebib
 (lambda (path desc format)
   (cond
    ((eq format 'latex)
     (if (or (not desc) (equal 0 (search "citeauthor:" desc)))
         (format "\\citeauthor{%s}" path)
       (format "\\citeauthor[%s]{%s}" desc path)
       )))))

(org-add-link-type
 "citeyear" 'ebib
 (lambda (path desc format)
   (cond
    ((eq format 'latex)
     (if (or (not desc) (equal 0 (search "citeyear:" desc)))
         (format "\\citeyear{%s}" path)
       (format "\\citeyear[%s]{%s}" desc path)
       )))))


(org-add-link-type
 "cite" 'ebib
 (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "(<cite>%s</cite>)" path))
    ((eq format 'latex)
     (if (or (not desc) (equal 0 (search "cite:" desc)))
         (format "\\textcite{%s}" path)
       (format "\\textcite[%s][%s]{%s}"
               (cadr (split-string desc ";"))
               (car (split-string desc ";"))  path))))))


  (org-add-link-type
   "parencite" 'ebib
   (lambda (path desc format)
     (cond
      ((eq format 'html)
       (format "(<cite>%s</cite>)" path))
      ((eq format 'latex)
       (if (or (not desc) (equal 0 (search "parencite:" desc)))
           (format "\\parencite{%s}" path)
         (format "\\parencite[%s][%s]{%s}"
                 (cadr (split-string desc ";"))
                 (car (split-string desc ";"))  path))))))
#+end_src

-- 
When the facts change, I change my mind. What do you do, sir?

      reply	other threads:[~2012-08-05 11:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  3:39 Reftex in Org-Mode exporting and recognizing figures or equations Jeffrey Spencer
2012-08-03  6:20 ` Thomas S. Dye
2012-08-03  9:38 ` Rasmus
2012-08-05  9:02   ` Jeffrey Spencer
2012-08-05 11:18     ` Rasmus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wr1d37u6.fsf@pank.eu \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    --cc=jeffspencerd@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).