How to write \cancel{} with the new value #2560
-
I would like to use Is this possible with KaTeX? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
I'm afraid that KaTeX does not support the I don't know any way to write that function without a page refresh. And KaTeX avoids doing a page refresh. |
Beta Was this translation helpful? Give feedback.
-
Here's a proposal for https://bourne2learn.com/math/katex-experiments/cancelTo-proposal.html |
Beta Was this translation helpful? Give feedback.
-
Hi Ron (1) I edited the "proposal" page just now to see what was involved with canceling an expression that was a bit more involved. (I used the OP's example). As you see, it's still possible to kind-of get it working. (2) Since I fall short on the divinity quality, I am not present at the moment of creation of the SVG, so need to create the arrow head after the "load" event. I obtained the dimensions of the SVG using getBoundingClientRect. It seems to me it would be possible to obtain those dimensions immediately after the SVG is created and then add the arrow head, wouldn't it? (I get that may not be possible for server-side rendering, since I guess it is not on the DOM until it appears in the browser. Headless browser on the server, maybe...?) (3) For the demo, I used a large font to see what was going on (since my arrow heads or "1"s would often disappear). Using a normal page font size, this is about the best I could do (just looks like a blob to me): If the SVG was wider for \cancelTo, it would work better as the arrow head could be made longer. BTW, I ended up changing the SVG so the right end went up 85% to the top, otherwise the top part of the arrow head would sometimes be cut off. I'll go away now... :-) |
Beta Was this translation helpful? Give feedback.
-
This is how I handled cancellations before I learnt about
Or:
If you need to use it more than once, it's probably simplest to implement it as a macro. Personally, I don't bother with the |
Beta Was this translation helpful? Give feedback.
I'm afraid that KaTeX does not support the
\cancelto
function.I don't know any way to write that function without a page refresh. And KaTeX avoids doing a page refresh.