Re: [O] Reftex in Org-Mode exporting and recognizing figures or equations

2012-08-05 Thread Jeffrey Spencer
When I use your setup and insert a citation then export to latex I get:
[[cite:Paper]]
turns into:
\ref{cite-Paper}


On Fri, Aug 3, 2012 at 7:38 PM, Rasmus ras...@gmx.us wrote:

 (defun org-mode-reftex-setup ()
 (load-library reftex)
 (and (buffer-file-name)
  (file-exists-p (buffer-file-name))
  (reftex-parse-all))
 (make-local-variable 'reftex-cite-format)
 (setq reftex-cite-format 'org)
 (define-key org-mode-map (kbd C-c )) 'reftex-citation))

   (add-hook 'org-mode-hook 'org-mode-reftex-setup)


 (eval-after-load 'reftex-vars
   '(progn

  (add-to-list 'reftex-cite-format-builtin
   '(org Org-mode citation
 ((?\C-m . [[cite:%l]])
  (?t . [[textcite:%l]])
  (?p . [[parencite:%l]])
  (?s . [[posscite:%l]])
  (?a . [[citeauthor:%l]])
  (?y . [[citeyear:%l]]))



Re: [O] Reftex in Org-Mode exporting and recognizing figures or equations

2012-08-05 Thread Rasmus
Jeffrey Spencer jeffspenc...@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?



Re: [O] Reftex in Org-Mode exporting and recognizing figures or equations

2012-08-03 Thread Thomas S. Dye
Aloha Jeffrey,

Jeffrey Spencer jeffspenc...@gmail.com writes:

 1) I was wondering if anyone has got the reftex feature of easily
 recognizing the figures and equations to insert as a ref command to work in
 org-mode.

I'm not aware of this being done. 


 2) Also I had seen on a website that you can use the command to get
 org-mode type citations. This seems to export to latex as a \ref command
 with citep in the middle (eg. \ref{citep}).
 (reftex-set-cite-format
 [[citep][%l]])
 This doesn't seem to work for me but maybe I'm doing something wrong.

There are some examples of how to manage citations in Org mode here:

http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-17-2

I'm really enjoying ebib in this regard.  It recognizes both Org mode
and LaTeX mode documents, so is ready to work with me in both of my
writing environments.

hth,
Tom

 1) I was wondering if anyone has got the reftex feature of easily recognizing 
 the figures and equations to insert as a ref command to work in org-mode.2) 
 Also I had seen on a website that you can use the command to get org-mode 
 type citations. This seems to export to latex as a \ref command with citep in 
 the middle (eg. \ref{citep}).

 (reftex-set-cite-format    [[citep][%l]])This doesn#39;t seem to work for 
 me but maybe I#39;m doing something wrong.

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Reftex in Org-Mode exporting and recognizing figures or equations

2012-08-03 Thread Rasmus

Jeffrey Spencer jeffspenc...@gmail.com writes:

 1) I was wondering if anyone has got the reftex feature of easily
 recognizing the figures and equations to insert as a ref command to work in
 org-mode.

I haven't gotten this to work.  It's doable, but requires some work.
For now I'd be happy if I could replace the \ref

 2) Also I had seen on a website that you can use the command to get
 org-mode type citations. This seems to export to latex as a \ref command
 with citep in the middle (eg. \ref{citep}).
 (reftex-set-cite-format
 [[citep][%l]])
 This doesn't seem to work for me but maybe I'm doing something wrong.

Here's my setup which works decently:

#+begin_src emacs-lisp
(defun org-mode-reftex-setup ()
(load-library reftex)
(and (buffer-file-name)
 (file-exists-p (buffer-file-name))
 (reftex-parse-all))
(make-local-variable 'reftex-cite-format)
(setq reftex-cite-format 'org)
(define-key org-mode-map (kbd C-c )) 'reftex-citation))

  (add-hook 'org-mode-hook 'org-mode-reftex-setup)


(eval-after-load 'reftex-vars
  '(progn

 (add-to-list 'reftex-cite-format-builtin
  '(org Org-mode citation
((?\C-m . [[cite:%l]])
 (?t . [[textcite:%l]])
 (?p . [[parencite:%l]])
 (?s . [[posscite:%l]])
 (?a . [[citeauthor:%l]])
 (?y . [[citeyear:%l]]))
#+end_src

I add nodes manually with C-l after inserting, if needed.

–Rasmus

-- 
⠠⠵




[O] Reftex in Org-Mode exporting and recognizing figures or equations

2012-08-02 Thread Jeffrey Spencer
1) I was wondering if anyone has got the reftex feature of easily
recognizing the figures and equations to insert as a ref command to work in
org-mode.

2) Also I had seen on a website that you can use the command to get
org-mode type citations. This seems to export to latex as a \ref command
with citep in the middle (eg. \ref{citep}).
(reftex-set-cite-format
[[citep][%l]])
This doesn't seem to work for me but maybe I'm doing something wrong.