auctex-devel
[Top][All Lists]
Advanced

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

Re: amsart: shh I forgot to correct the fortification of one command sor


From: Arash Esbati
Subject: Re: amsart: shh I forgot to correct the fortification of one command sorry
Date: Mon, 05 Sep 2022 12:45:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi Uwe,

Uwe Brauer <oub@mat.ucm.es> writes:

Thanks for the changeset.  I have some comments below:

> # HG changeset patch
> # User Uwe Brauer <oub@mat.ucm.es>
> # Date 1662224349 -7200
> #      Sat Sep 03 18:59:09 2022 +0200
> # Node ID a44a02700e8e45e5892a0313c2cea0e2b314f36e
> # Parent  6d3b87b3ebe7e99ce0fd3401e5038326b5784b9a
> Add support for title and its fontitification in amsart
>
> * style/amsart.el ("amsart"): TeX-add-symbols: add commands for title and
> its corresponding fontification.

Is this really what you get when you hit 'C-x 4 a'?

In general, would be possible to put a little more effort in this style
and adjust it amsart.cls?  I've never used it and I don't see a
dedicated manual for it, but I can do:

--8<---------------cut here---------------start------------->8---
\documentclass[8pt]{amsart}

\begin{document}

\part{This is a Part title}
\label{part:this-part-title}

Some Text

\section{This is a section title}
\label{sec:this-section-title}

Some Text

\specialsection{This is a Special Section title}
\label{sec:this-special-section}

Some Text

\subsection{This is a Subsection title}
\label{sec:this-subs-title}


Some Text
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
--8<---------------cut here---------------end--------------->8---

and it compiles fine.  So the missing stuff are the class options and
teaching AUCTeX and RefTeX about \specialsection (and other stuff than I
don't know).

> diff --git a/style/amsart.el b/style/amsart.el
> --- a/style/amsart.el
> +++ b/style/amsart.el
> @@ -7,10 +7,33 @@
>  
>  (TeX-add-style-hook
>   "amsart"
> - (function
> -  (lambda ()
> -    (TeX-run-style-hooks "amsmath" "amsthm")
> -    (LaTeX-add-environments "abstract")))
> + (lambda ()
> +   (TeX-add-symbols
> +    '("address" 1)
> +    '("author" ["Short Form"] "Author(s)")

How about this:

       '("author" ["Short author(s)"] (LaTeX-arg-author "Long author(s)"))

This is at least what styles like mn2e.el do.

> +    '("curraddr" 1)
> +    '("dedicatory" 1)      
> +    '("email" 1)

I think it makes sense to declare this as a verbatim macro (see below.)

> +    '("keywords" 1)
> +    '("subjclass" ["Year"] "List of subjects")
> +    '("thanks" 1)      

This is already available in latex.el, so it can be removed here.

> +    '("title" ["Short Title"] "Title")
> +    '("urladdr" 1))

I think it makes sense to declare this as a verbatim macro, we insert:

(add-to-list 'LaTeX-verbatim-macros-with-braces-local "email")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "urladdr")

> +   (TeX-run-style-hooks "amsmath" "amsthm")
> +   (LaTeX-add-environments "abstract")
> +   (when (and (featurep 'font-latex)
> +              (eq TeX-install-font-lock 'font-latex-setup))
> +     (font-latex-add-keywords '(("author" "[{")
> +                                ("contrib" "[{")
> +                                ("curraddr" "{")
> +                                ("email" "{")
                                   ("email" "")
Remove the brace since is done by syntactic fontification.

> +                                ("dedicatory" "{")
> +                                ("keywords" "{")
> +                                ("subjclass" "[{")
> +                                ("title" "[{")
> +                                ("thanks" "{")

Already in font-latex.el

> +                                ("urladdr" "{"))
                                   ("urladdr" ""))
Remove the brace since is done by syntactic fontification.                      
             
> +                              'function)))
                                 'textual

is the keywords-class used elsewhere in AUCTeX.

And finally add

    (font-latex-set-syntactic-keywords)

in the (when (and (featurep 'font-latex) ... block.

Best, Arash



reply via email to

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