From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Export to LaTeX Beamer. [WAS: Re: Re: LaTeX export bugs?] Date: Sun, 20 Sep 2009 11:16:15 -1000 Message-ID: <935736B7-18C4-4730-B765-D9E8463E9C84@tsdye.com> References: <7bef1f890909192303h462a7305u2a5aa497ed346a63@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============0438305977==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MpTlj-0001Ty-LR for emacs-orgmode@gnu.org; Sun, 20 Sep 2009 17:16:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MpTle-0001Tm-G8 for emacs-orgmode@gnu.org; Sun, 20 Sep 2009 17:16:26 -0400 Received: from [199.232.76.173] (port=43809 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MpTle-0001Tj-B5 for emacs-orgmode@gnu.org; Sun, 20 Sep 2009 17:16:22 -0400 Received: from outbound-mail-303.bluehost.com ([67.222.53.10]:36716) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MpTld-0001Io-Or for emacs-orgmode@gnu.org; Sun, 20 Sep 2009 17:16:22 -0400 In-Reply-To: <7bef1f890909192303h462a7305u2a5aa497ed346a63@mail.gmail.com> 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: "Alan E. Davis" Cc: =?ISO-8859-1?Q?S=E9bastien_Vauban?= , emacs-orgmode@gnu.org --===============0438305977== Content-Type: multipart/alternative; boundary=Apple-Mail-2-296268515 --Apple-Mail-2-296268515 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Sep 19, 2009, at 8:03 PM, Alan E. Davis wrote: > Hello: > > I was happy to see a simple formula for exporting to Beamer. The > following worked initially. However, this initialization routine > was able to run only when org-latex had already been loaded. > > On Sat, Jul 4, 2009 at 2:52 AM, Nick Dokos > wrote: > > Here's the minimal.emacs - you'll need to adjust the load path for > your > setup: > > ,---- > | (add-to-list 'load-path (expand-file-name "~/src/emacs/org/org- > mode/lisp")) > | (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\) > $" . org-mode)) > | (require 'org-install) > | (global-set-key "\C-cl" 'org-store-link) > | (global-set-key "\C-ca" 'org-agenda) > | (global-set-key "\C-cb" 'org-iswitchb) > | (setq org-log-done (quote time)) > | (setq org-log-into-drawer t) > | > | (load "org-exp") > | (load "org-latex") > | > | (add-to-list 'org-export-latex-classes > | '("beamer" > | "\\documentclass[11pt]{beamer} > | \\usepackage[utf8]{inputenc} > | \\usepackage[T1]{fontenc} > | \\usepackage{hyperref} > | \\usepackage{verbatim} > | \\setbeameroption{show notes} > | \\usetheme{Goettingen} > | \\useoutertheme{infolines}" > | ("\\begin{frame}\\frametitle{%s}\\begin{itemize}" "\ > \end{itemize}\\end{frame}" > | "\\begin{frame}\\frametitle{%s}\\begin{itemize}" "\ > \end{itemize}\\end{frame}") > | ("\\item{%s}" . "\\item*{%s}") > | ) > | ) > `---- > > > Is it possible to put this inside of a hook (say, when org-latex was > loaded, or when the document class was beamer during the export > process)? > > Emacs just reports the following when this code is included into the > init file: > > Symbol's value as variable is void: org-export-latex-classes > > After explicitly loading the library "org-latex" the code is > executed and the procedure works for exporting the example file--- > given that the latex code must be cleaned up. > > I haven't yet tried the following as a heading line: > > #+OPTIONS: toc:nil > > Would that solve the problem you reported? > > Alan > > > > and here's slides.org: > > ,---- > | #+LaTeX_CLASS: beamer > | #+TITLE: Example presentation > | #+AUTHOR: Nick Dokos \\ $<$\href{mailto:nicholas.dokos@hp.com}{nicholas.dokos@hp.com > }$>$ > | #+EMAIL: nicholas.dokos@hp.com > | #+OPTIONS: toc:nil H:2 > | > | * Why > | ** Reason 1. > | Text explaining reason #1. > | ** Reason 2. > | ... more explanations. > | ** Reason 3. > | Blah, blah, blah. > | > | ** Reason 4. > | Why not? > | > | * What > | ** First piece. > | ** Second piece. > | ** Third piece. > | ** Fourth piece. > `---- > > > Thank you for this helpful advice. > > Alan Davis > > You can know the name of a bird in all the languages of the world, > but when you're finished, you'll know absolutely nothing whatever > about the bird... So let's look at the bird and see what it's > doing---that's what counts. > > ----Richard Feynman > > _______________________________________________ > 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 Aloha Alan, Here is a somewhat more elaborate set-up. In customize org-export-latex-classes (or add to appropriate place in .emacs): \documentclass{beamer} \mode<{{{beamermode}}}> { \usetheme{{{{beamertheme}}}} \usecolortheme{{{{beamercolortheme}}}} } \usepackage[english]{babel} \usepackage[latin1]{inputenc} \usepackage{times} \usepackage[T1]{fontenc} \institute{{{{beamerinstitute}}}} \subject{{{{beamersubject}}}} The macros here let me specify things that I like to change on a per- file basis. So, in my org file there is this: #+MACRO: BEAMERMODE presentation #+MACRO: BEAMERTHEME Malmoe #+MACRO: BEAMERCOLORTHEME tsdye #+MACRO: BEAMERSUBJECT Evolutionary archaeology #+MACRO: BEAMERINSTITUTE T. S. Dye \& Colleagues \\ B. P. Bishop Museum I typically use sections and subsections in my talks (and the Malmoe theme displays them nicely within beamer). So, I have this in customize org-export-latex-classes: INS DEL Choice: Value Menu Heading: numbered: \section{%s} unnumbered): \section{%s} INS DEL Choice: Value Menu Heading: numbered: \subsection{%s} unnumbered): \subsection{%s} INS DEL Choice: Value Menu Environment: Opening (numbered) : \begin{frame} \frametitle{%s} Closing (numbered) : \end{frame} Opening (unnumbered): \begin{frame} \frametitle{%s} Closing (unnumbered): \end{frame} I have the standard value for org-export-latex-low-levels in customize: Org Export Latex Low Levels: Hide Value Value Menu Convert as itemized list And then this in my .org file: #+OPTIONS: H:3 #+OPTIONS: toc:nil A typical slide show might look like this, in part: * Introduction ** Evolution *** Four Components of Evolutionary Processes **** Inheritance = Social learning **** {{{alert(Mutation)}}} = {{{alert(Innovation)}}} **** Selection = Function **** Drift = Style I use beamer's \alert{} command a lot, and often have figures in my slide shows, so I defined two convenience macros: #+MACRO: ALERT \alert{$1} #+MACRO: FIGURE \begin{centering}\includegraphics[$2]{$1}\par \end{centering} And use FIGURE like this: *** Determining Fish Size from Vertebrae {{{figure(r/bm_verts,width=12cm)}}} and ALERT like this: **** The probability a bone was {{{alert(not)}}} recovered is: #+BEGIN_LaTeX $ 1 - \hat{r} $ #+END_LaTeX I haven't found a way to export columns yet. If I could do this, then I'd be able to generate most of my beamer presentations completely from org-mode. As it is, I'm enjoying substantial productivity gains with this set-up. HTH, Tom --Apple-Mail-2-296268515 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On Sep 19, 2009, at = 8:03 PM, Alan E. Davis wrote:

Hello:

I was happy to see a simple formula for = exporting to Beamer.  The following worked initially.  = However, this initialization routine was able to run only when org-latex = had already been loaded.  

= On Sat, Jul 4, 2009 at 2:52 AM, Nick Dokos <nicholas.dokos@hp.com>= wrote:

Here's the minimal.emacs - you'll need to adjust the load = path for your
setup:

,----
| (add-to-list 'load-path = (expand-file-name "~/src/emacs/org/org-mode/lisp"))
| (add-to-list = 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
= | (require 'org-install)
| (global-set-key "\C-cl" = 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| = (global-set-key "\C-cb" 'org-iswitchb)
| (setq org-log-done (quote = time))
| (setq org-log-into-drawer t)
|
| (load = "org-exp")
| (load "org-latex")
|
| = (add-to-list 'org-export-latex-classes
|         =      '("beamer"
|           =      "\\documentclass[11pt]{beamer}
| = \\usepackage[utf8]{inputenc}
| = \\usepackage[T1]{fontenc}
| \\usepackage{hyperref}
| = \\usepackage{verbatim}
| \\setbeameroption{show notes}
| = \\usetheme{Goettingen}
| \\useoutertheme{infolines}"
|               =  ("\\begin{frame}\\frametitle{%s}\\begin{itemize}" = "\\end{itemize}\\end{frame}"
|           =       "\\begin{frame}\\frametitle{%s}\\begin{itemize}" = "\\end{itemize}\\end{frame}")
|           =      ("\\item{%s}" . "\\item*{%s}")
|   =              )
|     =          )
`----
=

Is it possible to put this inside of a hook = (say, when org-latex was loaded, or when the document class was beamer = during the export process)?

Emacs just reports the following = when this code is included into the init file:
=
       Symbol's value as variable is = void: org-export-latex-classes

After explicitly loading the = library "org-latex" the code is executed and the procedure works for = exporting the example file---given that the latex code must be cleaned = up. 

I haven't yet tried the following as a heading = line:

       #+OPTIONS: = toc:nil

Would that solve the problem you reported?

Alan =


 
and here's slides.org:

,----
| = #+LaTeX_CLASS: beamer
| #+TITLE: Example presentation
| = #+AUTHOR: Nick Dokos \\ $<$\href{mailto:nicholas.dokos@hp.com}{nicholas.dokos@hp.com}$>$
= | #+EMAIL: nicholas.dokos@hp.com
=
| #+OPTIONS: toc:nil H:2
|
| * Why
| = ** Reason 1.
|    Text explaining reason #1.
| ** = Reason 2.
|    ... more explanations.
| ** Reason = 3.
|    Blah, blah, blah.
|
| ** Reason 4.
| =    Why not?
|
| * What
| ** First piece.
| ** = Second piece.
| ** Third piece.
| ** Fourth piece.
`----


Thank you for this = helpful advice.

Alan Davis

You can know the name of a bird = in all the languages of the world,  but when you're finished, = you'll know absolutely nothing whatever about the bird... So let's look = at the bird and see what it's doing---that's what counts.

  =  ----Richard Feynman
      
= _______________________________________________
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

Aloha Alan,

Here is a somewhat more elaborate = set-up.

In customize org-export-latex-classes = (or add to appropriate place in = .emacs):

\documentclass{beamer}
\m= ode<{{{beamermode}}}>
{
 \usetheme{{{{beame= rtheme}}}}
 \usecolortheme{{{{beamercolortheme}}}}
}
\usepackage[english]{babel}
\usepackage[latin1]{in= putenc}
\usepackage{times} 
\usepackage[T1]{fonte= nc}
\institute{{{{beamerinstitute}}}}       =   =  
\subject{{{{beamersubject}}}}

Th= e macros here let me specify things that I like to change on a per-file = basis.  So, in my org file there is = this:

#+MACRO: BEAMERMODE = presentation
#+MACRO: BEAMERTHEME Malmoe
#+MACRO: = BEAMERCOLORTHEME tsdye
#+MACRO: BEAMERSUBJECT Evolutionary = archaeology
#+MACRO: BEAMERINSTITUTE T. S. Dye \& = Colleagues \\ B. P. Bishop Museum

I typically = use sections and subsections in my talks (and the Malmoe theme displays = them nicely within beamer).  So, I have this in = customize org-export-latex-classes:

&nb= sp;           INS DEL Choice: Value Menu = Heading:
             =            numbered: = \section{%s}
             =            unnumbered): = \section{%s}
           =  INS DEL Choice: Value Menu Heading:
     =                   =  numbered: \subsection{%s}
       =                 =  unnumbered): \subsection{%s}
       =      INS DEL Choice: Value Menu = Environment:
             =            Opening (numbered)  : = \begin{frame}\frametitle{%s}
         =                Closing = (numbered)  : \end{frame}
       =                  Opening = (unnumbered): \begin{frame}\frametitle{%s}
     =                   =  Closing (unnumbered): \end{frame}

I have = the standard value for org-export-latex-low-levels in = customize:
Org Export Latex Low Levels: Hide Value Value = Menu Convert as itemized list

And then = this in my .org file:

#+OPTIONS: = H:3
#+OPTIONS: toc:nil

A typical = slide show might look like this, in = part:

* Introduction
** = Evolution
*** Four Components of Evolutionary = Processes
**** Inheritance =3D Social learning
**** = {{{alert(Mutation)}}} =3D {{{alert(Innovation)}}}
**** = Selection =3D Function
**** Drift =3D = Style

I use beamer's \alert{} command a lot, = and often have figures in my slide shows, so I defined two convenience = macros:

#+MACRO: ALERT = \alert{$1}
#+MACRO: FIGURE = \begin{centering}\includegraphics[$2]{$1}\par\end{centering}
And use FIGURE like this:

*** = Determining Fish Size from Vertebrae
     = {{{figure(r/bm_verts,width=3D12cm)}}}

and ALERT = like this:

**** The probability a = bone was {{{alert(not)}}} recovered = is:
#+BEGIN_LaTeX
     $ 1 - \hat{r} = $
#+END_LaTeX

I haven't found a way = to export columns yet.  If I could do this, then I'd be able to = generate most of my beamer presentations completely from org-mode. =  As it is, I'm enjoying substantial productivity gains with this = set-up.

HTH,
Tom



= --Apple-Mail-2-296268515-- --===============0438305977== 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 --===============0438305977==--