emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: ko@htlwrn.ac.at, nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Bug: export failed when using footnotes inside src blocks [7.7]
Date: Sat, 30 Jul 2011 05:58:23 -0400	[thread overview]
Message-ID: <8571.1312019903@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Jambunathan K <kjambunathan@gmail.com> of "Sat\, 30 Jul 2011 14\:49\:41 +0530." <81tya4unv6.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

Jambunathan K <kjambunathan@gmail.com> wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
> 
> > Günter Kolousek <ko@htlwrn.ac.at> wrote:
> >
> >> 
> >> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
> >> during export using orgmode 7.7 and tip.
> >> 
> >> Günter
> >> 
> >> ...
> >> 
> >> * Test
> >>   foo
> >>   #+begin_src python
> >>   lst = [-1, -2, 2, -3, -4]
> >> 
> >>   for x in lst[:]:
> >>       if x < 0:
> >>           lst.remove(x)
> >> 
> >>   print(lst) # [2] <- does not work!
> >>   #+end_src
> >> 
> 
> This should set the thing to rest.
> 

Acctually, no: I took the OP's request (and I presume I misled you into
thinking that too) as a functionality request, but I didn't read it
carefully enough.  I think he is complaining about getting an error (see
the attached backtrace).

Nick


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: backtrace --]
[-- Type: text/x-lisp, Size: 39789 bytes --]

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("ORG-LIST-END-MARKER\\'" nil)
  (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " ")
  (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))
  (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " ")))
  (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (mapcar (lambda (e) (cdr e)) org-export-footnotes-seen))))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (org-export-latex-protect-string (format "\\footnotemark[%s]" lbl)) (push lbl org-export-latex-footmark-seen) (concat (org-export-latex-protect-string "\\footnote{") def (org-export-latex-protect-string "}")))) (sep (org-export-latex-protect-string (if (save-excursion (goto-char ...) (let ... ...)) org-export-latex-footnote-separator "")))) (when (org-on-heading-p) (setq fnote (concat (org-export-latex-protect-string "\\protect") fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep))))
  (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (mapcar (lambda ... ...) org-export-footnotes-seen))))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (org-export-latex-protect-string (format "\\footnotemark[%s]" lbl)) (push lbl org-export-latex-footmark-seen) (concat (org-export-latex-protect-string "\\footnote{") def (org-export-latex-protect-string "}")))) (sep (org-export-latex-protect-string (if (save-excursion ... ...) org-export-latex-footnote-separator "")))) (when (org-on-heading-p) (setq fnote (concat (org-export-latex-protect-string "\\protect") fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep)))))
  (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (mapcar ... org-export-footnotes-seen))))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (org-export-latex-protect-string ...) (push lbl org-export-latex-footmark-seen) (concat ... def ...))) (sep (org-export-latex-protect-string (if ... org-export-latex-footnote-separator "")))) (when (org-on-heading-p) (setq fnote (concat (org-export-latex-protect-string "\\protect") fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep))))))
  (progn (goto-char (point-min)) (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc ... ...)))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if ... ... ... ...)) (sep (org-export-latex-protect-string ...))) (when (org-on-heading-p) (setq fnote (concat ... fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep)))))))
  (if (plist-get parameters :footnotes) (progn (goto-char (point-min)) (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 ...))) (setq def (concat def (if ... "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote ...) (sep ...)) (when (org-on-heading-p) (setq fnote ...)) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep))))))))
  (when (plist-get parameters :footnotes) (goto-char (point-min)) (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc ... ...)))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if ... ... ... ...)) (sep (org-export-latex-protect-string ...))) (when (org-on-heading-p) (setq fnote (concat ... fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep)))))))
  org-export-latex-preprocess((:emph-multiline t :for-backend latex :comments nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil))
  funcall(org-export-latex-preprocess (:emph-multiline t :for-backend latex :comments nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil))
  (let* ((backend-name (symbol-name org-export-current-backend)) (f (intern (format "org-export-%s-preprocess" backend-name)))) (require (intern (concat "org-" backend-name)) nil) (funcall f parameters))
  (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...)
  (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...)
  (let* ((org-export-current-backend (or (plist-get parameters :for-backend) org-export-current-backend)) (archived-trees (plist-get parameters :archived-trees)) (inhibit-read-only t) (drawers org-drawers) (source-buffer (current-buffer)) target-alist rtn) (setq org-export-target-aliases nil org-export-preferred-target-alist nil org-export-id-target-alist nil org-export-code-refs nil) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) rtn)
  org-export-preprocess-string(#("#+LaTeX_CLASS: beamer\n#+LaTeX_CLASS_OPTIONS: [presentation]\n#+BEAMER_FRAME_LEVEL: 2\n#+BEAMER_HEADER_EXTRA:\n\\usetheme{boxes}\\addheadbox{structure}{\\tiny\\quad\\insertsection\\qquad\\insertsubsection\\hfill\\insertpagenumber\\quad}\\useinnertheme{rectangles}\\usecolortheme[RGB={0,118,190}]{structure}\\usefonttheme{structurebold}\n#+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)\n#+LANGUAGE: de\n#+OPTIONS:   H:1 num:t toc:t \\n:nil @:t ::t |:t ^:t -:t f:t *:t <:t\n#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc\n\n#+LATEX_HEADER: \\setbeamertemplate{navigation symbols}{}\n#+LATEX_HEADER: \\usepackage{palatino}\n#+LATEX_HEADER: \\usepackage{xspace}\n#+LATEX_HEADER: \\usepackage[ngerman]{babel}\n\n\\shorthandoff{\"}\n\n* Test\n  foo\n\n#+begin_src python\n  lst = [-1, -2, 2, -3, -4]\n\n  for x in lst[:]:\n      if x < 0:\n          lst.remove(x)\n\n  print(lst) # [2]\n#+end_src\n" 0 21 (fontified nil font-lock-fontified t org-category "foo") 21 22 (fontified nil font-lock-fontified t org-category "foo") 22 59 (fontified nil font-lock-fontified t org-category "foo") 59 60 (fontified nil font-lock-fontified t org-category "foo") 60 83 (fontified nil font-lock-fontified t org-category "foo") 83 84 (fontified nil font-lock-fontified t org-category "foo") 84 106 (fontified nil font-lock-fontified t org-category "foo") 106 107 (fontified nil font-lock-fontified t org-category "foo") 107 319 (fontified nil org-category "foo" :org-license-to-kill t) 319 417 (fontified nil font-lock-fontified t org-category "foo") 417 418 (fontified nil font-lock-fontified t org-category "foo") 418 432 (fontified nil font-lock-fontified t org-category "foo") 432 433 (fontified nil font-lock-fontified t org-category "foo") 433 500 (fontified nil font-lock-fontified t org-category "foo") 500 501 (fontified nil font-lock-fontified t org-category "foo") 501 573 (fontified nil font-lock-fontified t org-category "foo") 573 574 (fontified nil font-lock-fontified t org-category "foo") 574 575 (fontified nil org-category "foo" :org-license-to-kill t) 575 631 (fontified nil font-lock-fontified t org-category "foo") 631 632 (fontified nil font-lock-fontified t org-category "foo") 632 669 (fontified nil font-lock-fontified t org-category "foo") 669 670 (fontified nil font-lock-fontified t org-category "foo") 670 705 (fontified nil font-lock-fontified t org-category "foo") 705 706 (fontified nil font-lock-fontified t org-category "foo") 706 749 (fontified nil font-lock-fontified t org-category "foo") 749 750 (fontified nil font-lock-fontified t org-category "foo") 750 768 (fontified nil org-category "foo" :org-license-to-kill t) 768 769 (fontified nil org-category "foo") 769 771 (fontified nil org-category "foo" org-props (("CATEGORY"))) 771 775 (fontified nil org-category "foo" org-props (("CATEGORY"))) 775 776 (fontified nil org-category "foo") 776 783 (fontified nil org-category "foo") 783 801 (fontified nil font-lock-fontified t org-category "foo") 801 802 (fontified nil font-lock-fontified t org-category "foo") 802 909 (fontified nil font-lock-fontified t org-category "foo") 909 910 (fontified nil font-lock-fontified t org-category "foo") 910 919 (fontified nil font-lock-fontified t org-category "foo") 919 920 (fontified nil rear-nonsticky t org-category "foo")) :emph-multiline t :for-backend latex :comments nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil)
  (let* ((wcf (current-window-configuration)) (opt-plist (org-export-process-option-filters org-export-latex-options-plist)) (region-p (org-region-active-p)) (rbeg (and region-p (region-beginning))) (rend (and region-p (region-end))) (subtree-p (if (plist-get opt-plist :ignore-subtree-p) nil (when region-p (save-excursion (goto-char rbeg) (and (org-at-heading-p) (>= ... rend)))))) (opt-plist (setq org-export-opt-plist (if subtree-p (org-export-add-subtree-options opt-plist rbeg) opt-plist))) (org-export-latex-options-plist (setq org-export-opt-plist opt-plist)) (org-current-export-dir (or pub-dir (org-export-directory :html opt-plist))) (org-current-export-file buffer-file-name) (title (or (and subtree-p (org-export-get-title-from-subtree)) (plist-get opt-plist :title) (and (not (plist-get opt-plist :skip-before-1st-heading)) (org-export-grab-title-from-buffer)) (and buffer-file-name (file-name-sans-extension (file-name-nondirectory buffer-file-name))) "No Title")) (filename (and (not to-buffer) (concat (file-name-as-directory (or pub-dir (org-export-directory :LaTeX ext-plist))) (file-name-sans-extension (or (and subtree-p ...) (file-name-nondirectory ...))) ".tex"))) (filename (and filename (if (equal (file-truename filename) (file-truename (or buffer-file-name "dummy.org"))) (concat filename ".tex") filename))) (buffer (if to-buffer (cond ((eq to-buffer (quote string)) (get-buffer-create "*Org LaTeX Export*")) (t (get-buffer-create to-buffer))) (find-file-noselect filename))) (odd org-odd-levels-only) (header (org-export-latex-make-header title opt-plist)) (skip (cond (subtree-p nil) (region-p nil) (t (plist-get opt-plist :skip-before-1st-heading)))) (text (plist-get opt-plist :text)) (org-export-preprocess-hook (cons (\` (lambda nil (org-set-local (quote org-complex-heading-regexp) (\, org-export-latex-complex-heading-re)))) org-export-preprocess-hook)) (first-lines (if skip "" (org-export-latex-first-lines opt-plist (if subtree-p (save-excursion (goto-char rbeg) (point-at-bol 2)) rbeg) (if region-p rend)))) (coding-system (and (boundp (quote buffer-file-coding-system)) buffer-file-coding-system)) (coding-system-for-write (or org-export-latex-coding-system coding-system)) (save-buffer-coding-system (or org-export-latex-coding-system coding-system)) (region (buffer-substring (if region-p (region-beginning) (point-min)) (if region-p (region-end) (point-max)))) (text (and text (string-match "\\S-" text) (org-export-preprocess-string text :emph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text nil :skip-before-1st-heading skip :select-tags nil :exclude-tags nil :LaTeX-fragments nil))) (string-for-export (org-export-preprocess-string region :emph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text (if (eq to-buffer (quote string)) nil text) :skip-before-1st-heading skip :select-tags (plist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude-tags) :LaTeX-fragments nil))) (set-buffer buffer) (erase-buffer) (org-install-letbind) (and (fboundp (quote set-buffer-file-coding-system)) (set-buffer-file-coding-system coding-system-for-write)) (unless (or (eq to-buffer (quote string)) body-only) (insert header)) (when (and text (not (eq to-buffer (quote string)))) (insert (org-export-latex-content text (quote (lists tables fixed-width keywords))) "\n\n")) (unless (or skip (string-match "^\\*" first-lines)) (insert first-lines)) (org-export-latex-global (with-temp-buffer (insert string-for-export) (goto-char (point-min)) (when (re-search-forward "^\\(\\*+\\) " nil t) (let* ((asters (length ...)) (level (if odd ... ...))) (setq org-export-latex-add-level (if odd (1- ...) (1- asters))) (org-export-latex-parse-global level odd))))) (unless body-only (insert "\n\\end{document}")) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\([ 	]+\\)\\[" nil t) (delete-region (match-beginning 1) (match-end 1))) (goto-char (point-min)) (when (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (goto-char (point-min)) (while (re-search-forward "\\\\tableofcontents\\>[ 	]*\n?" nil t) (replace-match "")) (goto-char (point-min)) (and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (replace-match "\\tableofcontents" t t))) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\>.*\\(\\\\\\\\\\)[ 	]*\\(\n\\\\label.*\\)*\n\\\\begin" nil t) (delete-region (match-beginning 1) (match-end 1))) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\>.*\\(\\\\\\\\\\)[ 	]*\\(\n\\\\label.*\\)*" nil t) (if (looking-at "[\n 	]+") (replace-match "\n"))) (run-hooks (quote org-export-latex-final-hook)) (if to-buffer (unless (eq major-mode (quote latex-mode)) (latex-mode)) (save-buffer)) (org-export-latex-fix-inputenc) (run-hooks (quote org-export-latex-after-save-hook)) (goto-char (point-min)) (or (org-export-push-to-kill-ring "LaTeX") (message "Exporting to LaTeX...done")) (prog1 (if (eq to-buffer (quote string)) (prog1 (buffer-substring (point-min) (point-max)) (kill-buffer (current-buffer))) (current-buffer)) (set-window-configuration wcf)))
  org-export-as-latex(nil)
  call-interactively(org-export-as-latex)
  (if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not (org-region-active-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory (buffer-file-name))) "*Org Processes*" (expand-file-name invocation-name invocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p (quote org-export-process-sentinel)) (message "Background process \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activate-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let ((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char cpos) (deactivate-mark) (select-window cw))))
  (let* ((bg (org-xor (equal arg (quote (16))) org-export-run-in-background)) (subtree-p (or (org-region-active-p) (eq org-export-initial-scope (quote subtree)))) (help "[t]   insert the export option template\n[v]   limit export to visible part of outline tree\n[1]   switch buffer/subtree export\n[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)\n\n[a/n/u] export as ASCII/Latin-1/UTF-8         [A/N/U] to temporary buffer\n\n[h] export as HTML      [H] to temporary buffer   [R] export region\n[b] export as HTML and open in browser\n\n[l] export as LaTeX     [L] to temporary buffer\n[p] export as LaTeX and process to PDF            [d] ... and open PDF file\n\n[D] export as DocBook   [V] export as DocBook, process to PDF, and open\n\n[o] export as OpenDocumentText                    [O] ... and open\n\n[j] export as TaskJuggler                         [J] ... and open\n\n[m] export as Freemind mind map\n[x] export as XOXO\n[g] export using Wes Hardaker's generic exporter\n\n[i] export current file as iCalendar file\n[I] export all agenda files as iCalendar files   [c] ...as one combined file\n\n[F] publish current file          [P] publish current project\n[X] publish a project...          [E] publish every projects") (cmds (quote ((116 org-insert-export-options-template nil) (118 org-export-visible nil) (97 org-export-as-ascii t) (65 org-export-as-ascii-to-buffer t) (110 org-export-as-latin1 t) (78 org-export-as-latin1-to-buffer t) (117 org-export-as-utf8 t) (85 org-export-as-utf8-to-buffer t) (104 org-export-as-html t) (98 org-export-as-html-and-open t) (72 org-export-as-html-to-buffer nil) (82 org-export-region-as-html nil) (120 org-export-as-xoxo t) (103 org-export-generic t) (68 org-export-as-docbook t) (86 org-export-as-docbook-pdf-and-open t) (111 org-export-as-odt t) (79 org-export-as-odt-and-open t) (106 org-export-as-taskjuggler t) (74 org-export-as-taskjuggler-and-open t) (109 org-export-as-freemind t) (108 org-export-as-latex t) (112 org-export-as-pdf t) (100 org-export-as-pdf-and-open t) (76 org-export-as-latex-to-buffer nil) (105 org-export-icalendar-this-file t) (73 org-export-icalendar-all-agenda-files t) (99 org-export-icalendar-combine-agenda-files t) (70 org-publish-current-file t) (80 org-publish-current-project t) (88 org-publish t) (69 org-publish-all t)))) r1 r2 ass (cpos (point)) (cbuf (current-buffer)) bpos) (save-excursion (save-window-excursion (if subtree-p (message "Export subtree: ") (message "Export buffer: ")) (delete-other-windows) (with-output-to-temp-buffer "*Org Export/Publishing Help*" (princ help)) (org-fit-window-to-buffer (get-buffer-window "*Org Export/Publishing Help*")) (while (eq (setq r1 (read-char-exclusive)) 49) (cond (subtree-p (setq subtree-p nil) (message "Export buffer: ")) ((not subtree-p) (setq subtree-p t) (message "Export subtree: ")))) (when (eq r1 32) (let ((case-fold-search t) (end (save-excursion ... ...))) (outline-next-heading) (if (re-search-backward "^[ 	]+\\(:latex_class:\\|:export_title:\\|:export_file_name:\\)[ 	]+\\S-" end t) (progn (org-back-to-heading t) (setq subtree-p t) (setq bpos ...) (message "Select command (for subtree): ") (setq r1 ...)) (error "No enclosing node with LaTeX_CLASS or EXPORT_TITLE or EXPORT_FILE_NAME")))))) (redisplay) (and bpos (goto-char bpos)) (setq r2 (if (< r1 27) (+ r1 96) r1)) (unless (setq ass (assq r2 cmds)) (error "No command associated with key %c" r1)) (if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not (org-region-active-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory ...)) "*Org Processes*" (expand-file-name invocation-name invocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p (quote org-export-process-sentinel)) (message "Background process \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activate-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let ((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char cpos) (deactivate-mark) (select-window cw)))))
  org-export(nil)
  call-interactively(org-export nil nil)

[-- Attachment #3: Type: text/plain, Size: 552 bytes --]


> ,----[ C-h v org-footnote-forbidden-blocks RET ]
> | org-footnote-forbidden-blocks is a variable defined in `org-footnote.el'.
> | Its value is
> | ("example" "verse" "src" "ascii" "beamer" "docbook" "html" "latex" "odt")
> | 
> | 
> | Documentation:
> | Names of blocks where footnotes are not allowed.
> | 
> | [back]
> `----
> 
> OP can search for for alternative ways to reference code block lines in
> the following section of the manual
> http://orgmode.org/org.html#Literal-examples
> 
> (Hint: Search for ref:jump)
> 
> 
> Jambunathan K.
> 

  reply	other threads:[~2011-07-30  9:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-30  8:22 Bug: export failed when using footnotes inside src blocks [7.7] Günter Kolousek
2011-07-30  9:00 ` Nick Dokos
2011-07-30  9:19   ` Jambunathan K
2011-07-30  9:58     ` Nick Dokos [this message]
2011-07-30 10:53       ` Jambunathan K
2011-07-30 10:45 ` Nicolas Goaziou
2011-07-30 14:34   ` Günter Kolousek
2011-07-31 18:41   ` Achim Gratz
2011-07-31 19:12     ` Jambunathan K
2011-08-14 16:29       ` Bastien
2011-08-14 16:25     ` Bastien
2011-08-14 16:54       ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8571.1312019903@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kjambunathan@gmail.com \
    --cc=ko@htlwrn.ac.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).