Hi Arash,

2015-10-18 12:06 GMT+02:00 Arash Esbati <[email protected]>:
> Hi Uwe,
>
> Uwe Brauer <[email protected]> writes:
>
>> Maybe I am missing something elementary.
>> Is it is possible to have automatically inserted theorem, lemmas etc
>> when using either amsmath or amsthm style. I cannot get it to work so I
>> have
>>
>> (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))))
>>
>> But is this necessary?
>
> Besides the discussion about `subfiles' package, I think `amsthm.el'
> could do a better job reg. new environments defined and optional
> headings.  Further it has a bug in the way it uses `TeX-arg-length':
>
> --8<---------------cut here---------------start------------->8---
>     '("newtheoremstyle" "Style name" (TeX-arg-length nil "Space above")
>       (TeX-arg-length nil "Space below") "Body font" "Indent amount"
>       "Theorem head font" "Punctuation after head"
>       (TeX-arg-length nil "Space after head") "Theorem head spec"))
> --8<---------------cut here---------------end--------------->8---
>
> The string "Space above" for example becomes `Initial-Input' and not
> `Prompt'.  I'm attaching an improved version of `amsthm.el'.  Could you
> give it a try?  I have never used the package so I would be grateful if
> you could test it and give some feedback here.

Thanks for your contribution.  I didn't have the time to actually test
it, but it looks good.  Just out of curiosity: isn't

    (format "%s" heading)

the same as

    heading

?

Cheers,
Mosè

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

Reply via email to