Uwe Brauer <[email protected]> writes:

>    > I think the issue is somewhere else: In exam.el,
>    > `LaTeX-exam-insert-label' is used for "titledquestion" and
>    > "bonustitledquestion".  IIRC, you have to add these environments to
>    > `LaTeX-label-alist' and `reftex-label-alist' in order to get what you
>    > want, e.g.
>
>    >     (add-to-list 'LaTeX-label-alist '("titledquestion" . 
> LaTeX-exam-label))
>
>    > and
>
>    >     (add-to-list 'reftex-label-alist
>    >                  `("titledquestion" ?x ,LaTeX-exam-label ...))
>
> Thanks for your answer. I tried out the following
> I set
>
> (add-to-list 'LaTeX-label-alist '("titledquestion" . LaTeX-exam-label))
>
> And then I replaced
>
>   (setq reftex-label-alist
>         '(("titledquestion"   ?t "exm:%f:"  "~\\ref{%s}" nil ("ejercicio"  
> ))))
>
> By
>
>   (setq reftex-label-alist
>         '(("titledquestion" ?x ,LaTeX-exam-label)))       
>
> Are you sure about that syntax? Now when entering a new latex file I
> obtain an error.

Hi Uwe,

I didn't test it, but I'm pretty sure about the syntax ;-)  If you look
closer at my code above for RefTeX, you'll see that it uses backquote `
and not a quote '.  See here for why[1].

If you want to put that stuff in your .emacs, try something like this:

--8<---------------cut here---------------start------------->8---
(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") ))
--8<---------------cut here---------------end--------------->8---

I'm not sure if using ?t is a good idea since it is hard-coded in RefTeX
for tables.

Best, Arash

Footnotes: 
[1]  https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html

_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to