emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ken Williams <kenahoo@gmail.com>
To: John Hendy <jw.hendy@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Problem exporting code
Date: Mon, 21 Jan 2013 00:05:55 -0600	[thread overview]
Message-ID: <CACrz-HvaumB=6qtY0AYyJy1SSdaqJF_CCSDi3bc8Zgt9peNRVg@mail.gmail.com> (raw)
In-Reply-To: <CA+M2ft9i8SpGJt+DpLnGb+tukO3HYVQ5k1wQEGHeZNiT19FreA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4888 bytes --]

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:

>>>>>>>>>>>>>>>>>>>>>
<pre class="example">
5+5
</pre>

<pre class="example">
[1] 10
</pre>
<<<<<<<<<<<<<<<<<<<<<

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" "<p
class=\"author\">Author: <a href=\"mailto:%e\">%a</a></p>
<p class=\"date\">Date: %d</p>
"))))
 '(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
"<style type=\"text/css\">
    <!--/*--><![CDATA[/*><!--*/
      .src             { background-color: #F5FFF5; position: relative;
overflow: visible; margin-right: auto; }
      .src:before      { position: absolute; top: -15px; background:
#ffffff; padding: 1px; border: 1px solid #000000; font-size: small; }
      .src-sh:before   { content: 'sh'; }
      .src-bash:before { content: 'sh'; }
      .src-R:before    { content: 'R'; }
      .src-perl:before { content: 'Perl'; }
      .src-java:before { content: 'Java'; }
      .src-sql:before  { content: 'SQL'; }
      .example         { background-color: #FFF5F5; }
    /*]]>*/-->
</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 <jw.hendy@gmail.com> wrote:

> On Sun, Jan 20, 2013 at 10:57 PM, Ken Williams <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 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 <pre
> >>> 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 "<pre class="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 =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
>

[-- Attachment #2: Type: text/html, Size: 9351 bytes --]

  parent reply	other threads:[~2013-01-21  6:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 23:44 Problem exporting code Ken Williams
2013-01-21  0:31 ` Ken Williams
2013-01-21  3:15   ` Eric S Fraga
2013-01-21  4:57     ` Ken Williams
2013-01-21  5:36       ` John Hendy
2013-01-21  5:38         ` John Hendy
2013-01-21  6:05         ` Ken Williams [this message]
2013-01-21  7:39           ` Eric S Fraga
2013-01-21 15:58             ` Ken Williams
2013-01-21 16:48               ` John Hendy
2013-01-21 17:45                 ` Ken Williams
2013-01-21 22:16                   ` John Hendy
2013-01-21 22:51                     ` Ken Williams
2013-01-22  0:14                       ` Thomas S. Dye
     [not found]                       ` <CA+M2ft_nyHsjC3V0FPvL+NbYBTP1FGKLqF0=miX09uByhS_oKA@mail.gmail.com>
2013-01-22  2:48                         ` Ken Williams
2013-01-22  7:01                           ` Thomas S. Dye
2013-01-22  7:49                             ` Bastien
2013-01-22 11:13                               ` Thorsten Jolitz
2013-01-22 11:54                                 ` Bastien
2013-01-22 12:58                                   ` Thorsten Jolitz
2013-01-22 19:45                                   ` Thorsten Jolitz
2013-01-22 21:41                                     ` Bastien
2013-01-22 13:02                               ` Ken Williams
2013-01-22 13:10                                 ` Bastien
2013-01-22 17:44                               ` Achim Gratz
2013-01-22 21:41                                 ` Bastien
2013-01-22 17:37                             ` Achim Gratz
2013-01-22 19:39                               ` Thomas S. Dye
2013-01-23  7:27                                 ` Achim Gratz
2013-01-21 23:43               ` Eric S Fraga
2013-01-21  6:11         ` Ken Williams
2013-01-21  5:52       ` Ken Williams

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='CACrz-HvaumB=6qtY0AYyJy1SSdaqJF_CCSDi3bc8Zgt9peNRVg@mail.gmail.com' \
    --to=kenahoo@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jw.hendy@gmail.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).