From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph LANGE Subject: Re: [export] Beamer frames containing lstlisting are no longer made fragile Date: Sat, 05 Oct 2013 15:20:08 +0100 Message-ID: <52502018.9080103@gmail.com> References: <52330AAE.9070000@gmail.com> <87r4csohz9.fsf@gmail.com> <52346F37.3010803@gmail.com> <877gej4gne.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSSiD-0006xQ-3B for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 10:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSSi7-00014Q-5o for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 10:20:04 -0400 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:49772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSSi6-00014H-Uq for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 10:19:59 -0400 Received: by mail-we0-f176.google.com with SMTP id w62so3380942wes.35 for ; Sat, 05 Oct 2013 07:19:57 -0700 (PDT) In-Reply-To: <877gej4gne.fsf@gmail.com> 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Orgmode Mailing List Hi Nicolas, I'm sorry I hadn't got back to this email – didn't notice it because of a filtering mistake on my side. 2013-09-14 15:33 Nicolas Goaziou: > Christoph LANGE writes: >> Still I think the following sentence in the documentation (section 12.5) >> is easy to misunderstand: >> >> "`fragile' option is added automatically if it contains source code that >> uses any verbatim environment". > > What would you suggest instead? Let me see; I'd first have to understand how this mechanism works. I do not think it works in the same was as the old exporter worked. I.e. I think the new mechanism does not automatically add [fragile] on, e.g., encountering the following: #+LATEX: \begin{lstlisting} #+LATEX: ... #+LATEX: \end{lstlisting} >> I think it means that when I use a proper "source block" using >> #+BEGIN_SRC, the exporter automatically sets the [fragile] option as >> needed. > > It isn't just about source blocks, see `org-beamer-verbatim-elements'. OK, I had checked this variable before, but I don't understand it. The documentation says "List of element or object types producing verbatim text". I presume "elements" and "objects" refer to things in Org-mode, from which LaTeX is only generated later in the export process. And as the only thing ("element" or "object"?) on the Org-mode side that generates {lstlisting} environments is a SRC-BLOCK, there is probably no way of teaching the exporter the pre-Org-8.0 behaviour explained above, i.e. enabling [fragile] on encountering \begin{lstlisting}. >> Anyway, you told me how to make my legacy {lstlisting} environments >> work. Is this approach, of manually setting "BEAMER_OPT: fragile" the >> preferred way whenever you have a listing in a non-standard language, >> where the {lstlisting} environment requires special arguments (e.g. >> "morekeywords")? Or is there some way of passing extra arguments into >> the {lstlisting} environment that is created from #+BEGIN_SRC? > > At the moment, the only way to pass extra arguments to lstlisting is > using `org-latex-listings-options'. IOW, it isn't possible to set > specific options for a given block. > > Though, it should be fairly easy to implement an :extra attribute for > source blocks. E.g., > > #+attr_latex: :extra key1=val1,key2=val2 > #+begin_src > ... > #+end_src Such a feature would of course be nice to have. But it doesn't have the highest priority for me, as I managed to reuse my existing #+LATEX: \begin{lstlisting} code, and as I'm not currently planning to export these Org files to anything else but LaTeX-Beamer. Cheers, Christoph -- Christoph Lange, School of Computer Science, University of Birmingham http://cs.bham.ac.uk/~langec/, Skype duke4701 → Mathematics in Computer Science Special Issue on “Enabling Domain Experts to use Formalised Reasoning”; submission until 31 October. http://cs.bham.ac.uk/research/projects/formare/pubs/mcs-doform/