[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
some problems with label inserting for enumerate
From: |
Uwe Brauer |
Subject: |
some problems with label inserting for enumerate |
Date: |
Mon, 23 Aug 2021 11:24:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi
Some time ago, well 3 years, Arash suggested to me to use
Arash > Reading your use-case, I suggest you make a LaTeX package with your
Arash > definitions and \usepackage{<name>} that in your .tex file. Then write
Arash > some proper AUCTeX style for that package. Not tested, it could look
Arash > like this:
Arash
Arash > (defun ub/LaTeX-item-enumerate ()
Arash > (TeX-insert-macro "item")
Arash > (save-excursion
Arash > (LaTeX-label environment 'environment)))
Arash
Arash > (TeX-add-style-hook
Arash > "<name>"
Arash > (lambda ()
Arash > (TeX-run-style-hooks "enumitem")
Arash > (add-to-list 'LaTeX-label-alist
Arash > '("enumerate" . "item:")
Arash > t)
Arash > (add-to-list 'LaTeX-item-list
Arash > '("enumerate" . ub/LaTeX-item-enumerate)
Arash > t)))
Uwe> Thanks but this did not work,
Uwe>
Uwe> 1. Put it in my auctex init file and it returned error, when byte
Uwe> compiling it (attached).
Uwe>
Uwe> So I changed it to
Uwe>
Uwe>
Uwe> (defun ub/LaTeX-item-enumerate ()
Uwe> (TeX-insert-macro "item")
Uwe> (save-excursion
Uwe> (LaTeX-label environment 'environment)))
Uwe>
Uwe> (with-eval-after-load "latex"
Uwe> (TeX-add-style-hook
Uwe> "pfsimple" ;just for the pfsimple style
Uwe> (lambda ()
Uwe> (TeX-run-style-hooks "enumitem")
Uwe> (add-to-list 'LaTeX-label-alist
Uwe> '("enumerate" . "item:")
Uwe> t)
Uwe> (add-to-list 'LaTeX-item-list
Uwe> '("enumerate" . ub/LaTeX-item-enumerate)
Uwe> t))))
Uwe>
Uwe> And that worked nicely thanks!
However in recent auctex version, when I open a file that contains
\usepackage{pfsimple}
and running LaTeX-insert-item I obtain an error:
,----
|
| Debugger entered--Lisp error: (void-variable environment)
| (LaTeX-label environment 'environment)
| (save-excursion (LaTeX-label environment 'environment))
| ub/LaTeX-item-enumerate()
| LaTeX-insert-item()
| funcall-interactively(LaTeX-insert-item)
| call-interactively(LaTeX-insert-item nil nil)
| command-execute(LaTeX-insert-item)
`----
What has changed?
Regards
Uwe Brauer
smime.p7s
Description: S/MIME cryptographic signature
- some problems with label inserting for enumerate,
Uwe Brauer <=