emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Michael Hannon <jm_hannon@yahoo.com>
Cc: nicholas.dokos@hp.com, Org-Mode List <emacs-orgmode@gnu.org>
Subject: Re: Underline ONLY the first character of a word?
Date: Wed, 24 Aug 2011 19:28:19 -0400	[thread overview]
Message-ID: <7670.1314228499@alphaville.americas.hpqcorp.net> (raw)
In-Reply-To: Message from Michael Hannon <jm_hannon@yahoo.com> of "Wed, 24 Aug 2011 13:16:52 PDT." <1314217012.11609.YahooMailNeo@web161910.mail.bf1.yahoo.com>

Michael Hannon <jm_hannon@yahoo.com> wrote:

> Greetings.  I've "inherited" an HTML document that uses the construct:
> 
>     <u>e</u>vent
> 
> for instance, to underline the initial 'e' in the word.  The context is
> something like:
> 
>     <b>e</b>    <u>e</u>vent
> 
> to show that the choice of option 'e' corresponds to choosing an "event".
> 
> In preparation for a revision of the document, I'm trying to create a *.org
> file that will duplicate as much of the original style of the HTML document as
> possible (i.e., when exported to HTML).
> 
> I haven't been able to find a way to underline just the first character of a
> word.  For instance,
> 
>     _e_vent
> 
> doesn't produce what I want.  I tried:
> 
>     _e_ vent
> 
> and that underlined the 'e' but, of course, left an unwanted space.
> 
> Is there some way to do this?  A better way?
> 

Not without some code I think.

I can *almost* do it with babel, but there is some manual work involved.
For example, in the following file:

--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---

I can evaluate the source block with C-c C-c and get a results block
like this[fn:1]:

--8<---------------cut here---------------start------------->8---
#+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---

then manually delete the #+{begin,end}_example lines and *then* export the
resulting file.

You might also be able to do something with radio tables or dynamic blocks
but I have not gone down that path.

Nick

Footnotes:

[fn:1] You might have to do something like this

     (setq  org-babel-min-lines-for-block-output 1)

to convince babel to produce an example block rather than colon-preceded
literals.

  parent reply	other threads:[~2011-08-24 23:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24 20:16 Underline ONLY the first character of a word? Michael Hannon
2011-08-24 21:51 ` suvayu ali
2011-08-24 22:44   ` Michael Hannon
2011-08-24 22:50     ` John Hendy
2011-08-25 21:30     ` Michael Hannon
2011-08-24 23:28 ` Nick Dokos [this message]
2011-08-24 23:34   ` Nick Dokos
2011-08-26  8:35     ` Carsten Dominik
2011-08-28  9:41       ` Niels Giesen
2011-08-29  3:48       ` Michael Hannon
2011-08-25  0:26   ` Nick Dokos
2011-08-26  5:59 ` Jambunathan K

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=7670.1314228499@alphaville.americas.hpqcorp.net \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jm_hannon@yahoo.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).