helpListings package for LaTeX - Support: sr #302, listings package and R

 
 
Show feedback again

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

sr #302: listings package and R

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

Wed Apr 13 05:00:40 2011, original submission:

Keith Ponting wrote, on Wed, 18 Jun 2008 08:28:56 -0400:


Hi,

I am enjoying using the listings package with R, but have two comments and one question:
1) Comments - I am modifying the standard style with: alsoother={_$(},alsodigit={.=} because:
a. In R and S, dot is allowed in variable names, so a variable named for.ever is perfectly valid and will (by default) get keyword style for the “for” and plain for the “.ever” - I would like to suggest this one as a modification to the package;
b. Likewise named arguments in function calls can be keyword names and look odd in keyword style - this one with the “=” is perhaps more debatable.
2) Question: Using pdflatex generates pdf files with very nice looking listings, but when I cut and paste ‘R’ code from those files I get some curious characters. Most I can fix with the literate switch: literate={<-}{{\tt <-}}1 {~}{{\tt \~{}}}1 {|}{{\tt |{}}}1 {\{}{{\tt \{}}1 {\}}{{\tt \}}}1, but every “{“ becomes an “f” via the cut and paste; likewise every “}” becomes a “g”. My attempt at fixing it with literate (using escaped \{ and \}) is as shown, but that does not work. I have attached files illustrating the problem. Do you know of a way around this, please?

Thankyou,

Keith Ponting

Brooks Moses <brooks>
Project Administrator

 

Attached Files
file #93:  rcode.log added by brooks (7kB - application/octet-stream)
file #94:  rcode.tex added by brooks (4kB - application/x-tex)
file #95:  rcode.pdf added by brooks (30kB - application/pdf)

 

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):

     

     

    3 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Apr 13 05:00:40 2011brooksAttached File-=>Added rcode.log, #93
      Attached File-=>Added rcode.tex, #94
      Attached File-=>Added rcode.pdf, #95
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray