auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] enumerate a kludge


From: Arash Esbati
Subject: Re: [AUCTeX-devel] enumerate a kludge
Date: Sat, 25 Aug 2018 12:38:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1

Uwe Brauer <address@hidden> writes:

>    > Reading your use-case, I suggest you make a LaTeX package with your
>    > definitions and \usepackage{<name>} that in your .tex file.  Then write
>    > some proper AUCTeX style for that package.  Not tested, it could look
>    > like this:
>
>    > (defun ub/LaTeX-item-enumerate ()
>    >   (TeX-insert-macro "item")
>    >   (save-excursion
>    >     (LaTeX-label environment 'environment)))
>
>    > (TeX-add-style-hook
>    >  "<name>"
>    >  (lambda ()
>    >    (TeX-run-style-hooks "enumitem")
>    >    (add-to-list 'LaTeX-label-alist
>    >          '("enumerate" . "item:")
>    >          t)
>    >    (add-to-list 'LaTeX-item-list
>    >          '("enumerate" . ub/LaTeX-item-enumerate)
>    >          t)))
>
> Thanks but this did not work,
>
>     1.  Put it in my auctex init file and it returned error, when byte
>         compiling it (attached). 

This was expected, hence I wrote:

    "Then write some proper AUCTeX style for that package."

You can put the above code in a file called "pfsimple.el", change
"<name>" to "pfsimple", customize `TeX-style-private' to a directory of
your choice and save "pfsimple.el" there.  Next time you
\usepackage{pfsimple} in your .tex file, AUCTeX will load the style
(with `TeX-parse-self' set to t).

In general, I don't recommend to set this type of stuff in any sort of
init file.

Best, Arash



reply via email to

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