From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug formatting source code in new latex exporter Date: Thu, 21 Mar 2013 20:26:34 +0100 Message-ID: <87wqt0sget.fsf@gmail.com> References: <20130319211125.GA54083@BigDog.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIl8O-00058S-1p for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 15:26:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIl8M-0007CP-Jv for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 15:26:43 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:42980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIl8M-0007CB-Cz for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 15:26:42 -0400 Received: by mail-wi0-f173.google.com with SMTP id hq4so6991936wib.12 for ; Thu, 21 Mar 2013 12:26:41 -0700 (PDT) In-Reply-To: <20130319211125.GA54083@BigDog.local> (Rick Frankel's message of "Tue, 19 Mar 2013 17:11:25 -0400") 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 Hello, Rick Frankel writes: > 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: > > (when (or label caption) > > should probably be: > > (when caption > > > An example document is below. This is a limitation from floats. But wrapping code within a listings environment is, IMO, the right thing to do, otherwise, cross-references will not work. A hack around this would be to drop the environment when source code exceeds 30 lines, but that's cheesy for sure. Or, maybe, drop the environment when there's only the label, but only when there is no cross-reference pointing to the src-block within the whole parse-tree. Regards, -- Nicolas Goaziou