Quantcast
Viewing latest article 27
Browse Latest Browse All 70

Copy code from lstlisting excluding line number

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 VariablesTest1_up = [XZ:This (Index)][1];Test2_down = [XZ:This Index][1];//Specify Parameter Valuesbeta1 = .2238202445016966;beta2 = .6676275732948469;\end{lstlisting}\end{document}

It shows:

Image may be NSFW.
Clik here to view.
enter image description here

And when the reader try to select the code to copy/paste it, the line numbers are also selected:

Image may be NSFW.
Clik here to view.
enter image description here

Does exists some latex feature that let the reader copy the code excluding the line numbers?

Thanks!


Viewing latest article 27
Browse Latest Browse All 70

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>