2

I would like to write a .pdf where all rendered equations can be copied and pasted correctly as TeX code. Someone had posted a similar question : https://tex.stackexchange.com/questions/119713/making-equations-copyable-in-pdf#=

Here is a response he gets for copy and paste one equation :

\documentclass{article}
\usepackage{accsupp}

\newcommand*{\copyable}[1]{%
\BeginAccSupp{%
ActualText=\detokenize{#1},%
method=escape,
}%
#1%
\EndAccSupp{}%
}

\begin{document}
\[
 \copyable{\int x\sin ax\;\mathrm{d}x = \frac{\sin ax}{a^2}-\frac{x\cos ax}{a}+C}
\]
\end{document}

I would like to apply this command to all mathmode script. A sort of

\AtEveryMath{\copyable}

Is it possible ?

Thanks in advance

  • 1
    Also here (in macro form): https://tex.stackexchange.com/questions/233390/in-which-way-have-fake-spaces-made-it-to-actual-use – Steven B. Segletes Apr 16 '18 at 13:51
  • @StevenB.Segletes Thank you for posting a related topic ! In the "revised solution", \copyable is also not automatic. – Adrien Meilac Apr 16 '18 at 14:08
  • That is correct, that it is not automatic, though a macro form is an improvement. – Steven B. Segletes Apr 16 '18 at 14:10
  • I have posted an answer that (partially) works to the linked question, so I close this one as duplicate. Anyone who wants to post another answer to this question can likewise do that at the linked question, for better visibility. – user202729 Nov 25 '23 at 07:46

0 Answers0