From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Bug formatting source code in new latex exporter Date: Thu, 21 Mar 2013 20:50:57 -0400 Message-ID: References: <20130319211125.GA54083@BigDog.local> <87wqt0sget.fsf@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIqCG-00074q-W6 for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 20:51:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIqCC-0003ji-Vc for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 20:51:04 -0400 Received: from [204.62.15.78] (port=42489 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIqCC-0003jS-SB for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 20:51:00 -0400 In-Reply-To: <87wqt0sget.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: emacs-orgmode@gnu.org At Thu, 21 Mar 2013 20:26:34 +0100, Nicolas Goaziou wrote: > > Hello, > > Rick Frankel writes: > > > The problem is on line 2178 of ox-latex: > > > > (when (or label caption) > > > > should probably be: > > > > (when caption > > > 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. Personally, I generate a lot of long listings (e.g., complex sql statements, where i use babel and org to build up a large query) and not a lot of cross references. > 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. That sounds like the most sophisticated approach. Still, as cheesy as it seems, I think dropping lines of source code is a bigger problem. The cross reference approach seems clever, but maybe a simpler approach would simply be to add an ATTR_LaTeX(:longlisting) and leave it up to the user. Currently, I've hacked my copy of ox-latex as show above (ignore `label' as a float wrapping specifier). rick