auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] insert a label with the file name as suffix.


From: Arash Esbati
Subject: Re: [AUCTeX-devel] insert a label with the file name as suffix.
Date: Fri, 05 May 2017 18:51:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2

Uwe Brauer <address@hidden> writes:

>     > If you want to put that stuff in your .emacs, try something like this:
>
>     > (with-eval-after-load "latex"
>     >   (add-to-list 'LaTeX-label-alist '("titledquestion" . 
> LaTeX-exam-label)))
>
>     > (require 'reftex)
>
>     > (add-to-list 'reftex-label-alist
>     >              `("titledquestion" ?x
>     >                ,(concat LaTeX-exam-label "%f:")
>     >                "~\\ref{%s}" nil ("ejercicio") ))
>
> The latter did not work.
>
> I tried emacs -Q
> and loaded the file
>
> (require 'reftex)
> (add-to-list 'reftex-label-alist
>              `("titledquestion" ?x
>                ,(concat LaTeX-exam-label "%f:")
>                "~\\ref{%s}" nil ("ejercicio") ))
> and obtained
>
> cons: Symbol's value as variable is void: LaTeX-exam-label

Sigh, sorry, my bad.  `LaTeX-exam-label' is not defined at that point of
time.  Please try this:

--8<---------------cut here---------------start------------->8---
(with-eval-after-load "latex"
  (add-to-list 'LaTeX-label-alist '("titledquestion" . LaTeX-exam-label)))

(with-eval-after-load "tex-style"
  (add-to-list 'reftex-label-alist
               `("titledquestion" ?x
                 ,(concat LaTeX-exam-label "%f:")
                 "~\\ref{%s}" nil ("ejercicio") )))
--8<---------------cut here---------------end--------------->8---

Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]