You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are already styling commands, such as /class, but I would like to see a similar command that does not affect the positioning or cause grouping (similar to mathit but with the ability to apply custom styles). The grouping caused by commands such as /class and /operatorname makes it so there are different behaviours to doing things, such as pressing the backward key based on whether the the cursor is in or outside the group that might not be wanted in all cases.
My Specific use case:
In my application, I have some custom logic for wrapping variables/functions/units in styling when the user types (so that I can identify variables even if the user types non-continuously).
The steps are as follows:
Parse the input to identify variables/functions/units.
Wrap the identified symbols in the input using the appropriate styling.
Grab the mathfield current position. (currPosition = mf.position)
Set the value of the math-field (setValue())
Reset the positioning of the math-field (mf.position = currPosition)
Because the /class styling command affects the position, it's difficult for me to figure out the logic for setting the position after wrapping the variables in all circumstances.
My current workaround:
I wrap things with styling commands that do not affect the positioning, such as 'mathbf' (even though semantically it's not ideal), then overwrite the styles already applied to it.
All the best,
Orel
The text was updated successfully, but these errors were encountered:
orelbn
changed the title
[Feature]: styling command that does not group or affect positioning
[Feature]: custom styling command that does not group or affect positioning
Nov 26, 2024
Description
There are already styling commands, such as /class, but I would like to see a similar command that does not affect the positioning or cause grouping (similar to
mathit
but with the ability to apply custom styles). The grouping caused by commands such as/class
and/operatorname
makes it so there are different behaviours to doing things, such as pressing the backward key based on whether the the cursor is in or outside the group that might not be wanted in all cases.My Specific use case:
In my application, I have some custom logic for wrapping variables/functions/units in styling when the user types (so that I can identify variables even if the user types non-continuously).
The steps are as follows:
(currPosition = mf.position)
(setValue())
(mf.position = currPosition)
Because the
/class
styling command affects the position, it's difficult for me to figure out the logic for setting the position after wrapping the variables in all circumstances.My current workaround:
All the best,
Orel
The text was updated successfully, but these errors were encountered: