From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Integration of RefTeX and LaTeX export Date: Thu, 16 Feb 2012 12:08:10 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry9Uy-0004Qa-HF for emacs-orgmode@gnu.org; Thu, 16 Feb 2012 17:08:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ry9Uw-0002CF-PG for emacs-orgmode@gnu.org; Thu, 16 Feb 2012 17:08:20 -0500 Received: from oproxy6-pub.bluehost.com ([67.222.54.6]:55824) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Ry9Uw-0002C8-JF for emacs-orgmode@gnu.org; Thu, 16 Feb 2012 17:08:18 -0500 In-Reply-To: (Andreas Willig's message of "Fri, 17 Feb 2012 09:59:57 +1300") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Willig Cc: emacs-orgmode@gnu.org Andreas Willig writes: > Hi, > > i am relatively new to org mode. Yesterday i have tried to use org mode for > the first time to write the beginnings of a paper, and found that i wanted to > insert literature references and a bibliography. I like RefTeX a lot and google > provided me some links for proper integration. As a result, i have added the > stuff to my .emacs that you find below. The "org-latex-to-pdf-process" stuff > works. > > My problems are related to (reftex-set-cite-format ..). Right now i do not use > it and get the default implementation by which RefTeX simply expands the > chosen reference to \cite{Key}, which is not highlighted in the org buffer. I would > like to have this expanded into an org link with the [[][]] syntax. I have tried > several variations of (reftex-set-cite-format ...) but i have never succeeded in > creating the bibliography. After generating the LaTeX output into a buffer > (C-c C-e L) i found that org translates [[][]] type of stuff into \hyperref{}s and not > into \cite{} commands. > > So, how can i change things so that in the org buffer the bib key gets displayed > nicely and in the LaTeX output a \cite{} command is generated? > > Any help would be appreciated!! > > Best regards, > > Andreas > > -------------------------------------- > > (require 'org-latex) > (unless (boundp 'org-export-latex-classes) > (setq org-export-latex-classes nil)) > > > (add-to-list 'org-export-latex-classes > '("article" > "\\documentclass{article}" > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}"))) > > (add-to-list 'org-export-latex-classes > '("komaarticle" > "\\documentclass{scrartcl}" > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}"))) > > > (add-to-list 'org-export-latex-classes > '("komabook" > "\\documentclass{scrbook}" > ("\\chapter{%s}" . "\\chapter*{%s}") > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}"))) > > > (defun org-mode-reftex-setup () > (load-library "reftex") > (and (buffer-file-name) (file-exists-p (buffer-file-name)) > (progn > (global-auto-revert-mode t) > (reftex-parse-all) > ;;(reftex-set-cite-format "\[cite][%l]]") > )) > (define-key org-mode-map (kbd "C-c )") 'reftex-citation) > (define-key org-mode-map (kbd "C-c (") 'org-mode-reftex-search)) > > (add-hook 'org-mode-hook 'org-mode-reftex-setup) > > > (defun org-mode-reftex-search () > ;;jump to the notes for the paper pointed to at from reftex search > (interactive) > (org-open-link-from-string (format "[[notes:%s]]" (reftex-citation t)))) > > (setq org-latex-to-pdf-process > '("pdflatex -interaction nonstopmode %b" > "bibtex %b" > "pdflatex -interaction nonstopmode %b" > "pdflatex -interaction nonstopmode %b")) > > > This email may be confidential and subject to legal privilege, it may > not reflect the views of the University of Canterbury, and it is not > guaranteed to be virus free. If you are not an intended recipient, > please notify the sender immediately and erase all copies of the message > and any attachments. > > Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more > information. > > Aloha Andreas, Welcome to Org Mode! You might want to define a new link type. See http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-17-2 for one example of how this might be done. hth, Tom -- Thomas S. Dye http://www.tsdye.com