From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Williams Subject: Re: Problem exporting code Date: Mon, 21 Jan 2013 00:05:55 -0600 Message-ID: References: <87libnmdjx.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b34372c11e97104d3c641d9 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxAW7-0006wO-Ut for emacs-orgmode@gnu.org; Mon, 21 Jan 2013 01:06:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxAW4-0004xG-Lt for emacs-orgmode@gnu.org; Mon, 21 Jan 2013 01:05:59 -0500 Received: from mail-ea0-f173.google.com ([209.85.215.173]:59041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxAW4-0004x0-Bb for emacs-orgmode@gnu.org; Mon, 21 Jan 2013 01:05:56 -0500 Received: by mail-ea0-f173.google.com with SMTP id i1so1834042eaa.18 for ; Sun, 20 Jan 2013 22:05:55 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Hendy Cc: emacs-orgmode@gnu.org --047d7b34372c11e97104d3c641d9 Content-Type: text/plain; charset=ISO-8859-1 Thanks John. Here's a small org file: >>>>>>>>>>>>>>>>>>>>> #+TITLE: Sample Doc #+AUTHOR: Ken Williams #+EMAIL: kenahoo@gmail.com #+DATE: 2013-01-21 #+PROPERTY: results output #+PROPERTY: exports both #+LATEX_HEADER: \usepackage{amsmath} #+begin_src R 5+5 #+end_src #+RESULTS: : [1] 10 <<<<<<<<<<<<<<<<<<<<< The code gets exported to: >>>>>>>>>>>>>>>>>>>>>
5+5
[1] 10
<<<<<<<<<<<<<<<<<<<<< And here's my config: >>>>>>>>>>>>>>>>>>>>> (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(current-language-environment "UTF-8") '(global-font-lock-mode t nil (font-lock)) '(inhibit-splash-screen t) '(org-alphabetical-lists t) '(org-export-html-postamble nil) '(org-export-html-preamble-format (quote (("en" "

Author: %a

Date: %d

")))) '(org-src-preserve-indentation t) '(show-paren-mode t) '(tool-bar-mode nil) '(transient-mark-mode t) '(user-mail-address "kenahoo@gmail.com")) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(diff-added-face ((t (:foreground "green")))) '(diff-changed-face ((t (:foreground "blue" :slant italic :weight bold)))) '(diff-removed-face ((t (:foreground "red")))) ) (setq backup-by-copying t ; don't clobber symlinks backup-directory-alist '(("." . "/tmp/"))) (add-to-list 'load-path "~/share/emacs/site-lisp/org" load-path) (require 'org-install) (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (global-set-key (kbd "M--") 'ess-smart-underscore) (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (sh . t) (R . t) (perl . t))) (setq org-export-html-style "") (setq org-export-babel-evaluate nil) (setq org-confirm-babel-evaluate nil) <<<<<<<<<<<<<<<<<<<<< -Ken On Sun, Jan 20, 2013 at 11:36 PM, John Hendy wrote: > On Sun, Jan 20, 2013 at 10:57 PM, Ken Williams wrote: > > > > On Sun, Jan 20, 2013 at 9:15 PM, Eric S Fraga wrote: > >> > >> Ken Williams writes: > >> > >>> Unfortunately, downgrading to 7.8.11 didn't change the behavior - all > >>> code sections are still exported to HTML as class "example". > >>> I also see that on one machine, using 7.9.2, I get the desired
 >>> class="src src-R"> tag for R code export.  I can't figure out what's
> making
> >>> the difference though.
> >>
> >>
> >> I'm grasping at straws here, having seldom exported to HTML, but have
> you
> >> loaded the languages for babel?
> >
> >
> > Yes, I believe that's set up properly, because I can do "C-c C-c" and it
> > knows how to run my R sections and return the correct values.  Also,
> when I
> > "describe org-babel-load-languages", I see:
> >
> > org-babel-load-languages is a variable defined in `org.el'.
> > Its value is ((emacs-lisp . t)
> >  (sh . t)
> >  (R . t)
> >  (perl . t))
> >
> > I'm grasping at straws too, not knowing my way around the elisp code very
> > well. =)
>
> Just tried myself on a file lying around with embedded R code, and I
> get "
" for my src blocks.
>
> Can we back up a bit and have you post a minimal config and sample
> file? Perhaps the output of =M-x org-version= as well, just to be sure
> on where emacs is pulling org code from? You might have done this; my
> apologies if so. Been following the thread from a distance as I didn't
> have much experience with html/src code export. Just thought I'd chime
> in on things I've been asked to do that usually do help the situation.
>
> With a minimal config (like your load directories and the babel
> language definitions above), we can try to replicate a bit better.
> Emacs configs get long, so it's really hard to know from user to user
> what else might be going on.
>
>
> Thanks!
> John
>
> >
> >  -Ken
>

--047d7b34372c11e97104d3c641d9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks John. =A0Here's a small org file:

>>>>>>>>>>>>>>>>>&= gt;>>>
#+TITLE: Sample Doc
#+AUTHOR: = =A0 =A0Ken Williams
#+EMAIL: =A0 =A0 kenahoo@gmail.co= m
#+DATE: =A0 =A0 =A02013-01-21
#+PROPERTY: results= output
#+PROPERTY: exports both
#+LATEX_HEADER: \usepa= ckage{amsmath}


#+begin_src R
5+5
#+= end_src

#+RESULTS:
: [1] 10
<= div>
<<<<<<<<<<<<<<<<&l= t;<<<<

The code gets exporte= d to:

>>>>>>>>>>>>&g= t;>>>>>>>>
<pre class=3D"example&= quot;>
5+5
</pre>

<pre class=3D"example&q= uot;>
[1] 10
</pre>
<<<<<<<<<<<<<<<<<<&l= t;<<

And here&= #39;s my config:

>>>>>>>>>>>>>>>= ;>>>>>>
(custom-set-variables
=A0;; custom= -set-variables was added by Custom.
=A0;; I= f you edit it by hand, you could mess it up, so be careful.
=A0;; Your init file should contain only one such instance.
=A0;; If there is more than one, they won't work right= .
=A0'(current-language-environment &qu= ot;UTF-8")
=A0'(global-font-lock-mode t nil (font-lock)= )
=A0'(inhibit-splash-screen t)
=A0'(org-alphabetical-lists t)
=A0'(org-export-html-postamble nil)
=A0= '(org-export-html-preamble-format (quote (("en" "<p c= lass=3D\"author\">Author: <a href=3D\"mailto:%e\"= >%a</a></p>
<p class=3D\"date\">Date: = %d</p>
"))))
=A0'(org-src-preserve-indentation t)
=A0'(show-paren-mode t)
=A0'(tool-b= ar-mode nil)
=A0'(transient-mark-mode t= )
=A0'(user-mail-address "kenahoo@gmail.com"))
(custom-set-faces
=A0;; custom-set-faces was added by Custom.
=A0;; If you edit it by hand, you could mess it up, so be careful.
=
=A0;; Your init file should contain only one such instance.
=A0;; If there is more than one, they won't work right= .
=A0'(diff-added-face ((t (:foreground= "green"))))
=A0'(diff-changed-face ((t (:foreground &quo= t;blue" :slant italic :weight bold))))
=A0'(diff-removed-face ((t (:foreground "red"))))
=A0)

(= setq
=A0 =A0backup-by-copying t =A0 =A0 =A0= ; don't clobber symlinks
=A0 =A0backup-= directory-alist
=A0 =A0 '(("." . "/tmp/"= )))

(a= dd-to-list 'load-path "~/share/emacs/site-lisp/org" load-path= )
(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . or= g-mode))

(global-set-key (kbd "M--") 'ess-smart-underscore)

(org-babel-= do-load-languages
=A0'org-babel-load-la= nguages
=A0'((emacs-lisp . t)
=A0 =A0(sh . t)
=A0 =A0(R . t)
=A0 =A0(perl . t)))
(setq org-export-html-style
"<style type=3D\"text/css\">
=A0 =A0 <!--/*--><![CDATA[/*><!--*/
=A0 =A0 =A0 .src =A0 =A0 =A0 =A0 =A0 =A0 { background-colo= r: #F5FFF5; position: relative; overflow: visible; margin-right: auto; }
=A0 =A0 =A0 .src:before =A0 =A0 =A0{ position: a= bsolute; top: -15px; background: #ffffff; padding: 1px; border: 1px solid #= 000000; font-size: small; }
=A0 =A0 =A0 .sr= c-sh:before =A0 { content: 'sh'; }
=A0 =A0 =A0 .src-bash:before { content: 'sh&= #39;; }
=A0 =A0 =A0 .src-R:before =A0 =A0{ = content: 'R'; }
=A0 =A0 =A0 .src-pe= rl:before { content: 'Perl'; }
=A0 =A0 =A0 .src-java:before { content: 'Jav= a'; }
=A0 =A0 =A0 .src-sql:before =A0{ = content: 'SQL'; }
=A0 =A0 =A0 .exam= ple =A0 =A0 =A0 =A0 { background-color: #FFF5F5; }
=A0 =A0 /*]]>*/-->
</style>")

(setq org-export-babel-evaluate nil)
(setq org-confirm-babel-evaluate nil)
<<<<&= lt;<<<<<<<<<<<<<<<<

=A0-Ken


On Sun, Jan 20, 2013 at 11:36 PM, John Hendy <jw.hen= dy@gmail.com> wrote:
On Sun, Jan 20, 2013 at 10:57 PM, Ken Williams &= lt;kenahoo@gmail.com= > wrote:
>
> On Sun, Jan 20, 2013 at 9:15 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>>
>> Ken Williams <kenahoo@gmail.com> writes:
>>
>>> Unfortunately, downgrading to 7.8.11 didn't change the beh= avior - all
>>> code sections are still exported to HTML as class "exampl= e".
>>> I also see that on one machine, using 7.9.2, I get the desired= <pre
>>> class=3D"src src-R"> tag for R code export. =A0I = can't figure out what's making
>>> the difference though.
>>
>>
>> I'm grasping at straws here, having seldom exported to HTML, b= ut have you
>> loaded the languages for babel?
>
>
> Yes, I believe that's set up properly, because I can do "C-c = C-c" and it
> knows how to run my R sections and return the correct values. =A0Also,= when I
> "describe org-babel-load-languages", I see:
>
> org-babel-load-languages is a variable defined in `org.el'.
> Its value is ((emacs-lisp . t)
> =A0(sh . t)
> =A0(R . t)
> =A0(perl . t))
>
> I'm grasping at straws too, not knowing my way around the elisp co= de very
> well. =3D)

Just tried myself on a file lying around with embedded R code, = and I
get "<pre class=3D"src src-R">" for my src blocks= .

Can we back up a bit and have you post a minimal config and sample
file? Perhaps the output of =3DM-x org-version=3D as well, just to be sure<= br> on where emacs is pulling org code from? You might have done this; my
apologies if so. Been following the thread from a distance as I didn't<= br> have much experience with html/src code export. Just thought I'd chime<= br> in on things I've been asked to do that usually do help the situation.<= br>
With a minimal config (like your load directories and the babel
language definitions above), we can try to replicate a bit better.
Emacs configs get long, so it's really hard to know from user to user what else might be going on.


Thanks!
John

>
> =A0-Ken

--047d7b34372c11e97104d3c641d9--