[O] monospace (=) and quotes not getting along

2011-08-25 Thread Michael Hannon
Greetings.  I have another dumb question related to HTML export.  In the
document I'm revising I have some R code and some references to R variables.
I'd like the R code and variables to appear in monospaced font.  This seems
easy enough.  Here's an example that works as I want it to work:

    To define =my_foobar= in this model, we issue the command:

    = my_foobar = dataset$foobar=

I've got a whole series of similar expressions, and they mostly do work, but
here's one that doesn't:

    To define =my_frabbitz= in this model, we issue the command:

    = my_frabbitz = someRandomWord=

The my_frabbitz in the sentence comes out in monospace, but the R code
doesn't.  It seems that the quotation marks are killing the process.

I've tried a number of stupid quoting tricks, such as using:

    ...\someRandomWord\=
    ...someRandomWord=

etc., but they typically make things worse.

BTW, using the begin/end_example construct does more or less what I want, but
it breaks the flow of the document, and there are many places in the document
where the =...= construct works just fine and gives the look I need.

Any suggestions?

Thanks,

-- Mike

Re: [O] monospace (=) and quotes not getting along

2011-08-25 Thread Michael Hannon
Michael Gauland mikely...@no8wireless.co.nz wrote:

 Michael Hannon jm_hannon at yahoo.com writes:
 
  To define =my_frabbitz= in this model, we issue the command:
     = my_frabbitz = someRandomWord=
  The my_frabbitz in the sentence comes out in monospace, but the
  R codedoesn't.  It seems that the quotation marks are killing the process.
 
 I don't remember why this happens, but I've dealt with it by inserting a null
 between the quote and the equals. I use export hooks to remove the null from
 the
 exported HTML and LaTeX files:
 
 
 (add-hook 'org-export-latex-final-hook
   (lambda ()
 (goto-char (point-min))
 (while (re-search-forward ^@ nil t)
   (replace-match )
   )
 )
   )
 (add-hook 'org-export-html-final-hook
   (lambda ()
 (goto-char (point-min))
 (while (re-search-forward ^@ nil t)
   (replace-match )
   )
 )
   )

Hi, Mike.  I was going to object that this was a dangerous approach in my
situation, as I intend to pass the .org file on to someone else after I've
revised it, and there'd be no way to guarantee that future generations would
have the same hooks defined.

Nevertheless, I tried inserting ^@ as you suggested and then exporting to
HTML, WITHOUT defining the hooks, just to see what would happen.  The answer
is that the HTML document looked just fine!  (This is with Org-mode version
7.7 on Emacs 23.2.1 on 64-bit linux.)

I don't know if this matters, but I placed the LHS and RHS of the R expression
on different, consecutive lines, as:

    = someVar ==
    =^@someString^@=

In HTML these are glommed together anyway.

I really appreciate your suggestion.  And, if anybody asks me, I'll be
recommending you for a MacArthur award.

-- Mike