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: Uwe Brauer
Subject: Re: [AUCTeX-devel] insert a label with the file name as suffix.
Date: Fri, 05 May 2017 10:52:23 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Hi Arash,


   > Uwe Brauer <address@hidden> writes:

   > Hi Uwe,

   > have a look at the defintion of `LaTeX-label': it looks if the variable
   > `LaTeX-label-function' contains a function and then runs it for label
   > insertion.  I have `(setq reftex-plug-into-AUCTeX t)' in my .emacs and
   > it gives me:


[Snip]...


   > 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.

I will play a bit with your variable suggestion.


Debugger entered--Lisp error: (wrong-number-of-arguments setq 21) (setq
  reftex-label-alist (quote (("equation" 101 "eq:%f:" "~(\\ref{%s})" t
  ("Equation" "Eq." "Eqn." "Gleichung" "Gl.")) ("neweq" 101 "eq:%f:"
  "~(\\ref{%s})" t ("Equation" "Eq." "Eqn." "Gleichung" "Gl."))
  ("newequation" 101 "eq:%f:" "~(\\ref{%s})" t ("Equation" "Eq." "Eqn."
  "Gleichung" "Gl.")) ("axiom" 97 "ax:%f:" "~\\ref{%s}" nil ("Axiom"
  "Ax.")) ("func" 70 "fnc:%f:" "~\\ref{%s}" nil ("funci'on" "Fnc"))
  ("fact" 67 "fct:%f:" "~\\ref{%s}" nil ("Fact" "Fct")) ("script" 84
  "scpt:%f:" "~\\ref{%s}" nil ("Script" "scpt")) ("titledquestion" 120
  (\, LaTeX-exam-label)))) ("claim" 107 "clm:%f:" "~\\ref{%s}" t
  ("Claim" "claim")) ("thm" 104 "thr:%f:" "~\\ref{%s}" t ("Theorem"
  "Theor." "Th.")) ("example" 69 "ex:%f:" "~\\ref{%s}" t ("Example"
  "Ejemplo")) ("ex" 65 "ex:%f:" "~\\ref{%s}" t ("Ejercicio"
  "ejercicio")) ("cor" 99 "cor:%f:" "~\\ref{%s}" t ("Corollary" "Cor."
  "C.")) ("rem" 82 "rem:%f:" "~\\ref{%s}" t ("Remark" "rem." "R."))
  ("SaveListing" 86 "SvL:%f:" "~\\ref{%s}" t ("SaveL") -1) ("prac" 80
  "prac:%f:" "~\\ref{%s}" t ("Practica" "prac." "P.")) ("prop" 112
  "prop:%f:" "~\\ref{%s}" t ("Proposicion" "proposition" "prop." "P."))
  ("sol" 111 "sol:%f:" "~\\ref{%s}" t ("Solucion" "sol." "S."))
  ("lstlisting" 71 "lstl:%f:" "~\\ref{%s}" t ("lstlisting" "lst." "L."))
  ("lem" 76 "lem:%f:" "~\\ref{%s}" nil ("Lemma" "Lema")) ("slide" 108
  "slide:%f:" "~\\ref{%s}" t ("slide")) ("Slide" 83 "slide:%f:"
  "~\\ref{%s}" t ("slide")) ("prop" 77 "prop:%f:" "~\\ref{%s}" t
  ("Proposicion" "prop." "P.")) ("\\myfig" 102 "fig:%f:" nil 2) ("defn"
  68 "def:%f:" "~\\ref{%s}" nil ("Definition" "Definici'on"))
  ("enumerate" 105 "item:%f:" "~\\ref{%s}" item (regexp "Items?"
  "Punkte?")) AMSTeX) my-reftex-label-alist-6()
  run-hooks(reftex-mode-hook) reftex-mode(t) turn-on-reftex()
  run-hooks(change-major-mode-after-body-hook text-mode-hook
  TeX-mode-hook LaTeX-mode-hook) apply(run-hooks
  (change-major-mode-after-body-hook text-mode-hook TeX-mode-hook
  LaTeX-mode-hook)) TeX-run-mode-hooks(text-mode-hook TeX-mode-hook
  LaTeX-mode-hook) TeX-latex-mode() apply(TeX-latex-mode nil)
  LaTeX-mode() funcall-interactively(LaTeX-mode)
  call-interactively(LaTeX-mode nil nil) command-execute(LaTeX-mode)






   > Best, Arash



reply via email to

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