[Top][All Lists]

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

Re: [AUCTeX-devel] Style file for tcolorbox.sty

From: Tassilo Horn
Subject: Re: [AUCTeX-devel] Style file for tcolorbox.sty
Date: Wed, 04 Feb 2015 10:31:58 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Nicolas Vaughan <address@hidden> writes:

Hi Nicolas,

> I created a very basic style file for tcolorbox.sty (attached here).

> ;; Insert an tcolorbox environment and ask for an optional title
> (defun LaTeX-tcolorbox-env-item-opt-label (environment)
>   "Insert a `tcolorbox' environment, and an optional title."
>   (LaTeX-insert-environment
>    environment
>    (let ((label (TeX-read-string "(Optional) Title: ")))
>      (concat (unless (zerop (length label))
>                (format "[title={%s}]" label)))))
>   )
> (add-hook 'LaTeX-mode-hook
>           (lambda ()
>             (LaTeX-add-environments
>              '("tcolorbox" LaTeX-tcolorbox-env-item-opt-label))
>             )
>           )

That's not the right way to write style files.  For keyval options,
there's a predefined function `TeX-arg-key-val'.  And adding to
`LaTeX-mode-hook' has the effect that the tcolorbox environment will be
available in all documents which are opened after the one which actually
uses tcolorbox.  Again, to make that right, there is the
`TeX-add-style-hook' function.

I've just written and added a simply style for tcolorbox to our Git
repository.  See

That's far from complete as the tcolorbox style provides a lot more
macros and options.  I'd be happy to accept patches in the future which
add missing stuff.

> Please tell if this is enough to get it included in the next version
> of AuCTeX.  Thanks.

As said, I'm happy to accept improvements to the style.  However, in
order to be able to accept patches, you need to assign copyright to the
FSF.  If you are willing to do that, fill out this form

and follow the instructions in there.  For the package you are
contributing to you can either say GNU Emacs or GNU AUCTeX.  The former
has the benefit that a copyright assignment covering Emacs also covers
AUCTeX but the reverse is not true.


reply via email to

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