I have this latex code
\documentclass{article}
\usepackage[lmargin=2.5cm,rmargin=2.5cm,tmargin=1.5cm,bmargin=3.5cm]{geometry}
\usepackage{listings} % Environment meant for source code (useful for word-wrapping verbatim text)
\begin{document}
\lstset{basicstyle = \verbatim@font,columns=fullflexible,numbers=left}
\begin{lstlisting}
//Define Variables
Test1_up = [XZ:This (Index)][1];
Test2_down = [XZ:This Index][1];
//Specify Parameter Values
beta1 = .2238202445016966;
beta2 = .6676275732948469;
\end{lstlisting}
\end{document}
It shows:
And when the reader try to select the code to copy/paste it, the line numbers are also selected:
Does exists some latex feature that let the reader copy the code excluding the line numbers?
Thanks!


pdf.js(the embedded viewer in most browser) is normally quite bad at it. – Rmano Feb 19 '24 at 10:42evince, you just copy the code. I do not think there is a solution to this... – Rmano Feb 19 '24 at 10:45