Quantcast
Channel: Active questions tagged copy-paste - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 70

Copy code from lstlisting excluding line number

$
0
0

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:

enter image description here

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

enter image description here

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

Thanks!


Viewing all articles
Browse latest Browse all 70

Trending Articles



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