emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: Treat custom environment as verbatim on export
Date: Sun, 24 May 2015 19:29:22 +0200	[thread overview]
Message-ID: <87pp5psx3h.fsf@gmx.us> (raw)
In-Reply-To: <878ucedmec.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sun, 24 May 2015 17:29:31 +0200")

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Rasmus <rasmus@gmx.us> writes:
>
>> It's a special block, so e.g. org-latex-special-block.  But contents is
>> already transcoded by the time in arrives to e.g. org-latex-special-block.
>> To the extend this should be fixed, one way would be to allow a raw option
>> to special blocks (also needed for e.g. #+{begin,end}_equation) and have
>> babel insert it as needed.  I don't know how easy this is.
>
> I don't think a ":raw" option for special blocks is worth implementing.
>
> There are two types or "raw" contents: "protected raw" (i.e., verbatim
> contents) and "export-specific raw" (i.e., target language code). For
> the former, we already have example blocks (or fixed-width areas) and
> for the latter, export blocks.
>
> A third category exists, "multi-language raw", in which, I think, only
> the most trivial cases (those you never really need in practice) would
> fit.
>
> The OP wants special "protected raw" for LaTeX back-end. We could
> provide a special attribute for this, e.g.,
>
>   #+ATTR_LATEX: :environment "my-verbatim"
>
>   #+BEGIN_EXAMPLE
>   ... stuff...
>   #+END_EXAMPLE
>
>
> But this is really only a shortcut for
>
>   #+BEGIN_my-verbatim
>   #+BEGIN_LATEX
>   stuff
>   #+END_LATEX
>   #+END_my-verbatim
>
> WDYT?

If the end goal is 

   #+BEGIN_my-verbatim
   #+BEGIN_LATEX
   stuff
   #+END_LATEX
   #+END_my-verbatim

Then I think it should be producible with babel via

   #+begin_src Emacs-lisp :wrap my-verbatim :results latex
   "stuff"
   #+end_src

However,

   #+ATTR_LATEX: :environment "my-verbatim"
   #+BEGIN_EXAMPLE
   ... stuff...
   #+END_EXAMPLE

Is more general since it also produce sensible output in other backends.

Thus, I think passing attr arguments to example blocks may be
preferable...  Though *if* you are only going for latex export, :wrap
my-verbatim :results latex seems more convenient to me.

Rasmus


-- 
This message is brought to you by the department of redundant departments

  reply	other threads:[~2015-05-24 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-23  3:09 Treat custom environment as verbatim on export Jacob Gerlach
2015-05-23  9:48 ` Rasmus
2015-05-24 15:29   ` Nicolas Goaziou
2015-05-24 17:29     ` Rasmus [this message]
2015-05-24 19:43     ` Charles C. Berry
2015-05-25 12:17       ` Jacob Gerlach
2015-05-23 16:32 ` Charles C. Berry

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=87pp5psx3h.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --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).