mailing-list for TeXmacs Users

Text archives Help


Math font shape and (possibly) xmacro


Chronological Thread 
  • From: Giovanni Piredda <address@hidden>
  • To: texmacs-users <address@hidden>
  • Subject: Math font shape and (possibly) xmacro
  • Date: Mon, 16 Nov 2020 21:09:02 +0100

I have written (it could be useful to me, but people are welcome to help themselves to it, it is on github) a package to format physical quantities according to SI prescriptions and I would like to refine it.

Let us assume we are in math mode, and that I want to write v = 5 m s⁻¹, with m and s in upright shape; there should be a space between m and s⁻¹ (they are multiplied together)

I have tried a few ways to type this, in all of them I tried to obtain the space with the asterisk.

None of the ways I tried are satisfactory yet, in view of the fact that I would like to put this into a macro where I do not know in advance how many units compose the overall unit (e.g. kg*m*s⁻²; more on the macro at the end). Here is what I tried.


<math|<with|font-shape|upright|m*s<rsup|-1>>>

(upright works in graphics) yields italics. The asterisk is considered as a multiplication, so it is typeset as a space


<math|<with|math-font-shape|right|m*s<rsup|-1>>>

gives me roman upright, but the asterisk is typeset as an asterisk (<with|math-font-shape|upright ... yields italics)


<math|<with|font-shape|right|m*s<rsup|-1>>>

(hoping that the name for upright is "right", like above) yields italics


I could set variables in roman type one by one, instead as in a group, so that in between them I can multiply them with an asterisk, but I have not been able yet to write a macro with variable number of arguments.

For that I have seen the primitive xmacro in the manual and in a style file in the distribution.

In the xmacro I am not able to enter the construct <var|x|, where x is the variable---I tried in several ways---I would appreciate if someone would tell me how-to (which menu items and which keystrokes :-) ).

A separate issue for the xmacro is how Scheme would see its arguments; I would rather program this in Scheme than with only TeXmacs macros, because I have in mind to do some more complex formatting of the output (different for text mode, and maybe also exponential form).






Archive powered by MHonArc 2.6.19.

Top of page