* monospace (=) and quotes not getting along
@ 2011-08-25 22:02 Michael Hannon
2011-08-25 23:45 ` Michael Gauland
0 siblings, 1 reply; 3+ messages in thread
From: Michael Hannon @ 2011-08-25 22:02 UTC (permalink / raw)
To: Org-Mode List
[-- Attachment #1: Type: text/plain, Size: 1208 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 1592 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: monospace (=) and quotes not getting along
2011-08-25 22:02 monospace (=) and quotes not getting along Michael Hannon
@ 2011-08-25 23:45 ` Michael Gauland
2011-08-26 3:53 ` Michael Hannon
0 siblings, 1 reply; 3+ messages in thread
From: Michael Gauland @ 2011-08-25 23:45 UTC (permalink / raw)
To: emacs-orgmode
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 "")
)
)
)
--(a different) Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: monospace (=) and quotes not getting along
2011-08-25 23:45 ` Michael Gauland
@ 2011-08-26 3:53 ` Michael Hannon
0 siblings, 0 replies; 3+ messages in thread
From: Michael Hannon @ 2011-08-26 3:53 UTC (permalink / raw)
To: Michael Gauland, emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]
Michael Gauland <mikelygee@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
[-- Attachment #2: Type: text/html, Size: 2920 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-26 3:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 22:02 monospace (=) and quotes not getting along Michael Hannon
2011-08-25 23:45 ` Michael Gauland
2011-08-26 3:53 ` Michael Hannon
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).