From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: [babel]Subtree exporting to different LaTeX_CLASS Date: Thu, 22 Oct 2009 12:13:43 -1000 Message-ID: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============1570955071==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N15uu-0008TI-Tn for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 18:13:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N15ur-0008R3-0r for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 18:13:56 -0400 Received: from [199.232.76.173] (port=48599 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N15uq-0008Qx-IQ for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 18:13:52 -0400 Received: from outbound-mail-153.bluehost.com ([67.222.39.33]:33475) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1N15up-0003HC-VW for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 18:13:52 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: JBash Cc: emacs-orgmode@gnu.org --===============1570955071== Content-Type: multipart/alternative; boundary=Apple-Mail-151-917033051 --Apple-Mail-151-917033051 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Jerry, I do this using org-babel. I love being able to write my article *and* my beamer presentation in the same file. Using the literate programming facility of org-babel, I'm able to write them each in pieces, then assemble them at the end for tangling and export. This means I have to write real LaTeX and beamer code, rather than having the LaTeX export facility of org-mode do its work, but org-mode makes this easy with Ctrl-C ', which opens up the source block in a buffer where auctex and reftex are active. It looks something like this: #+srcname: latex-preamble #+begin_src latex :exports none \documentclass{article} \author{A. N. Author} \title{Article Title} \newcommand{\attr}[1]{\textbf{#1}} \begin{document} \maketitle #+end_src #+srcname: beamer-preamble #+begin_src latex :exports none \documentclass{beamer} ... (lots of stuff here) \begin{document} \maketitle #+end_src #+srcname: latex-document #+begin_src latex :tangle adz_print.tex :exports none % <> % < ... \end{document} #+end_src #+srcname: beamer-document #+begin_src latex :tangle adz_beamer.tex :exports none % <> % <> ... \end{document} #+end_src Calling org-babel-tangle gives me adz_print.tex for my article and adz_beamer.tex for my beamer presentation. There are probably other ways to achieve this (org-mode, you know) that might be simpler. The text I write outside the source blocks tracks what I hope to achieve, decisions I've made, etc. and uses the export facilities of org-mode to create a user manual for my employees. Right now I'm targeting html for the user manual, but LaTeX export would also work. HTH, Tom Thomas S. Dye, Ph.D. T. S. Dye & Colleagues, Archaeologists, Inc. Phone: (808) 529-0866 Fax: (808) 529-0884 http://www.tsdye.com On Oct 22, 2009, at 11:20 AM, JBash wrote: > Hi, > > A question about exporting: > > Is it possible to export two different subtrees in the same file to > a different class? There are cases where it would be nice to be > able to generate a document (say an article) from a single subtree > in a file, and have other subtrees that contain short presentations > that could be exported quickly to beamer, for example. Currently, > the exporter seems to find the first #+LaTeX_CLASS in the file and > use that for the entire file export, as well as exporting any > subtree in the file, even if you define a separate LaTeX_CLASS under > a specific subtree. I have looked into using export OPTIONS in > subtrees for this, but have not hit on the right combination. Is > this possible? > > Thanks, > Jerry > _______________________________________________ > 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 --Apple-Mail-151-917033051 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Jerry,

I = do this using org-babel.  I love being able to write my article = *and* my beamer presentation in the same file.  Using the literate = programming facility of org-babel, I'm able to write them each in = pieces, then assemble them at the end for tangling and export. =  This means I have to write real LaTeX and beamer code, rather than = having the LaTeX export facility of org-mode do its work, but org-mode = makes this easy with Ctrl-C ', which opens up the source block in a = buffer where auctex and reftex are active.

It = looks something like this:

#+srcname: = latex-preamble
#+begin_src latex :exports = none
\documentclass{article}
\author{A. N. = Author}
\title{Article = Title}
\newcommand{\attr}[1]{\textbf{#1}}

\begin{document}

\maketitle
#+end_sr= c

#+srcname: beamer-preamble
#+begin_src = latex :exports none
\documentclass{beamer}
... (lots = of stuff = here)
\begin{document}

\maketitle
=

#+end_src

#+= srcname: latex-document
#+begin_src latex :tangle = adz_print.tex :exports none
  % = <<latex-preamble>>
  % = <<latex-introduction>
= ...
  \end{document}
#+end_src

#+srcname: beamer-document
#+begin_src latex = :tangle adz_beamer.tex :exports none
  % = <<beamer-preamble>>
  % = <<beamer-introduction>>
= ...
  \end{document}
#+end_src

Calling org-babel-tangle gives me adz_print.tex for my = article and adz_beamer.tex for my beamer = presentation.

There are probably other ways to = achieve this (org-mode, you know) that might be = simpler.

The text I write outside the source = blocks tracks what I hope to achieve, decisions I've made, etc. and uses = the export facilities of org-mode to create a user manual for my = employees.  Right now I'm targeting html for the user manual, but = LaTeX export would also = work.

HTH,
Tom



Thomas S. Dye, = Ph.D.
Phone: (808) 529-0866 Fax: = (808) 529-0884

<= div>
On Oct 22, 2009, at 11:20 AM, JBash wrote:

Hi,

A= question about exporting:

Is it possible to export two different = subtrees in the same file to a different class?  There are cases = where it would be nice to be able to generate a document (say an = article) from a single subtree in a file, and have other subtrees that = contain short presentations that could be exported quickly to beamer, = for example.  Currently, the exporter seems to find the first = #+LaTeX_CLASS in the file and use that for the entire file export, as = well as exporting any subtree in the file, even if you define a separate = LaTeX_CLASS under a specific subtree.  I have looked into using = export OPTIONS in subtrees for this, but have not hit on the right = combination.  Is this = possible?

Thanks,
Jerry
_____________________________________= __________
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

= --Apple-Mail-151-917033051-- --===============1570955071== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1570955071==--