forked from mirrors/org-mode
lisp file to give processing of #+BEGIN_R blocks. (require 'org-sweave) to use.
This commit is contained in:
parent
b0f2fe3390
commit
9ea78cd580
40
existing_tools/RweaveOrg/org-sweave.el
Normal file
40
existing_tools/RweaveOrg/org-sweave.el
Normal file
|
@ -0,0 +1,40 @@
|
|||
(require 'org)
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.[SRsr][Oo]rg\\'" . org-mode))
|
||||
(setq org-edit-src-region-extra
|
||||
'(
|
||||
;; Use muse-style tags
|
||||
("<[sr]>[ \t]*\n?" "\n?[ \t]*</[sr]>" "r") ; not
|
||||
; understood by
|
||||
; SweaveSyntaxOrg
|
||||
; at this point.
|
||||
; Maybe make
|
||||
; SweaveSyntaxMuse?
|
||||
|
||||
|
||||
;; R-environments when using SweaveSyntaxLatex
|
||||
("^[ \t]*\\\\begin{[sr]code}\\s-*"
|
||||
"\n[ \t]*\\\\end{[sr]code}\\s-*"
|
||||
"r") ;Scode environment in raw LaTeX
|
||||
("^#\\+latex:[ \t]*\\\\begin{[sr]code}\\s-*"
|
||||
"\n#\\+latex:[ \t]*\\\\end{[sr]code}\\s-*"
|
||||
"r") ;Scode environment in a #+latex block
|
||||
("\\\\Sexpr{"
|
||||
"}"
|
||||
"r") ; embed [SR] expressions in text
|
||||
|
||||
;; R environments when using SweaveSyntaxOrg
|
||||
("^#\\+begin_[sr]\\s-*"
|
||||
"\n#\\+end_[sr]\\s-*"
|
||||
"r") ; an S code block in SweaveSyntaxOrg
|
||||
("^#\\+[sr]_file:?[ \t]*"
|
||||
"\n"
|
||||
"r")
|
||||
("\\\\[sr]{"
|
||||
"}"
|
||||
"r")
|
||||
))
|
||||
|
||||
(setq org-export-latex-append-header "\\usepackage{Sweave}")
|
||||
|
||||
(provide 'org-sweave)
|
Loading…
Reference in a new issue