emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Austin Frank <austin.frank@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-export-sweave
Date: Wed, 17 Sep 2008 14:44:02 -0400	[thread overview]
Message-ID: <m04p4eobnx.fsf@gmail.com> (raw)
In-Reply-To: 25FF1422-4BCE-4C55-B780-C8233ED9B4F7@uva.nl


[-- Attachment #1.1.1: Type: text/plain, Size: 1759 bytes --]

Carsten--

Thanks for the response!

On Tue, Sep 16 2008, Carsten Dominik wrote:

> since you want to include tis code literally into LaTeX,  the best is
> probably to encapsulate it into
>
> #+BEGIN_LATEX .... #+END_LATEX
>
> and to try to solve only the local editing issue.

Yes, this makes sense.  Though, since really all I need to do is wrap
source code written in R in a \LaTeX environment, I might also like to
use

#v+
#+LATEX:  \begin{Scode}
a <- 3
a
#+LATEX:  \end{Scode}
#v-

> Take a look at the function org-edit-src-find-region-and-lang.  There
> is a list of regular expressions that can be used to identify regions
> that should be edited in special modes - maybe I can make this list
> extensible - first, give it a try and see if you can get it working by
> editing the list.

While I think opening up this list to customization is probably a good
idea, I could not get my new entries to behave the way I wanted.  The
problem, I suspect, may have to do with the ordering of the different
language environments.  Suppose I had

#v+
#+BEGIN_LATEX
\begin{Scode}
a <- 3
a
\end{Scode}
#+END_LATEX
#v-

in an org file.  I guess that I want the code within the Scode
environment to me in r-mode, and the code outside of that but still
within the LATEX block to be in LaTeX-mode.  In what order should these
two definitions appear within the re-list?

FWIW, attached is a patch of the setup I tried to use.  When I hit C-c '
inside either of the above examples, I get a temporary buffer that's in
latex-mode.  I was hoping to get a temporary buffer in r-mode.  I also
tried a version of the code that used the same entries in the re-list,
but put them at the bottom, under the entries for ascii.  Same results.

Thanks for any further advice,
/au


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: org-sweave.patch --]
[-- Type: text/x-patch, Size: 669 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index 4b29704..0612653 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5562,6 +5562,8 @@ the language, a switch telling of the content should be in a single line."
 	   ("^#\\+begin_example.*\n" "^#\\+end_example" "fundamental")
 	   ("^#\\+html:" "\n" "html" single-line)
 	   ("^#\\+begin_html.*\n" "\n#\\+end_html" "html")
+           ("^\\s*\\\\begin{scode}" "^\\s*\\\\end{scode}" "r")
+	   ("^#\\+latex:\\s*\\\\begin{scode}" "^#\\+latex:\\s*\\\\end{scode}" "r")
 	   ("^#\\+begin_latex.*\n" "\n#\\+end_latex" "latex")
 	   ("^#\\+latex:" "\n" "latex" single-line)
 	   ("^#\\+begin_ascii.*\n" "\n#\\+end_ascii" "fundamental")

[-- Attachment #1.1.3: Type: text/plain, Size: 105 bytes --]




-- 
Austin Frank
http://aufrank.net
GPG Public Key (D7398C2F): http://aufrank.net/personal.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 193 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2008-09-17 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 13:19 org-export-sweave Austin Frank
2008-09-16 12:41 ` org-export-sweave Carsten Dominik
2008-09-17 18:44   ` Austin Frank [this message]
2008-09-18  8:58     ` org-export-sweave Carsten Dominik
2008-09-22 22:18       ` org-export-sweave Austin Frank
2008-09-23  6:14         ` org-export-sweave Carsten Dominik

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=m04p4eobnx.fsf@gmail.com \
    --to=austin.frank@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).