From: Sean Chittenden Date: 2001-12-09T08:26:08+09:00 Subject: [ruby-talk:27982] Re: Displaying Ruby code in LaTeX > Has anyone written a document in LaTeX that includes examples of Ruby > code? Yup. > I'm having all sorts of problems, because Ruby uses many characters > that mean something to LaTeX. I tried to escape everything that was > conflicting, but it's becoming a nightmare. Yeah, it's a tad annoying. What I'll typically do is write my chunk of ruby, then use a query replace in emacs to change the $'s, &'s, %'s, #'s, _'s, and {}'s to their respective escaped character. $ = \$ & = \& % = \% # = \# _ = \_ { = \{ } = \} > I even tried the verbatim environment, but that seems to screw up > the indentation in a lot of cases. Ugh... not so nice. > So, can anyone give me an example of doing this, or suggest how I > might attack it? Write a section of ruby, then escape a section of ruby. You could try using the LyX program though which is pretty sweet and does most of this for you. -sc -- Sean Chittenden