Denis Bitouzé <[email protected]> writes: > Well, not that easy when you don't know anything to `elisp` :$
No worries, that will come quick :-)
> Looking at `tcolorbox.el` and `listings.el`, I tried the following for
> the environments `ltx-code` and friends:
>
> ┌────
> │ (defvar LaTeX-ltx-code-keyval-options
> │ '(("title")
> │ ("notitle")
> │ ("adjusted title")))
> │
> │ (defun LaTeX-ltx-code-keyval-options ()
> │ "Return an updated list of key=vals from letgut class."
> │ (append
> │ ;; Standard key=vals:
> │ LaTeX-listings-key-val-options))
> │
> │ (LaTeX-add-environments
> │ '("bookreview" LaTeX-env-args
> │ (TeX-arg-key-val (("title")
> │ ("reviewer")
> │ ("bibkey")
> │ ("frontcover")
> │ ("price"))))
> │ '("ltx-code" LaTeX-env-args
> │ [TeX-arg-key-val (LaTeX-ltx-code-keyval-options)])
> │ '("ltx-code-result" LaTeX-env-args
> │ [TeX-arg-key-val (LaTeX-ltx-code-keyval-options)])
> │ '("ltx-code-external-result" LaTeX-env-args
> │ [TeX-arg-key-val (LaTeX-ltx-code-keyval-options)]
> │ TeX-arg-file))
> └────
>
> but it doesn't work:
>
> ┌────
> │ mapcar: Wrong type argument: listp, LaTeX-ltx-code-keyval-options
> └────
I'm not familiar with the code of letgut.cls, but in case 'ltx-code' and
friends take keyval's form the listings package, you can do something
like this:
(LaTeX-add-environments
'("bookreview" LaTeX-env-args
(TeX-arg-key-val (("title")
("reviewer")
("bibkey")
("frontcover")
("price"))))
'("ltx-code" LaTeX-env-args
[TeX-arg-key-val (LaTeX-listings-key-val-options)])
'("ltx-code-result" LaTeX-env-args
[TeX-arg-key-val (LaTeX-listings-key-val-options)])
'("ltx-code-external-result" LaTeX-env-args
[TeX-arg-key-val (LaTeX-listings-key-val-options)]
TeX-arg-file))
I put that in the letgut.el I have and it works. The file is attached.
Best, Arash
letgut.el
Description: application/emacs-lisp
