From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Bug formatting source code in new latex exporter Date: Tue, 19 Mar 2013 16:59:56 -0400 Message-ID: <20130319205956.GA53387@BigDog.local> Mime-Version: 1.0 Content-Type: application/pgp; format=text; x-action=sign Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI3dZ-0008UT-9I for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 17:00:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI3dW-00084U-Sv for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 17:00:01 -0400 Received: from [204.62.15.78] (port=60782 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI3dW-00084J-NI for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 16:59:58 -0400 Received: from BigDog.local (pool-72-89-40-63.nycmny.fios.verizon.net [72.89.40.63]) by mail.rickster.com (Postfix) with ESMTPS id 9531925008 for ; Tue, 19 Mar 2013 16:59:58 -0400 (EDT) Content-Disposition: inline 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: emacs-orgmode@gnu.org There is a bug with ox-latex and long listings. If the listing has a label (name) or caption, it is wrapped in a '\begin{listing}[H]' block. This causes listings longer than one page to be truncated if they have labels, which means you can't have callable code longer than one page (~40 lines for US Letter paper) and print it with minted. The problem is on line 2178 of ox-latex: =20 (when (or label caption) should probably be: =20 (when caption An example document is below. rick --- #+TITLE: Test #+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:{} -:t f:t *:t <:t * Setup and short examples :PROPERTIES: :EXPORTS: code :END: *NOTE:* Run this section to generate the long examples before generating the latex/pdf output. ** latex listing options #+BEGIN_SRC elisp :results silent (setq org-latex-listings 'minted org-latex-minted-options '(("linenos" "true") ("stepnumber" "5") ("numbersep" "0.25em") ("frame" "leftline") ("framerule" "1pt") ("rulecolor" "\\color{framecolor}"))) #+END_SRC ** source w/ no label #+BEGIN_SRC perl :eval never foreach my $i qw(with without) { print join( "\n", sprintf("* Long listing %s label", $i), ($i eq 'with' ? '#+name: long-listing' : ''), "#+BEGIN_SRC perl :exports code", (map { "print '$_'" } 1..60), "#+END_SRC\n", ); } #+END_SRC ** src w/ with label #+name: generate-listing #+BEGIN_SRC perl :results raw foreach my $i qw(with without) { print join( "\n", sprintf("* Long listing %s label", $i), ($i eq 'with' ? '#+name: long-listing' : ''), "#+BEGIN_SRC perl :exports code", (map { "print '$_'" } 1..60), "#+END_SRC\n", ); } #+END_SRC