In older versions of mathcad there was the possibility to define a few user styles to display the variables (like in "Applying Math Styles" in the Mathcad 2000 Professional User's Guide, page 41 of
this pdf).
I think that in the first instance a few new styles could also be added to SMath, with some restrictions, to those that already exist, which as far as I know there are 5: variables (black italics), functions (black normal), units (bold blue), global variables (black bold) and strings (red bold). That is to say: the restrictions would only be to vary the style of the font (between the normal, italic, bold and bold italic styles) and the color, within a limited series of colors, since it does not seem to represent the introduction of many lines of code to implement this functionality, where neither the font nor its size are changed.
The way to differentiate between the different styles in SMath are: internal, when it is a predefined function, with ' for units, with " for strings and with ~ for global variables.
As a practical way to implement it, since no variable can start with a number, it could be that ~3A would be drawn as
A and in the SMath file there would be a table in XML saying that for that worksheet there is a style called 'Vector' and it would be specified that it would be bold, italic and black, unlike the 'Global' style, in which the font is in normal style. In this way one could write things such as that A = norme(~3A) showed as
A = norme(
A), since 'A' and ~3A are different variables.
Another way would be the one that mathcad has in the most recent versions, which is to have a few, too few, in this case, and that can be implemented cycling between labels with Ctrl+Q ( see
here )
Styles that come to mind are Symbolic, for variables intended to be left undefined, Vector for variables that are supposed to host vectors in black, bold and italics, or Matrix in bold italics and darkgreen, Strings in darkred, among the main ones.
Going one step further, it could be a way to introduce truly local variables via the "Local" style, to be used within the body of the function definition.
Best regards.
Alvaro
Edited by user 14 March 2023 02:37:09(UTC)
| Reason: Not specified