Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

strikethrough within equation in jupyter markdown

is it possible to strike-through part of an latex equation when using jupyter notebook's markdown? example:

enter image description here

strike-through the denominator (11-4)! numerator 7!. I've tried using ~~(11-4)!~~ and ~(11-4)!~ which both work on their own but when use them within latex $\frac{11!}{(11-4)!4!}\frac{7!}{(7-4)!4!}$ neither work.

if it matters, I'm running in on Ubuntu. kindly advise

@osbm this is my output with the code suggest;
enter image description here

like image 687
ManOnTheMoon Avatar asked Nov 02 '25 06:11

ManOnTheMoon


1 Answers

To be able to use the MathJax cancel extension you have to add it at the beginning of your markdown cell, like so.

$$\require{cancel}$$  

$\frac{11!}{\cancel{(11-4)!}4!}\frac{\cancel{7!}}{(7!-4!)4!}$

It provides similar results to the LaTeX cancel package.

If you want more flexibility, use the MathJax enclose extension

$$\require{enclose}$$

$\frac{11!}{\enclose{horizontalstrike}{(11-4)!}4!}\frac{\enclose{horizontalstrike}{7!}}{(7!-4!)4!}$

$\frac{11!}{\enclose{verticalstrike}{(11-4)!}4!}\frac{\enclose{verticalstrike}{7!}}{(7!-4!)4!}$

$\frac{11!}{\enclose{updiagonalstrike}{(11-4)!}4!}\frac{\enclose{updiagonalstrike}{7!}}{(7!-4!)4!}$ this is similar to `\cancel`

$\frac{11!}{\enclose{downdiagonalstrike}{(11-4)!}4!}\frac{\enclose{downdiagonalstrike}{7!}}{(7!-4!)4!}$

$\frac{11!}{\enclose{updiagonalstrike, downdiagonalstrike}{(11-4)!}4!}\frac{\enclose{updiagonalstrike, downdiagonalstrike}{7!}}{(7!-4!)4!}$

The results are: enter image description here

In this stackexchange post you find all the info you need.

like image 178
Pietro D'Antuono Avatar answered Nov 04 '25 08:11

Pietro D'Antuono



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!