[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX] Re: Items in itemize-like environments
From: |
Ralf Angeli |
Subject: |
[AUCTeX] Re: Items in itemize-like environments |
Date: |
Wed, 19 Apr 2006 21:35:44 +0200 |
* Nikos Apostolakis (2006-04-19) writes:
> Ralf Angeli <address@hidden> writes:
>
>> * Nikos Apostolakis (2006-04-11) writes:
>>
>>> I am using the exam document class. In that class there are two new
>>> itemize-like environments defined, namely "questions" whith each item
>>> called "question" and "parts" with each item called "part". I would
>>> like to use the command "LaTeX-insert-item" to insert items for
>>> these environments.
>>
>> (add-to-list 'LaTeX-item-list
>> '("questions" . (lambda () (insert "\\question"))))
>>
>
> How should I change this so that when I hit "M-RET" inside a
> "questions" environment, Emacs inserts "\question" and asks me "how
> many points is this question worth?". The answer should then become
> a label, eg if the answer is "100" then "\question[100]" is
> inserted.
You could use something like
(add-to-list 'LaTeX-item-list
'("questions" .
(lambda ()
(let ((value (read-from-minibuffer
"How many points is this question worth? ")))
(insert (concat "\\question" (unless (string= value "")
(format "[%s]" value))))))))
> Ideally the previous answer should be the default,
You could do this with a global variable you set to the value used
last. For an example you can look at the function `LateX-environment'
in latex.el.
> similarly, to what happens when the environment "proof" is inserted
> for example.
For this environment the last value is not being saved in my case.
> A pointer to the documentation or the source code (eg in the
> definitions for the environment "proof") would be great.
style/amsthm.el
--
Ralf
- [AUCTeX] Items in itemize-like environments, Nikos Apostolakis, 2006/04/11
- [AUCTeX] Re: Items in itemize-like environments, Ralf Angeli, 2006/04/11
- [AUCTeX] Re: Items in itemize-like environments, Nikos Apostolakis, 2006/04/12
- [AUCTeX] Re: Items in itemize-like environments, Ralf Angeli, 2006/04/13
- [AUCTeX] Re: Items in itemize-like environments, Nikos Apostolakis, 2006/04/13
- [AUCTeX] Re: Items in itemize-like environments, Ralf Angeli, 2006/04/13
- [AUCTeX] Re: Items in itemize-like environments, Nikos Apostolakis, 2006/04/13
- [AUCTeX] Re: Items in itemize-like environments, Ralf Angeli, 2006/04/14
[AUCTeX] Re: Items in itemize-like environments, Nikos Apostolakis, 2006/04/19
- [AUCTeX] Re: Items in itemize-like environments,
Ralf Angeli <=
- [AUCTeX] Re: Items in itemize-like environments, Nikos Apostolakis, 2006/04/21
- Re: [AUCTeX] Re: Items in itemize-like environments, Ralf Angeli, 2006/04/23
- [AUCTeX] Re: Items in itemize-like environments, Nikos Apostolakis, 2006/04/28
- Re: [AUCTeX] Re: Items in itemize-like environments, David Kastrup, 2006/04/28
- [AUCTeX] Re: Items in itemize-like environments, Nikos Apostolakis, 2006/04/28
- Re: [AUCTeX] Re: Items in itemize-like environments, David Kastrup, 2006/04/28