Description: Hello LibreOffice Development Team, I would like to request a new feature for LibreOffice Math: the addition of a \cancel command, similar to the one available in LaTeX. This command would allow users to draw a diagonal line through a term in an equation to indicate simplification or cancellation. Currently, there is no straightforward way to represent a crossed-out term, and adding this functionality would greatly improve the usability of LibreOffice Math for educational purposes. Thank you for considering this feature request. Best regards, Lionel MARTIN Actual Results: Not available Expected Results: similar to overstrike {} but with an angle Reproducible: Always User Profile Reset: No Additional Info: None
Created attachment 203051 [details] visual LateX example
Seems reasonable, a diagonal strike through/cancellation would be a good addition to the Formula editor where the 'overstrike' now only provides a horizontal strike through. Imagine the sm function name could follow the LaTeX with 'cancel', or maybe 'strikeout'. Implementing would stroke be made part of nodes, or an annotation? And how to get it into ODF Formula. ODF extension needed? Seems its not implemented directly in MathML, which requires annotation as a <menclose> element and notation as updiagonalstrike or downdiagonalstrike We'd need to go both directions into and out of MathML so would need filter work as well. @Regina, thoughts?
The formula editor is bound to MathML. Thus we need a MathML markup for such "diagonal strike through". Perhaps it could be done with element <menclose> using its attributes updiagonalstrike and downdiagonalstrike. I see it in the draft of MathML 4.0. [1] But according to [2] it is not standard and not widely supported. [1] https://w3c.github.io/mathml/#presm_menclose [2] https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/menclose
<math> <menclose notation="updiagonalstrike"> <mrow> <mi> x </mi> <mo> + </mo> <mi> 1 </mi> </mrow> </menclose> </math> indeed works not only in the browser but also for MSO365 by pasting this code into the equation. No idea how to clear or how to apply via the UI. We have the Attributes category with, for example Line Trough resulting in "overstrike {x+1}", and could add the new attributes there.
Created attachment 203068 [details] Test document The updiagonalstrike attribute is stored in MSO365 but ignored when loaded in LibreOffice.
Hmm, so just checked and our export to MML2 already implements the <menclose> for horizontal strike for the 'overstrike' annotation with the "horizontalstrike" notation. Frederic Wang. had added this in back at the 4.2 release, https://gerrit.libreoffice.org/c/core/+/4465 Might be an easyhack here to add the two diagonals? =-=-= Clip of an export from a 26.2 nightly <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <semantics> <menclose notation="horizontalstrike"> <mrow> <mrow> <mi>E</mi> <mo stretchy="false">=</mo> <mi>m</mi> </mrow> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </menclose> <annotation encoding="StarMath 5.0">overstrike {E = m c^2}</annotation> </semantics> </math>