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

2011-08-28 Thread Niels Giesen
What about using something well-structured like a table or a (definition)
list and CSS :first-letter pseudoselector and text-decoration: underline?

e.g.

td:first-child {
  font-weight:bold;
}
td~td:first-letter {
  text-decoration:underline;
}

for a two-column table.

On Fri, Aug 26, 2011 at 10:35 AM, Carsten Dominik carsten.domi...@gmail.com
 wrote:

 Hi,

 I don't think the following trick has come up yet.  If you are
 only exporting to HTML, you can do:

 @ue@/uvent

 HTH

 - Carsten

 On 25.8.2011, at 01:34, Nick Dokos wrote:

  Nick Dokos nicholas.do...@hp.com wrote:
 
  Not without some code I think.
 
 
  D'oh - as John Hendy points out, you can do it by hand:
 
  --8---cut here---start-8---
 
  #+begin_html
  ba/b  ua/uctionablebr/
  bb/b  ub/uibulousbr/
  bc/b  uc/ualifragilisticbr/
  #+end_html
  --8---cut here---end---8---
 
  It always amazes me how fixated I can get on the wrong approach.
 
  Nick
 





-- 
http://pft.github.com


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

2011-08-28 Thread Michael Hannon
 I don't think the following trick has come up yet.  If you are
 only exporting to HTML, you can do:
 
 @ue@/uvent

Thanks, Carsten.  That works nicely.

-- Mike

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

2011-08-26 Thread Jambunathan K

See http://www.mail-archive.com/emacs-orgmode@gnu.org/msg45991.html

Just, creating a backlink to the other thread. John Hendy created the
forward link.

 Greetings.  I've inherited an HTML document that uses the
 construct:

 ue/uvent

 for instance, to underline the initial 'e' in the word.  The context
 is
 something like:

 be/bue/uvent

 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?

 Thanks,

 -- Mike




-- 



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

2011-08-26 Thread Carsten Dominik
Hi,

I don't think the following trick has come up yet.  If you are
only exporting to HTML, you can do:

@ue@/uvent

HTH

- Carsten

On 25.8.2011, at 01:34, Nick Dokos wrote:

 Nick Dokos nicholas.do...@hp.com wrote:
 
 Not without some code I think.
 
 
 D'oh - as John Hendy points out, you can do it by hand:
 
 --8---cut here---start-8---
 
 #+begin_html
 ba/b  ua/uctionablebr/
 bb/b  ub/uibulousbr/
 bc/b  uc/ualifragilisticbr/
 #+end_html
 --8---cut here---end---8---
 
 It always amazes me how fixated I can get on the wrong approach.
 
 Nick
 




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

2011-08-25 Thread Michael Hannon
Thanks to Suvayu, John, and Nick (in chronological order) for thoughtful 
comments on this.  I'm still considering my options.

-- Mike

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

2011-08-24 Thread Michael Hannon
Greetings.  I've inherited an HTML document that uses the construct:

    ue/uvent

for instance, to underline the initial 'e' in the word.  The context is
something like:

    be/b    ue/uvent

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?

Thanks,

-- Mike

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

2011-08-24 Thread suvayu ali
On Wed, Aug 24, 2011 at 10:16 PM, Michael Hannon jm_han...@yahoo.com wrote:
 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?


I don't believe you can.

-- 
Suvayu

Open source is the future. It sets us free.



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

2011-08-24 Thread Michael Hannon
Thanks, Suvayu.  I'll bet somebody on this list could knock out 400 lines of 
elisp code that would do the trick, but I'm happy to punt on it.  It isn't that 
important a feature.

-- Mike




From: suvayu ali fatkasuvayu+li...@gmail.com
To: Michael Hannon jm_han...@yahoo.com
Cc: Org-Mode List emacs-orgmode@gnu.org
Sent: Wednesday, August 24, 2011 2:51 PM
Subject: Re: [O] Underline ONLY the first character of a word?

On Wed, Aug 24, 2011 at 10:16 PM, Michael Hannon jm_han...@yahoo.com wrote:
 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?


I don't believe you can.

-- 
Suvayu

Open source is the future. It sets us free.





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

2011-08-24 Thread John Hendy

 
 From: suvayu ali fatkasuvayu+li...@gmail.com
 To: Michael Hannon jm_han...@yahoo.com
 Cc: Org-Mode List emacs-orgmode@gnu.org
 Sent: Wednesday, August 24, 2011 2:51 PM
 Subject: Re: [O] Underline ONLY the first character of a word?

 On Wed, Aug 24, 2011 at 10:16 PM, Michael Hannon jm_han...@yahoo.com
 wrote:
 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?


What are you exporting to? I almost exclusively use LaTeX, so I will
take to forcing something like this on the rare occasion I need it:

,-
| \underline{T}his is a test.
| Ti\emph{k}Z
`-


John


 I don't believe you can.

 --
 Suvayu

 Open source is the future. It sets us free.







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

2011-08-24 Thread Nick Dokos
Michael Hannon jm_han...@yahoo.com wrote:

 Greetings.  I've inherited an HTML document that uses the construct:
 
 ue/uvent
 
 for instance, to underline the initial 'e' in the word.  The context is
 something like:
 
 be/bue/uvent
 
 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%sbr/ % (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
ba/b  ua/uctionablebr/
bb/b  ub/uibulousbr/
bc/b  uc/ualifragilisticbr/
#+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.



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

2011-08-24 Thread Nick Dokos
Nick Dokos nicholas.do...@hp.com wrote:

 Not without some code I think.
 

D'oh - as John Hendy points out, you can do it by hand:

--8---cut here---start-8---

#+begin_html
 ba/b  ua/uctionablebr/
 bb/b  ub/uibulousbr/
 bc/b  uc/ualifragilisticbr/
#+end_html
--8---cut here---end---8---

It always amazes me how fixated I can get on the wrong approach.

Nick



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

2011-08-24 Thread Nick Dokos
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%sbr/ % (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%sbr/ % (row[0],
 row[1][0:1],
 row[1][1:])
  
  print #+end_html
  
#+end_src

#+results:
#+begin_example
* Results
#+begin_html
ba/b  ua/uctionablebr/
bb/b  ub/uibulousbr/
bc/b  uc/ualifragilisticbr/
#+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-1span class=section-number-21/span Results /h2
div class=outline-text-2 id=text-1


ba/b  ua/uctionablebr/
bb/b  ub/uibulousbr/
bc/b  uc/ualifragilisticbr/

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