emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Underline ONLY the first character of a word?


From: Nick Dokos
Subject: Re: [O] Underline ONLY the first character of a word?
Date: Wed, 24 Aug 2011 20:26:38 -0400

Here is an amusing aside[fn:1]. Take the org file I posted previously:

--8<---------------cut here---------------start------------->8---

* Table                                                 :noexport:

#+TBLNAME: actions
| abbrev | action          |
|--------+-----------------|
| a      | actionable      |
| b      | bibulous        |
| c      | califragilistic |


#+begin_src python :results output :exports none :var table=actions

  print "* Results"
  print "#+begin_html"
  for row in table:
      print "<b>%s</b>  <u>%s</u>%s<br/>" % (row[0], row[1][0:1], row[1][1:])
  
  print "#+end_html"
#+end_src
--8<---------------cut here---------------end--------------->8---



If I export this to html, I get nothing in the body because of the :noexport: 
tag.
But if I evaluate the source block:



--8<---------------cut here---------------start------------->8---

* Table                                                                         
                              :noexport:

#+TBLNAME: actions
| abbrev | action          |
|--------+-----------------|
| a      | actionable      |
| b      | bibulous        |
| c      | califragilistic |


#+begin_src python :results output :exports none :var table=actions
  print "* Results"
  print "#+begin_html"
  for row in table:
      print "<b>%s</b>  <u>%s</u>%s<br/>" % (row[0],
                                             row[1][0:1],
                                             row[1][1:])
  
  print "#+end_html"
  
#+end_src

#+results:
#+begin_example
* Results
#+begin_html
<b>a</b>  <u>a</u>ctionable<br/>
<b>b</b>  <u>b</u>ibulous<br/>
<b>c</b>  <u>c</u>alifragilistic<br/>
#+end_html
#+end_example
--8<---------------cut here---------------end--------------->8---



and then export (*without* the manual excision of the #+{begin,end}_example),
I get:



--8<---------------cut here---------------start------------->8---
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Results </h2>
<div class="outline-text-2" id="text-1">


<b>a</b>  <u>a</u>ctionable<br/>
<b>b</b>  <u>b</u>ibulous<br/>
<b>c</b>  <u>c</u>alifragilistic<br/>

</div>
</div>
--8<---------------cut here---------------end--------------->8---



which surprised me: the "* Results" line is interpreted as a new headline
during export, despite the fact that it appears within an example block
(that's probably a consequence of the  ordering of actions
in org-export-preprocess-string [fn:2]): the noexport tag strips everything
to  the "* Results" line, which I guess is surprising at first but makes sense,
and the #+end_example line is silently discarded).

Oh, no! Look what I've done: AndrĂ¡s will now insist that the whole thing has
to be either documented completely or thrown out bodily :-)

With-tongue-firmly-in-cheek-ly yours,
Nick

Footnotes:

[fn:1] For some value of "amusing".

[fn:2] See somewhere in this thread: 
http://thread.gmane.org/gmane.emacs.orgmode/46021.



reply via email to

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