emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [babel] language support


From: Eric Schulte
Subject: Re: [Orgmode] [babel] language support
Date: Sat, 17 Oct 2009 12:41:11 -0600
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (darwin)

Hi Tom,

I certainly believe what you describe should be possible, although it
pains me to imagine embedding pure latex code in an Org-mode document
and losing the ability to use the org latex export helpers :), but I
digress.

Org-babel needs to be told to recognize latex source code blocks and how
they should be tangled, which can be accomplished with the following

(org-babel-add-interpreter "latex")
(add-to-list 'org-babel-tangle-langs '("latex" "tex"))

Once that is done `org-babel-tangle' should do the trick.

for example, after evaluating the above I was able to tangle the
following .org file into the following .tex file.

Attachment: babel-latex.org
Description: Binary data

Attachment: latex-thesis.tex
Description: TeX document


Hope this suits your needs.  Cheers -- Eric

"Thomas S. Dye" <address@hidden> writes:

> Aloha all,
>
> Is it possible (or would it be useful) to leverage the literate programming 
> facilities of org-babel to
> write LaTeX code?  
>
> I'd like to weave a document that describes how some thesis/idea/story can be 
> developed/elaborated/told
> and then tangle an instance of 'developed thesis'/'elaborated idea'/'told 
> story' that LaTeX can make
> presentable.  The motivation for this is a desire to have one source document 
> that will tangle 1) a slide
> presentation via beamer, and 2) a print document for publication.  The two 
> share a common organization/
> structure/plot but there are radically different presentation mode 
> constraints.
>
> Org-mode is a terrific tool for organizing, structuring, and plotting.  
> Org-babel seems to be a likely
> candidate for abstracting the different presentation modes.
>
> Here is some pseudo-code for illustration:
>
> * Idea 1
>
> #+srcname: beamer-idea-1
>
> #+begin_src latex :exports none
>
> \begin{itemize}
>
>         \item first concept
>
>         \item second concept
>
> \end{itemize}
>
> #+end_src
>
> #+srcname: latex-idea-1
>
> #+begin_src latex :exports none
>
> The first concept was developed by \citet{author1}.  It later became the 
> basis for the second concept \citep{author2}. ...
>
> #+end_src
>
> #+srcname: beamer-presentation
>
> #+begin_src latex :tangle beamer-thesis :exports none
>
> # <<beamer-idea-1>>
>
> # <<beamer-idea-2>>
>
> ... 
>
> #+end_src
>
> #+srcname: latex-presentation
>
> #+begin_src latex :tangle latex-thesis :exports none
>
> # <<latex-idea-1>>
>
> # <<latex-idea-2>>
>
> ... 
>
> #+end_src
>
> Tom
>
> Thomas S. Dye, Ph.D.
>
> T. S. Dye & Colleagues, Archaeologists, Inc.
>
> Phone: (808) 529-0866 Fax: (808) 529-0884
>
> http://www.tsdye.com
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

reply via email to

[Prev in Thread] Current Thread [Next in Thread]