Is there a way to make symbols, written by using the function $$, in LaTeX look like something in the pdf document, but different if you copy-paste it?
Here is an example of what I would like:
Something like this in my code: For water $\rho$ is 997 $kg/m^3$
In the pdf document: For water ρ is 997 kg/m³
When you copy-paste: For water the density is 997 kilograms per cubic meter
(I asked a similar question some days ago and got some good answers. I was told to use ‘accsupp’, however, I can’t get it to work when using $$)
(added after i first asked the question:) I have been asked for an example of my problem, here it comes. My code is:
\documentclass{article} \
\usepackage{accsupp}
\newcommand\km{\BeginAccSupp{ActualText={kilometers}}km \EndAccSupp{}}
\newcommand\km{\BeginAccSupp{ActualText={density}} $\rho$ \EndAccSupp{}}
\begin{document}
\km % when you make a PDF file, and copy-paste this part it will give you 'kilometers' and not 'km'
\ $\rho$ % a bad try to do the same for '$\rho$' as for 'km'
\end{document}
accsuppanswer you got on the other question works fine for yourFor water $\rho$ is 997 $kg/m^3$example. If you can't get it to work, I think you should include a minimal example demonstrating your issue. – Marcel Krüger Nov 20 '21 at 13:01\kmtwice. Please create an actually working example demonstrating your issue. – Marcel Krüger Nov 20 '21 at 13:50