I want to split an equation into a part a; i.e. like this:
Is this possible in TeXmacs?
I want to split an equation into a part a; i.e. like this:
Is this possible in TeXmacs?
A quick solution is provided by the following two macros:
(document (assign "equation-post"
(macro "body" "post" (document
(surround "" "" (document (equation-lab (document (arg "body"))
(concat (the-equation) (arg "post"))))))))
(assign "equation-post-start"
(macro "body" "post"
(document (surround (next-equation) ""
(document (equation-lab (document (arg "body"))
(concat (the-equation) (arg "post")))))))))
which give the possibility to add some content to the label number. The second form is to increment the equation counter, while the first doesn’t. So you want to use them as follows:
(document
(equation-post-start (concat "x=y" (label "eq:1")) "a")
(equation-post "z=b" "b")
(eqref "eq:1") "")
which results in
Thanks. This seems to do the job. I would like to have the option to refer to the equations as a pair (i.e. Eq. (1) instead of 1a or 1b), but it’s not a big deal.
By the way, what is the difference between \reference
and \eqref
? They seem to produce the same thing.
You will have to create a new equation-lab
macro which assign to the binding only the value of \the-equation
without the additional label. This is not difficult and left as an exercise
\eqref
put automatically round brackets around the equation number. I prefer it, but other people just use \reference
You can have a look at this as well
https://savannah.gnu.org/patch/?10026
I haven’t used this in a while, so I don’t remember right now if it has references in the way you want.
Thanks! I think we should go on and implement a package for mathematical typesetting which can be opt-in, much like amsmath in LaTeX. In this way we can experiment with various solutions and consolidate some experience before Joris need to evaluate it. We can host it in tm-forge. I would really like to have standard solutions for typical typesetting constructions in math papers like multiple lines, custom labels, etc… At least for basic things. And with good translation in LaTeX. And we add some documentation so people know what to do for standard stuff (e.g. how to typeset a math paper).
Some things I usually need: