From: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
To: Dario Hamidi <dario.hamidi@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: src blocks in texinfo export
Date: Sun, 10 Mar 2013 15:49:29 -0400 [thread overview]
Message-ID: <CAEWDx5eytOfDJAp2vGfWWO2VvuJ-N+JN9+UD5an0ppnaM6LH+w@mail.gmail.com> (raw)
In-Reply-To: <8738x1p4l3.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2348 bytes --]
Hello Dario,
On 12 February 2013 17:09, Dario Hamidi <dario.hamidi@gmail.com> wrote:
>
> Hello Jonathan,
>
> > 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 don't understand where the problem lies with having a `@verbatim'
> within a `@example'. Could you maybe explain to me why this is
> problematic?
>
> Using both environments seems to achieve the goal of having an idented
> source block in the resulting info file without having to further
> process the source block before export.
>
> Consider exporting
>
> #+BEGIN_SRC sh
> function fails
> {
> echo "this causes an error with makeinfo"
> }
> #+END_SRC
>
> with only the verbatim environment:
>
> File: test.info, Node: Top, Up: (dir)
>
> Manual
> ******
>
> function fails
> {
> echo "this causes an error with makeinfo"
> }
>
> and with verbatim in example:
>
> File: test.info, Node: Top, Up: (dir)
>
> Manual
> ******
>
> function fails
> {
> echo "this causes an error with makeinfo"
> }
>
> > It should be possible to escape any braces or @ before inserting them
> into
> > the
> > example block to ensure there is no expansion.
>
> While it certainly is possible, it would also mean to properly escape
> *all* characters with a special meaning to TeX. I suppose that making
> text containing such characters visible in a document without having to
> escape them is what the verbatim environment is for.
>
> > 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.
>
> Preserving whitespace seems like a good idea when displaying python
> source code or makefiles.
>
> Dario
>
I've implemented a fix for this that should resolve the issue. `@ { }` are
now
properly escaped before export within source blocks. I didn't wrap the one
block in the other since the issue also existed within lisp blocks (where
inserting a verbatim block within a lisp block would have likely caused
issues
had someone wanted to extract any @lisp code from the info file.
Regards,
Jon
[-- Attachment #2: Type: text/html, Size: 3206 bytes --]
prev parent reply other threads:[~2013-03-10 19:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 15:36 src blocks in texinfo export Dario Hamidi
2013-02-12 16:32 ` Jonathan Leech-Pepin
2013-02-12 22:09 ` Dario Hamidi
2013-03-10 19:49 ` Jonathan Leech-Pepin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEWDx5eytOfDJAp2vGfWWO2VvuJ-N+JN9+UD5an0ppnaM6LH+w@mail.gmail.com \
--to=jonathan.leechpepin@gmail.com \
--cc=dario.hamidi@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).