I just integrated rehype-katex with MDX for Next.js, and it is rendering nicely:
However, when I highlight the math-rendered text like "10⁹" in that image, and paste it into my text editor (Visual Studio Code), it pastes as "109", when I originally wrote it as $10^{9}$. How can I have it copy as $10^{9}$
or just 10^{9}
when I do CMD + C on the text in the webpage?
Is there a way to specify what the "copy content" will be in KaTeX or any of the other layers (Remark, Rehype, or MDX) somehow?
Wikipedia does this, where if you highlight some math equation on one of their HTML pages, and CMD + C, and then pastes it into the text editor. It pastes as the LaTeX formula, which is pretty useful and nice. I would like to do that same thing somehow, but I am not sure where it would need to be added or if it's even possible with these math JavaScript tools.