From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: export-latex beamer Date: Wed, 23 Apr 2008 16:03:45 -0400 Message-ID: <10405.1208981025@alphaville.zko.hp.com> References: <47CDC0CE.7030909@gmail.com> <878x0yp0vy.fsf@bzg.ath.cx> <47CDD1C3.7050807@cornell.edu> <87wsoihwsw.fsf@bzg.ath.cx> <47CE0543.8000907@cornell.edu> <87abldc2p2.fsf@bzg.ath.cx> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JolDi-0001fh-Uo for emacs-orgmode@gnu.org; Wed, 23 Apr 2008 16:05:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JolDf-0001dq-IL for emacs-orgmode@gnu.org; Wed, 23 Apr 2008 16:05:34 -0400 Received: from [199.232.76.173] (port=47537 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JolDf-0001dg-Dv for emacs-orgmode@gnu.org; Wed, 23 Apr 2008 16:05:31 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JolDe-0000sS-P8 for emacs-orgmode@gnu.org; Wed, 23 Apr 2008 16:05:31 -0400 In-Reply-To: Message from Bastien of "Wed, 05 Mar 2008 02:41:29 GMT." <87abldc2p2.fsf@bzg.ath.cx> 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: Bastien Cc: emacs-orgmode@gnu.org Hi Bastien, I have a quick-n-dirty patch to export an org file as a beamer document. It has been tested on one very simple org file only, so YMMV. I hope I have not broken anything else in the process but if I have, please let me know. It takes level 1 headlines and makes them into frametitles for a frame, starts an itemize environment and includes all level 2 subordinates as items. At the end, it closes the itemize enviroment and the frame. It's just barely enough to cover the simplest conversion, but I hope it's useful nevertheless. I *did* change the format of org-export-latex-classes. Instead of pairs, I use lists: the third element of the list, if present, is the string to use to close any environment(s) opened by the first or second elements of the list. So if this variable has been customized, things are going to break. HTH, Nick PS. I see I also added a second clause to some conditionals, checking whether the subcontent is null and avoiding the function call in that case. That's only a small optimization that I introduced to simplify the tracing that I was doing when trying to understand the code. I don't think it hurts anything to leave it in, however if it causes problems, it can be ripped out. --- a/lisp/org-export-latex.el +++ b/lisp/org-export-latex.el @@ -89,31 +89,39 @@ \\usepackage[utf8]{inputenc} \\usepackage[T1]{fontenc} \\usepackage{hyperref}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\section{%s}" "\\section*{%s}") + ("\\subsection{%s}" "\\subsection*{%s}") + ("\\subsubsection{%s}" "\\subsubsection*{%s}") + ("\\paragraph{%s}" "\\paragraph*{%s}") + ("\\subparagraph{%s}" "\\subparagraph*{%s}")) ("report" "\\documentclass[11pt,a4paper]{report} \\usepackage[utf8]{inputenc} \\usepackage[T1]{fontenc} \\usepackage{hyperref}" - ("\\part{%s}" . "\\part*{%s}") - ("\\chapter{%s}" . "\\chapter*{%s}") - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) + ("\\part{%s}" "\\part*{%s}") + ("\\chapter{%s}" "\\chapter*{%s}") + ("\\section{%s}" "\\section*{%s}") + ("\\subsection{%s}" "\\subsection*{%s}") + ("\\subsubsection{%s}" "\\subsubsection*{%s}")) ("book" "\\documentclass[11pt,a4paper]{book} \\usepackage[utf8]{inputenc} \\usepackage[T1]{fontenc} \\usepackage{hyperref}" - ("\\part{%s}" . "\\part*{%s}") - ("\\chapter{%s}" . "\\chapter*{%s}") - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) + ("\\part{%s}" "\\part*{%s}") + ("\\chapter{%s}" "\\chapter*{%s}") + ("\\section{%s}" "\\section*{%s}") + ("\\subsection{%s}" "\\subsection*{%s}") + ("\\subsubsection{%s}" "\\subsubsection*{%s}")) + ("beamer" + "\\documentclass{beamer} +\\usepackage[utf8]{inputenc} +\\usepackage[T1]{fontenc} +\\usepackage{hyperref}" + ("\\frame{\\frametitle{%s}\\begin{itemize}" "\\frame{\\frametitle{%s}\\begin{itemize}" "\\end{itemize}}") + ("\\item{%s}" "\\item*{%s}") + ("" ""))) "Alist of LaTeX classes and associated header and structure. If #+LaTeX_CLASS is set in the buffer, use its value and the associated information. Here is the structure of each cell: @@ -567,11 +575,14 @@ and its content." ;; Normal conversion ((<= level org-export-latex-sectioning-depth) (let ((sec (nth (1- level) org-export-latex-sectioning))) - (insert (format (if num (car sec) (cdr sec)) heading) "\n")) - (insert (org-export-latex-content content)) - (cond ((stringp subcontent) (insert subcontent)) - ((null subcontent)) - ((listp subcontent) (org-export-latex-sub subcontent)))) + (insert (format (if num (car sec) (cadr sec)) heading) "\n") + (insert (org-export-latex-content content)) + (cond ((stringp subcontent) (insert subcontent)) + ((null subcontent)) + ((listp subcontent) (org-export-latex-sub subcontent))) + (let ((closing (caddr sec))) + (if closing + (insert closing "\n"))))) ;; At a level under the hl option: we can drop this subsection ((> level org-export-latex-sectioning-depth) (cond ((eq org-export-latex-low-levels 'description)