emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Steven Haryanto <stevenharyanto@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: how to escape org markup?
Date: Thu, 16 Jun 2011 22:47:04 -0400	[thread overview]
Message-ID: <18179.1308278824@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Steven Haryanto <stevenharyanto@gmail.com> of "Fri\, 17 Jun 2011 08\:59\:41 +0700." <BANLkTin3RoGLSX=2QUGECaFMeij_5AGpnA@mail.gmail.com>

Steven Haryanto <stevenharyanto@gmail.com> wrote:

> On Fri, Jun 17, 2011 at 12:10 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
>     Steven Haryanto <stevenharyanto@gmail.com> wrote:
>    
>     > I need to insert bits of plain text into a final composite Org document. The text should be
>     > protected from any Org formatting (for example, "* " at the beginning of a line should not be
>     > interpreted as a headline). Is enclosing it with #+BEGIN_SRC/#+END_SRC or #+BEGIN_EXAMPLE/#
>     > +END_EXAMPLE the correct way? I'm thinking yes, but my Emacs still interprets the "* " as
>     headline
>     > though.
>     >
>    
>     This seems to work - I can export to html or latex and get the expected result:
>    
>     --8<---------------cut here---------------start------------->8---
>    
>     * foo
>     org example
>    
>     #+begin_example
>     ,* bar
>     <2011-06-16 Thu>
>    
>     This is example code.
>    
>     #+end_example
>     --8<---------------cut here---------------end--------------->8---
>    
>     But I don't know all the rules and moreover I don't know of any place where
>     they are described. I'll look around and post an update when I find it.
>     But feel free to beat me to it.
>    
>     Nick
> 
> Btw, I still need to escape "#+END_SRC" if they occur at the start of line in text, for example by
> prepending it with a space (akin to prepending a space to "From " in mbox format).
> 

Try the round-trip suggested in sec. 11.3, "Literal examples", of the
manual: C-c ' on the block, then C-c ' to go back.  Here is the example
that I used in a recent bug report[fn:1] after round-tripping it:

--8<---------------cut here---------------start------------->8---
* foo

#+begin_example
  ,#+TITLE: foo
  ,* One
  
  One
  
  ,* Two
  
  Euler says:
  
  ,#+begin_latex
  \[
  \int_0^\infty e^{-x^2} dx = {{\sqrt{\pi}} \over {2}}
  \]
  ,#+end_latex
#+end_example
--8<---------------cut here---------------end--------------->8---

It indented and added commas in front.[fn:2]

Nick

Footnotes:

[fn:1] http://thread.gmane.org/gmane.emacs.orgmode/42546

[fn:2] Unfortunately, it does not fix things: the bug is still biting
       me.  Actually, it's two bugs: one is a generic one, the other is
       specific to latex export.

      reply	other threads:[~2011-06-17  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 15:36 how to escape org markup? Steven Haryanto
2011-06-16 17:10 ` Nick Dokos
2011-06-16 17:35   ` Nick Dokos
2011-06-17  1:59   ` Steven Haryanto
2011-06-17  2:47     ` Nick Dokos [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=18179.1308278824@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=stevenharyanto@gmail.com \
    /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).