help-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-texinfo] Re: backticks in verbatim code snippets


From: John Gabriele
Subject: Re: [help-texinfo] Re: backticks in verbatim code snippets
Date: Sat, 30 Sep 2006 18:45:32 -0400

On 9/30/06, Karl Berry <address@hidden> wrote:
Hi John,

Hi Karl. Thanks for the reply.

    show up as actual backquote characters?

There is no easy way at present (no one has ever wanted it before).  The
grave accent is in the font (cmtt10), but it's at position 012
(newline), so that's not going to help you enter it directly.

The lilypond folks wanted an option to replace *right* quotes with
undirected quotes for cutting and pasting in some viewers, which I
implemented as a document-level option:
@set codequoteundirected

(This is a recent change, get the current ftp://tug.org/tex/texinfo.tex
if need be.)

I don't see anything about codequoteundirected in the online texinfo
docs. Does it only leave an undirected single quote as-is inside @code
and @verbatim environments?

I could do something similar for left quotes vs. backticks, I suppose.

What would be ideal, IMO, would be if, when I put a code snippet into
my docs, I'd like for single quote characters (the one I type on my
keyboard that TeX thinks of as a right single quote) to all stay
undirected, and all backticks to stay backticks. Just like how
double-quote characters stay double-quote characters.

This way, code snippets in printed docs will look exactly like they
would typed into a text editor (and could even be copy/pasted from a
pdf, if the reader wished to).

TeX output with Computer Modern just looks so good, I find myself
preferring to read docs in pdf/dvi instead of Info format or even
html. Trouble is, I can't copy/paste code snippets because of the
quote munging that goes on.

(If you know TeX, maybe you could make the patch?)

Alas, I don't know TeX at the moment.

May I ask what manual this is for?  Just curious.

I've been writing some of my own docs involving the Ruby programming
language, and it includes numerous code snippets (Ruby uses backticks
the way Perl does). I'd previously just been using Markdown, but I was
thinking of making my docs into something more substantial. Also, I
wanted to leave the door open for putting mathematics in later on.

    Also, when copying pasting code snippets into Texinfo docs, are there
    any other special characters to watch out for?

The above is all that comes to mind -- if you prefer grave accent to
left quote, you may prefer undirected quote to right quote, too.

Right. Definitely.

    @, {, and } all seem to work fine.

Those are all the special characters in Texinfo.

Right. What I meant was, I can use them all without any special
escaping or anything inside a "@verbatim ... @end verbatim" block and
they seem to come out fine in the DVI file.

    As an aside, I just noticed that at the end of section 14.1.2 in the
    pdf version of the Texinfo manual there are 3 extra p's at the end of
    the last sentence.

Thanks, I deleted them.

Cool, thanks. :)

---John




reply via email to

[Prev in Thread] Current Thread [Next in Thread]