>>> "Arash" == Arash Esbati <[email protected]> writes:

   > Hi Uwe,
   > Uwe Brauer <[email protected]> writes:

   >> I played around a bit the thing I miss most is the automatic insertion
   >> of labels, but that might be a job of reftex?!

   > Thanks, does it mean that everything else worked fine?  If yes, I would
   > make a proper submission and update the style.

As I said right now I have to finish some work and depend heavily on the
possibility to insert theorems, lemma in the most comfortable fashion. I
will show my solution below.

   > Reg. automatic label insertion, yes, you have to tell RefTeX about your
   > new environment and update `reftex-label-alist'.  Note that `?e' is for
   > equations, choose another `key-type' acc. to your needs.

   > \documentclass{article}

[...]

Now wait, all what you said below is true and I am aware of it. But this
is not automatically insertion of labels.

Take my solution:

,----
| (defun LaTeX-thm-insert (environment) ;Version:1.20
|   (if (y-or-n-p
|          (format "Do you want a title "))
|     (let ((title (read-input "(optional) Title: ")))
|     (LaTeX-insert-environment "thm" (concat "[" title "]"))
|     (and (LaTeX-label environment)
|        (newline-and-indent)))
|     (LaTeX-insert-environment "thm")
|     (and (LaTeX-label environment)
|        (newline-and-indent))))
`----

This function of course is in

,----
| (defun my-LaTeX-TeX-add-symbols ()
|      (LaTeX-add-environments
|        '("newequation" LaTeX-env-label)
|        '("appendices" LaTeX-env-label)
|        '("subappendices" LaTeX-env-label)
|        '("thm" LaTeX-thm-insert)))
| (add-hook 'LaTeX-mode-hook 'my-LaTeX-TeX-add-symbols)
`----

So as you can see a label is added automatically. Couldn't you provide
that functionality?


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

Reply via email to