auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] amsmath, amsthm automatially insert thm, lemma etc


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] amsmath, amsthm automatially insert thm, lemma etc
Date: Mon, 12 Oct 2015 07:58:49 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Uwe Brauer <address@hidden> writes:

Hi Uwe,

> 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?

amsmath or amsthm do not provide a thm environment, at least not in the
version v2.20.2 which is provided by TeXLive 2015.

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{amsthm}

\begin{document}

% ERROR: LaTeX Error: Environment thm undefined.
\begin{thm}
  This is a theorem.
\end{thm}

\end{document}
--8<---------------cut here---------------end--------------->8---

But when I define a new theorem environment, that will show up in `C-c
C-e'.

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{amsthm}
\newtheorem{mythm}{My cool Theorem} %% \newtheorem shows up in C-c RET

\begin{document}

\begin{mythm} %% mythm now shows up in C-c C-e
  This is a test.
\end{mythm}

\end{document}
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo




reply via email to

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