emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Adam Jackson <a.j.jackson@physics.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: reftex breaking after org-mode export [8.2.10 (8.2.10-35-g19a7d6-elpa @ /Users/adamjackson/.emacs.d/elpa/org-20150323/)]
Date: Wed, 25 Mar 2015 09:29:25 -0400	[thread overview]
Message-ID: <m2k2y5dx3e.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <1EAD2758-E620-4D07-9622-16E636B2EBE0@physics.org>

If it is helpful, here is my setup in org-ref:

(require 'reftex)
(defun org-mode-reftex-setup ()
  "Setup `org-mode' and reftex for org-ref."
    (and (buffer-file-name)
         (file-exists-p (buffer-file-name))
         (global-auto-revert-mode t))
    (make-local-variable 'reftex-cite-format)
    (setq reftex-cite-format 'org))

;; define key for inserting citations
(define-key org-mode-map
  (kbd org-ref-insert-cite-key)
  org-ref-insert-cite-function)

(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")     ; default
                          (?d . ",%l")            ; for appending
                          (?a . "autocite:%l")
                          (?t . "citet:%l")
                          (?T . "citet*:%l")
                          (?p . "citep:%l")
                          (?P . "citep*:%l")
                          (?h . "citeauthor:%l")
                          (?H . "citeauthor*:%l")
                          (?y . "citeyear:%l")
                          (?x . "citetext:%l")
                          (?n . "nocite:%l")
                          )))))

I think you might be seeing something like a TeX-master problem. Did you try
this without revtex-parse-all?

Adam Jackson writes:

> Hi,
>
> I've been struggling with Reftex in org-mode. Initially things are fine,
> then after exporting the document to LaTeX and continuing to work with
> org-mode, using most of the reftex features (e.g. reftex-toc or trying to
> insert a reference) produces a "Wrong type argument: stringp, nil" error
> message.
>
> The code in my init file to set up reftex:
>
>     ;; Reftex
>     (require 'reftex)
>     (defun org-mode-reftex-setup ()
>       (load-library "reftex")
>       (and (buffer-file-name) (file-exists-p (buffer-file-name))
>          ;enable auto-revert-mode to update reftex when bibtex file changes on disk
>          (global-auto-revert-mode t)
>          (reftex-parse-all)
>           (define-key org-mode-map (kbd "C-c [") 'reftex-citation)
>          ;add a custom reftex cite format to insert links
>          ;; (reftex-set-cite-format "** [[papers:%l][%l]]: %t \n")
>          )
>     )
>
>     (add-hook 'org-mode-hook 'org-mode-reftex-setup)
>
> At the moment I still enter reftex-mode on demand with "M-x reftex-mode".
> Here is the backtrace for the error:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   re-search-forward(nil 10001 t)
>   tex-main-file()
>   reftex-TeX-master-file()
>   reftex-insert-docstruct(#<buffer paper.org> t "e" nil nil t nil nil ("SEC:lagrange_gibbs_proof" "s" "We define the molar Gibbs free energy in a molecular gas mixture as \\begin{align} \\h" "/my/path/to/the/paper.org" nil) "" nil)
>   byte-code("\306 \307\216\310 \210	\311 \f\203\x1f

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

  reply	other threads:[~2015-03-25 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 11:58 Bug: reftex breaking after org-mode export [8.2.10 (8.2.10-35-g19a7d6-elpa @ /Users/adamjackson/.emacs.d/elpa/org-20150323/)] Adam Jackson
2015-03-25 13:29 ` John Kitchin [this message]
2015-03-25 13:58   ` Adam Jackson
2015-03-25 15:38     ` John Kitchin

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=m2k2y5dx3e.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=a.j.jackson@physics.org \
    --cc=emacs-orgmode@gnu.org \
    /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).