GNU bug report logs -
#78586
TeX-make-inline
Previous Next
Full log
Message #29 received at 78586 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Ikumi,
Thanks for the further feedback, which I've now incorporated.
I mentioned that this was the first of several commands I planned to
propose, in an attempt to upstream the most broadly useful stuff from
https://github.com/ultronozm/czm-tex-edit.el.
The next planned command was an "inverse" to LaTeX-make-inline, say
LaTeX-make-display, that converts inline math to display math. I had
planned to propose that command in a separate bug, but the two are so
intertwined that I think it makes sense to treat them together.
The tricky part in designing LaTeX-make-display is that different users
may prefer different sorts of display math: \[..\], $$..$$,
equation/equation*/align/align*/(...). Given that we don't want to add
too many new user options, it seemed best to provide a general
LaTeX-modify-math command, which the user can either invoke
interactively or specialize like so:
--8<---------------cut here---------------start------------->8---
(defun my-LaTeX-make-brackets ()
"Convert math construct at point to \"\\=\\[..\\=\\]\"."
(interactive)
(LaTeX-modify-math "\\["))
(defun my-LaTeX-make-equation* ()
"Convert math construct at point to \"equation*\"."
(interactive)
(LaTeX-modify-math "equation*"))
(defun my-LaTeX-toggle-numbered ()
"Convert math construct at point to \"equation*\".
If the math construct is already \"equation*\", then toggle with the
numbered variant \"equation\"."
(interactive)
(unless (texmathp) (user-error "Not inside math"))
(let ((current (car texmathp-why)))
(LaTeX-modify-math
(pcase current
("equation*" "equation")
("equation" "equation*")
(_ "equation*")))))
(defun my-LaTeX-toggle-align ()
"Toggle math environment at point between \"equation\" and \"align\"."
(interactive)
(unless (texmathp) (user-error "Not inside math"))
(let ((current (car texmathp-why)))
(LaTeX-modify-math
(pcase current
("align*" "equation*")
("equation*" "align*")
("align" "equation")
("equation" "align")
(_ "align*")))))
--8<---------------cut here---------------end--------------->8---
We could document some of these in the manual (where?), but leave their
precise implementation and binding to the user.
How does this plan sound? The attached patch contains everything but
documentation concerning LaTeX-modify-math, for which I await feedback
on a location in the manual and the overall soundness of the approach.
Thanks, best,
Paul
[0001-Add-LaTeX-modify-math-and-LaTeX-make-inline.patch (text/x-patch, attachment)]
This bug report was last modified 4 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.