helpListings package for LaTeX - Support: sr #158, listings and copy-paste

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

sr #158: listings and copy-paste

Submitted by:  Brooks Moses <brooks>
Submitted on:  Tue Apr 5 05:36:57 2011  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: None

Tue Apr 5 06:26:10 2011, comment #2:

This is https://puszcza.gnu.org.ua/bugs/index.php?138, roughly.

Brooks Moses <brooks>
Project Administrator
Tue Apr 5 05:38:09 2011, comment #1:

From the reply chain....


Many thanks, Brooks.
I'll try your suggestion.
But if verbatim works then there ought to be a solution.
All the best,
-Thomas

Brooks Moses wrote:

> Hello, Thomas!
>
> Unfortunately, that's a known problem with listings and PDFs. > I'm planning to investigate a fix for the next release (which > may be a little while), but I'm unsure whether TeX has enough > PDF-awareness for fixing it to be possible or not.
>
> In the interim, the columns=flexible or columns=fullflexible
> options should improve the situation at least somewhat. If
> you use those with a monospaced font (like verbatim uses), you
> should still get a result that appears to have fixed columns.
>
> Hope this helps,
> - Brooks

Brooks Moses <brooks>
Project Administrator
Tue Apr 5 05:36:57 2011, original submission:

Thomas Netter writes, on Mon, 11 Feb 2008 18:03:47 +0100:


Dear Brooks,

How can I use listings to print bash code and enable readers to correctly copy-paste the code from the PDF document?

For example this generates whitespace around slashes and dots:

\lstset{language=bash, basicstyle=\small, identifierstyle=\ttfamily, showstringspaces=false}
\begin{lstlisting}
modprobe rsrc_nonstatic # PCMCIA-related
modprobe i82092 # PCMCIA-related
modprobe yenta_socket # PCMCIA-related
insmod /usr/realtime/modules/rtai_hal.ko
insmod /usr/realtime/modules/rtai_up.ko # or rtai_lxrt.ko
insmod /usr/realtime/modules/rtai_fifos.ko
insmod /usr/realtime/modules/rtai_sem.ko
insmod /usr/realtime/modules/rtai_mbx.ko
insmod /usr/realtime/modules/rtai_msg.ko
insmod /usr/realtime/modules/rtai_netrpc.ko ThisNode="127.0.0.1"
insmod /usr/realtime/modules/rtai_shm.ko
insmod /usr/realtime/modules/rtai_signal.ko
insmod /usr/realtime/modules/rtai_tasklets.ko
modprobe comedi
modprobe kcomedilib
modprobe comedi_fc
modprobe 8255 # acq. card hardware-specific
modprobe ni_mio_cs # acq. card hardware-specific
insmod /usr/realtime/modules/rtai_comedi.ko
/etc/init.d/pcmciautils restart # from pcmciautils package
# or pcmcia restart (kernel < 2.6.13)

\end{lstlisting}

Is verbatim the only solution?
Many thanks for your help,

Thomas Netter

Brooks Moses <brooks>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by brooks (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray