From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [latex] Problems with old exporter (for Beamer) and with new exporter Date: Thu, 07 Jun 2012 22:56:09 +0200 Message-ID: <80ipf2hmdy.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, I want to write a document where I show: - Org code to type in a buffer - (sometimes) its LaTeX translation - its effect in the output PDF Though, I have big troubles outputting the Org code one is suppose to write in the Org buffers. It often gets replaced or modified... See examples in the following ECM. With the old exporter (necessary for Beamer), all the below cases fail... With the new exporter, most things work. What does not work: - macro does not get executed (no string in orange color), - the =\end{verbatim}= disappears from the LaTeX output --8<---------------cut here---------------start------------->8--- #+TITLE: Org mode examples #+OPTIONS: H:3 num:t toc:nil #+LaTeX_HEADER: \lstdefinelanguage{org}{% #+LaTeX_HEADER: morekeywords={:results, :session, :var, :noweb, :exports}, #+LaTeX_HEADER: sensitive=false, #+LaTeX_HEADER: morestring=[b]", #+LaTeX_HEADER: morecomment=[l]{\#}, #+LaTeX_HEADER: } #+LaTeX_HEADER: \lstset{% #+LaTeX_HEADER: extendedchars=false, #+LaTeX_HEADER: inputencoding=utf8x, #+LaTeX_HEADER: % #+LaTeX_HEADER: mathescape=false, #+LaTeX_HEADER: escapechar=`, % allow escaping to (La)TeX mode within `..` #+LaTeX_HEADER: columns=flexible, #+LaTeX_HEADER: keepspaces=true #+LaTeX_HEADER: } #+MACRO: key \textcolor{orange}{\texttt{$1}} #+startup: beamer #+LaTeX_CLASS: beamer #+LaTeX_CLASS_OPTIONS: [presentation,t] #+BEAMER_HEADER_EXTRA: \usetheme{Madrid}\usecolortheme{default} #+BEAMER_FRAME_LEVEL: 1 * Macros - With the following macro definition #+begin_src org :exports code ,#+MACRO: key \textcolor{orange}{\texttt{$1}} #+end_src - Every time we write #+begin_src org :exports code ,{{{key(C-c C-e)}}} #+end_src HERE ABOVE, WE SHOULD SEE THE MACRO NAME AND PARAMETER INSIDE CURLY BRACKETS. INSTEAD, WE SEE THE LATEX REPLACEMENT CODE. - We get {{{key(C-c C-e)}}} * Listings informatiques - To input a block of code in Org, type it like this: #+begin_src org :exports code ,#+begin_src sql ,SELECT * ,FROM inventory ,WHERE product = 'ABC123' ,#+end_src #+end_src HERE, WE SHOULD SEE =#+begin_src sql=. INSTEAD, WE SEE =\begin{}sql=. - And see the nice listing: #+begin_src sql SELECT * FROM inventory WHERE product = 'ABC123' #+end_src * Verbatim - Same problem for verbatim... Here, the Org code #+begin_src org :exports code ,#+begin_verbatim ,verbatim d i s p l a y s with spaces! ,#+end_verbatim #+end_src HERE, THE META LINE IS CONVERTED INTO ITS LATEX FORM. - And its translation into LaTeX: #+begin_src latex :exports code \begin{verbatim} verbatim d i s p l a y s with spaces! \end{verbatim} #+end_src * Comment It is also impossible to show how to type a comment block: #+begin_src org :exports code #+begin_comment Paragraph which will not appear in resulting PDF. #+end_comment #+end_src THE ABOVE NEVER IS SHOWN! --8<---------------cut here---------------end--------------->8--- Best regards, Seb -- Sebastien Vauban