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: Uwe Brauer
Subject: Re: [AUCTeX-devel] enumerate a kludge
Date: Thu, 23 Aug 2018 09:06:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

   > Uwe Brauer <address@hidden> writes:

   > Yes, sorry, my bad.  I meant something like this for your init file:



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

So I         changed it to 


(defun ub/LaTeX-item-enumerate ()
  (TeX-insert-macro "item")
  (save-excursion
    (LaTeX-label environment 'environment)))

(with-eval-after-load "latex"
(TeX-add-style-hook
 "pfsimple"                             ;just for the pfsimple style
 (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))))

And that worked nicely thanks!

Uwe 

Attachment: error-pfsimple.txt
Description: Text document

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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