emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug formatting source code in new latex exporter
@ 2013-03-19 21:11 Rick Frankel
  2013-03-21 19:26 ` Nicolas Goaziou
  0 siblings, 1 reply; 11+ messages in thread
From: Rick Frankel @ 2013-03-19 21:11 UTC (permalink / raw)
  To: emacs-orgmode

Sorry, previous mail seems to have gotten munged, lets' try again.

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.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Bug formatting source code in new latex exporter
@ 2013-03-19 20:59 Rick Frankel
  0 siblings, 0 replies; 11+ messages in thread
From: Rick Frankel @ 2013-03-19 20:59 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: application/pgp, Size: 1841 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-03-27 22:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-19 21:11 Bug formatting source code in new latex exporter Rick Frankel
2013-03-21 19:26 ` Nicolas Goaziou
2013-03-22  0:50   ` Rick Frankel
2013-03-23 21:51     ` Nicolas Goaziou
2013-03-24 23:29       ` Rick Frankel
2013-03-25 21:09         ` Nicolas Goaziou
2013-03-26 12:28           ` Rick Frankel
2013-03-27 14:17             ` Nicolas Goaziou
2013-03-27 22:10               ` Rick Frankel
2013-03-27 22:29                 ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2013-03-19 20:59 Rick Frankel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).