Hello, Rick Frankel <r...@rickster.com> 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