At Thu, 21 Mar 2013 20:26:34 +0100, Nicolas Goaziou wrote: > > Hello, > > Rick Frankel <r...@rickster.com> 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