From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Leech-Pepin Subject: Re: src blocks in texinfo export Date: Tue, 12 Feb 2013 11:32:28 -0500 Message-ID: References: <87liat35ny.fsf@sofia.zeitform.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6782484ba0f404d58992da Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Ima-0005Rw-Bq for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 11:32:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5ImT-0001ox-Pk for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 11:32:36 -0500 Received: from mail-vb0-f50.google.com ([209.85.212.50]:44588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5ImT-0001oZ-Ll for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 11:32:29 -0500 Received: by mail-vb0-f50.google.com with SMTP id ft2so160719vbb.23 for ; Tue, 12 Feb 2013 08:32:28 -0800 (PST) In-Reply-To: <87liat35ny.fsf@sofia.zeitform.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dario Hamidi Cc: emacs-orgmode@gnu.org --047d7b6782484ba0f404d58992da Content-Type: text/plain; charset=UTF-8 Hello Dario, On 12 February 2013 10:36, Dario Hamidi wrote: > Hello, > > I discovered a problem when exporting source blocks containing braces to > texinfo using `ox-texinfo'. The texinfo exporter wraps source blocks > into a `example' environment, which takes care of source block > indentation but doesn't allow any braces to occur in the contained text, > since braces have a special meaning in TeX. > > After reading the `texinfo' manual, it became clear that literal examples > should be exported also in a `verbatim' environment. A patch making > this change to the exporter is attached. > Using your patch as is would wrap the source blocks in both example and verbatim blocks. If going with verbatim it would be better to remove all references to @example/@end example. I had chosen to go with @example rather than @verbatim because it does state that lisp blocks should be wrapped in @lisp which is synonymous to @example. It should be possible to escape any braces or @ before inserting them into the example block to ensure there is no expansion. The only differences in using @verbatim over escaping any characters in @example are the following: - Tabs are treated as tabs and not as single spaces - The code block is not indented. Regards, Jon > Dario > --047d7b6782484ba0f404d58992da Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Dario,

On 12 February 2013 1= 0:36, Dario Hamidi <dario.hamidi@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex"> Hello,

I discovered a problem when exporting source blocks containing braces to texinfo using `ox-texinfo'. =C2=A0The texinfo exporter wraps source blo= cks
into a `example' environment, which takes care of source block
indentation but doesn't allow any braces to occur in the contained text= ,
since braces have a special meaning in TeX.

After reading the `texinfo' manual, it became clear that literal exampl= es
should be exported also in a `verbatim' environment. =C2=A0A patch maki= ng
this change to the exporter is attached.


Using your patch as is would wrap the source blocks in = both example and
verbatim blocks. =C2=A0If going with verbatim it= would be better to remove all=C2=A0
references to @example/@end = example.

I had chosen to go with @example rather than @verbatim = because it does state
that lisp blocks should be wrapped in @lisp= which is synonymous to @example.

It should be pos= sible to escape any braces or @ before inserting them into the
example block to ensure there is no expansion.

The only differences in using @verbatim over escaping any characters in
@example are the following:
=C2=A0 - Tabs are treated as= tabs and not as single spaces
=C2=A0 - The code block is not indented.
=C2=A0
Regards,
Jon


=C2=A0Dario

--047d7b6782484ba0f404d58992da--