From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Bug: export failed when using footnotes inside src blocks [7.7] Date: Sat, 30 Jul 2011 05:58:23 -0400 Message-ID: <8571.1312019903@alphaville.dokosmarshall.org> References: <4E33BF33.2050508@htlwrn.ac.at> <7790.1312016444@alphaville.dokosmarshall.org> <81tya4unv6.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn6JV-0003UB-Sr for emacs-orgmode@gnu.org; Sat, 30 Jul 2011 05:58:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qn6JR-0000LK-Bt for emacs-orgmode@gnu.org; Sat, 30 Jul 2011 05:58:33 -0400 Received: from g6t0184.atlanta.hp.com ([15.193.32.61]:3430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn6JR-0000KT-3b for emacs-orgmode@gnu.org; Sat, 30 Jul 2011 05:58:29 -0400 In-Reply-To: Message from Jambunathan K of "Sat\, 30 Jul 2011 14\:49\:41 +0530." <81tya4unv6.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: Jambunathan K Cc: ko@htlwrn.ac.at, nicholas.dokos@hp.com, emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jambunathan K wrote: > Nick Dokos writes: >=20 > > G=C3=BCnter Kolousek wrote: > > > >>=20 > >> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors > >> during export using orgmode 7.7 and tip. > >>=20 > >> G=C3=BCnter > >>=20 > >> ... > >>=20 > >> * Test > >> foo > >> #+begin_src python > >> lst =3D [-1, -2, 2, -3, -4] > >>=20 > >> for x in lst[:]: > >> if x < 0: > >> lst.remove(x) > >>=20 > >> print(lst) # [2] <- does not work! > >> #+end_src > >>=20 >=20 > This should set the thing to rest. >=20 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 --=-=-= Content-Type: text/x-lisp Content-Disposition: attachment; filename=foo.bt Content-Transfer-Encoding: quoted-printable Content-Description: backtrace 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-nu= mber 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-ex= port-latex-footmark-seen) (org-export-latex-protect-string (format "\\footn= otemark[%s]" lbl)) (push lbl org-export-latex-footmark-seen) (concat (org-e= xport-latex-protect-string "\\footnote{") def (org-export-latex-protect-str= ing "}")))) (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-inde= ntation) 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 re= f)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (mapcar (lamb= da ... ...) org-export-footnotes-seen))))) (setq def (concat def (if (strin= g-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-defi= nitions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (= org-export-latex-protect-string (format "\\footnotemark[%s]" lbl)) (push lb= l org-export-latex-footmark-seen) (concat (org-export-latex-protect-string = "\\footnote{") def (org-export-latex-protect-string "}")))) (sep (org-expor= t-latex-protect-string (if (save-excursion ... ...) org-export-latex-footno= te-separator "")))) (when (org-on-heading-p) (setq fnote (concat (org-expor= t-latex-protect-string "\\protect") fnote))) (put-text-property 0 (length f= note) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-regi= on beg (nth 2 ref)) (save-excursion (insert fnote sep))))) (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((be= g (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (m= apcar ... org-export-footnotes-seen))))) (setq def (concat def (if (string-= match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-defini= tions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (or= g-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-p= roperty 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-cha= r 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-MAR= KER\\'" 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 (le= ngth fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delet= e-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-reg= ion 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 re= f)) (lbl (car ref)) (def (nth 1 (assoc ... ...)))) (setq def (concat def (i= f (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-del= ete-definitions lbl) (let ((fnote (if ... ... ... ...)) (sep (org-export-la= tex-protect-string ...))) (when (org-on-heading-p) (setq fnote (concat ... = fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1= 000 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 :commen= ts nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :tod= o-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-ta= gs ("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 :timestamp= s t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :s= elect-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 (conc= at "org-" backend-name)) nil) (funcall f parameters)) (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((in= hibit-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 sourc= e-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote o= rg-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) (or= g-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-ex= port-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameter= s :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-lis= t-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-pr= eprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mar= k-list-properties) (org-export-replace-src-segments-and-examples) (org-expo= rt-protect-colon-examples) (org-export-convert-protected-spaces) (setq targ= et-alist (org-export-define-heading-targets target-alist)) (run-hooks (quot= e org-export-preprocess-after-headline-targets-hook)) (org-export-remember-= html-container-classes) (org-export-remove-or-extract-drawers drawers (plis= t-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-he= ading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[= ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (poi= nt-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char = (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-re= move-headline-metadata parameters) (setq target-alist (org-export-handle-in= visible-targets target-alist)) (run-hooks (quote org-export-preprocess-befo= re-selecting-backend-code-hook)) (org-export-select-backend-specific-text) = (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-e= xport-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hook= s (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get p= arameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (= org-export-attach-captions-and-attributes target-alist)) (org-export-mark-r= adio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hoo= k)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-p= reprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-sea= rch t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (po= int-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) (ru= n-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-ma= x)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-= preprocess-after-include-files-hook)) (org-export-remove-archived-trees arc= hived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-ha= ndle-export-tags (plist-get parameters :select-tags) (plist-get parameters = :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selectio= n-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (pli= st-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org= -export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quo= te org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess)= (org-export-mark-list-properties) (org-export-replace-src-segments-and-exa= mples) (org-export-protect-colon-examples) (org-export-convert-protected-sp= aces) (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-drawe= rs drawers (plist-get parameters :drawers)) (when (plist-get parameters :sk= ip-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-t= ext) (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-clo= ck-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-c= enter) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unl= ess (plist-get parameters :timestamps) (org-export-remove-timestamps)) (set= q target-alist (org-export-attach-captions-and-attributes target-alist)) (o= rg-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-r= adio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (qu= ote org-export-preprocess-before-normalizing-links-hook)) (org-export-norma= lize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (era= se-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-on= ly t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)= ))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mod= e)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\= (org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-pre= process-hook)) (untabify (point-min) (point-max)) (org-export-handle-includ= e-files-recurse) (run-hooks (quote org-export-preprocess-after-include-file= s-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remo= ve-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get p= arameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (q= uote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-t= asks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes)= (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-e= xport-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-afte= r-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-proper= ties) (org-export-replace-src-segments-and-examples) (org-export-protect-co= lon-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-containe= r-classes) (org-export-remove-or-extract-drawers drawers (plist-get paramet= ers :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)) (ins= ert "\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-targe= ts target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-= backend-code-hook)) (org-export-select-backend-specific-text) (org-export-p= rotect-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 :ti= mestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-at= tach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (= run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-expo= rt-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-bef= ore-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) (i= nsert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remov= e-text-properties (point-min) (point-max) (quote (read-only t)))) (org-expo= rt-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq cas= e-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtb= l-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)= ) (untabify (point-min) (point-max)) (org-export-handle-include-files-recur= se) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org= -export-remove-archived-trees archived-trees) (org-export-remove-comment-bl= ocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :se= lect-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-expo= rt-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-g= et parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnot= e-normalize nil parameters)) (org-export-mark-list-end) (org-export-preproc= ess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook= )) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-ex= port-replace-src-segments-and-examples) (org-export-protect-colon-examples)= (org-export-convert-protected-spaces) (setq target-alist (org-export-defin= e-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-af= ter-headline-targets-hook)) (org-export-remember-html-container-classes) (o= rg-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)= ) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-m= in)) (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 (plis= t-get parameters :add-text) "\n")) (org-export-remove-headline-metadata par= ameters) (setq target-alist (org-export-handle-invisible-targets target-ali= st)) (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) (o= rg-export-mark-blockquote-verse-center) (run-hooks (quote org-export-prepro= cess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (or= g-export-remove-timestamps)) (setq target-alist (org-export-attach-captions= -and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (qu= ote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenat= e-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizi= ng-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-bu= ffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer= temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq ca= se-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (poi= nt-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-l= etbind) (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-archive= d-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (or= g-export-handle-export-tags (plist-get parameters :select-tags) (plist-get = parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tr= ee-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks))= (when (plist-get parameters :footnotes) (org-footnote-normalize nil parame= ters)) (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-segme= nts-and-examples) (org-export-protect-colon-examples) (org-export-convert-p= rotected-spaces) (setq target-alist (org-export-define-heading-targets targ= et-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-h= ook)) (org-export-remember-html-container-classes) (org-export-remove-or-ex= tract-drawers drawers (plist-get parameters :drawers)) (when (plist-get par= ameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-= forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-be= ginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parame= ters :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-sel= ect-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export= -remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockqu= ote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-= hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timest= amps)) (setq target-alist (org-export-attach-captions-and-attributes target= -alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preproc= ess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (ru= n-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-e= xport-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer tem= p-buffer))))) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t= ) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-m= ax) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhi= bit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-vari= ables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hoo= ks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (= org-export-handle-include-files-recurse) (run-hooks (quote org-export-prepr= ocess-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 :excl= ude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hoo= k)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-ge= t parameters :footnotes) (org-footnote-normalize nil parameters)) (org-expo= rt-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote or= g-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-expor= t-remember-html-container-classes) (org-export-remove-or-extract-drawers dr= awers (plist-get parameters :drawers)) (when (plist-get parameters :skip-be= fore-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*= \n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (got= o-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) = (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (or= g-export-remove-headline-metadata parameters) (setq target-alist (org-expor= t-handle-invisible-targets target-alist)) (run-hooks (quote org-export-prep= rocess-before-selecting-backend-code-hook)) (org-export-select-backend-spec= ific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-li= nes) (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 tar= get-alist (org-export-attach-captions-and-attributes target-alist)) (org-ex= port-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-= targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote o= rg-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 :archi= ved-trees)) (inhibit-read-only t) (drawers org-drawers) (source-buffer (cur= rent-buffer)) target-alist rtn) (setq org-export-target-aliases nil org-exp= ort-preferred-target-alist nil org-export-id-target-alist nil org-export-co= de-refs nil) (with-temp-buffer (erase-buffer) (insert string) (setq case-fo= ld-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-mi= n) (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-letbin= d) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (po= int-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-e= xport-preprocess-after-include-files-hook)) (org-export-remove-archived-tre= es archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-exp= ort-handle-export-tags (plist-get parameters :select-tags) (plist-get param= eters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-se= lection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (whe= n (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)= ) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hook= s (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-prepr= ocess) (org-export-mark-list-properties) (org-export-replace-src-segments-a= nd-examples) (org-export-protect-colon-examples) (org-export-convert-protec= ted-spaces) (setq target-alist (org-export-define-heading-targets target-al= ist)) (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 paramete= rs :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forwa= rd "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginni= ng 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-b= ackend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remo= ve-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-v= erse-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-alis= t)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-a= fter-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hoo= ks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export= -normalize-links) ...) rtn) org-export-preprocess-string(#("#+LaTeX_CLASS: beamer\n#+LaTeX_CLASS_OPTI= ONS: [presentation]\n#+BEAMER_FRAME_LEVEL: 2\n#+BEAMER_HEADER_EXTRA:\n\\use= theme{boxes}\\addheadbox{structure}{\\tiny\\quad\\insertsection\\qquad\\ins= ertsubsection\\hfill\\insertpagenumber\\quad}\\useinnertheme{rectangles}\\u= secolortheme[RGB=3D{0,118,190}]{structure}\\usefonttheme{structurebold}\n#+= COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Co= l) %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{navi= gation symbols}{}\n#+LATEX_HEADER: \\usepackage{palatino}\n#+LATEX_HEADER: = \\usepackage{xspace}\n#+LATEX_HEADER: \\usepackage[ngerman]{babel}\n\n\\sho= rthandoff{\"}\n\n* Test\n foo\n\n#+begin_src python\n lst =3D [-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-categor= y "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 (fontifie= d nil font-lock-fontified t org-category "foo") 83 84 (fontified nil font-l= ock-fontified t org-category "foo") 84 106 (fontified nil font-lock-fontifi= ed t org-category "foo") 106 107 (fontified nil font-lock-fontified t org-c= ategory "foo") 107 319 (fontified nil org-category "foo" :org-license-to-ki= ll 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 (fonti= fied nil font-lock-fontified t org-category "foo") 432 433 (fontified nil f= ont-lock-fontified t org-category "foo") 433 500 (fontified nil font-lock-f= ontified t org-category "foo") 500 501 (fontified nil font-lock-fontified t= org-category "foo") 501 573 (fontified nil font-lock-fontified t org-categ= ory "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-fonti= fied 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 (font= ified 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 (("CATEGO= RY"))) 775 776 (fontified nil org-category "foo") 776 783 (fontified nil or= g-category "foo") 783 801 (fontified nil font-lock-fontified t org-category= "foo") 801 802 (fontified nil font-lock-fontified t org-category "foo") 80= 2 909 (fontified nil font-lock-fontified t org-category "foo") 909 910 (fon= tified nil font-lock-fontified t org-category "foo") 910 919 (fontified nil= font-lock-fontified t org-category "foo") 919 920 (fontified nil rear-nons= ticky 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-proces= s-option-filters org-export-latex-options-plist)) (region-p (org-region-act= ive-p)) (rbeg (and region-p (region-beginning))) (rend (and region-p (regio= n-end))) (subtree-p (if (plist-get opt-plist :ignore-subtree-p) nil (when r= egion-p (save-excursion (goto-char rbeg) (and (org-at-heading-p) (>=3D ... = 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 pu= b-dir (org-export-directory :html opt-plist))) (org-current-export-file buf= fer-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 Ti= tle")) (filename (and (not to-buffer) (concat (file-name-as-directory (or p= ub-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 LaT= eX Export*")) (t (get-buffer-create to-buffer))) (find-file-noselect filena= me))) (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-p= list :skip-before-1st-heading)))) (text (plist-get opt-plist :text)) (org-e= xport-preprocess-hook (cons (\` (lambda nil (org-set-local (quote org-compl= ex-heading-regexp) (\, org-export-latex-complex-heading-re)))) org-export-p= reprocess-hook)) (first-lines (if skip "" (org-export-latex-first-lines opt= -plist (if subtree-p (save-excursion (goto-char rbeg) (point-at-bol 2)) rbe= g) (if region-p rend)))) (coding-system (and (boundp (quote buffer-file-cod= ing-system)) buffer-file-coding-system)) (coding-system-for-write (or org-e= xport-latex-coding-system coding-system)) (save-buffer-coding-system (or or= g-export-latex-coding-system coding-system)) (region (buffer-substring (if = region-p (region-beginning) (point-min)) (if region-p (region-end) (point-m= ax)))) (text (and text (string-match "\\S-" text) (org-export-preprocess-st= ring text :emph-multiline t :for-backend (quote latex) :comments nil :tags = (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :foot= notes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawe= rs) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get= opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text ni= l :skip-before-1st-heading skip :select-tags nil :exclude-tags nil :LaTeX-f= ragments nil))) (string-for-export (org-export-preprocess-string region :em= ph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get op= t-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-= get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestam= ps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :t= odo-keywords) :tasks (plist-get opt-plist :tasks) :add-text (if (eq to-buff= er (quote string)) nil text) :skip-before-1st-heading skip :select-tags (pl= ist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude= -tags) :LaTeX-fragments nil))) (set-buffer buffer) (erase-buffer) (org-inst= all-letbind) (and (fboundp (quote set-buffer-file-coding-system)) (set-buff= er-file-coding-system coding-system-for-write)) (unless (or (eq to-buffer (= quote string)) body-only) (insert header)) (when (and text (not (eq to-buff= er (quote string)))) (insert (org-export-latex-content text (quote (lists t= ables fixed-width keywords))) "\n\n")) (unless (or skip (string-match "^\\*= " first-lines)) (insert first-lines)) (org-export-latex-global (with-temp-b= uffer (insert string-for-export) (goto-char (point-min)) (when (re-search-f= orward "^\\(\\*+\\) " nil t) (let* ((asters (length ...)) (level (if odd ..= . ...))) (setq org-export-latex-add-level (if odd (1- ...) (1- asters))) (o= rg-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-CONTENT= S\\]" nil t) (goto-char (point-min)) (while (re-search-forward "\\\\tableof= contents\\>[ ]*\n?" nil t) (replace-match "")) (goto-char (point-min)) (an= d (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (replace-match "\\tab= leofcontents" 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\\\\l= abel.*\\)*" nil t) (if (looking-at "[\n ]+") (replace-match "\n"))) (run-h= ooks (quote org-export-latex-final-hook)) (if to-buffer (unless (eq major-m= ode (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-activ= e-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory= (buffer-file-name))) "*Org Processes*" (expand-file-name invocation-name i= nvocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-e= xp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nt= h 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-w= indow (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 ex= port 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 buffe= r\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 tem= porary buffer\n[p] export as LaTeX and process to PDF [d] ... an= d open PDF file\n\n[D] export as DocBook [V] export as DocBook, process t= o 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 us= ing 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 combi= ned 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-e= xport-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 o= rg-export-region-as-html nil) (120 org-export-as-xoxo t) (103 org-export-ge= neric t) (68 org-export-as-docbook t) (86 org-export-as-docbook-pdf-and-ope= n t) (111 org-export-as-odt t) (79 org-export-as-odt-and-open t) (106 org-e= xport-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-c= urrent-file t) (80 org-publish-current-project t) (88 org-publish t) (69 or= g-publish-all t)))) r1 r2 ass (cpos (point)) (cbuf (current-buffer)) bpos) = (save-excursion (save-window-excursion (if subtree-p (message "Export subtr= ee: ") (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 (set= q r1 (read-char-exclusive)) 49) (cond (subtree-p (setq subtree-p nil) (mess= age "Export buffer: ")) ((not subtree-p) (setq subtree-p t) (message "Expor= t subtree: ")))) (when (eq r1 32) (let ((case-fold-search t) (end (save-exc= ursion ... ...))) (outline-next-heading) (if (re-search-backward "^[ ]+\\(= :latex_class:\\|:export_title:\\|:export_file_name:\\)[ ]+\\S-" end t) (pr= ogn (org-back-to-heading t) (setq subtree-p t) (setq bpos ...) (message "Se= lect command (for subtree): ") (setq r1 ...)) (error "No enclosing node wit= h LaTeX_CLASS or EXPORT_TITLE or EXPORT_FILE_NAME")))))) (redisplay) (and b= pos (goto-char bpos)) (setq r2 (if (< r1 27) (+ r1 96) r1)) (unless (setq a= ss (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))) (le= t ((p (start-process (concat "Exporting " (file-name-nondirectory ...)) "*O= rg Processes*" (expand-file-name invocation-name invocation-directory) "-ba= tch" "-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 proce= ss \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activa= te-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-win= dow 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) --=-=-= Content-Type: text/plain > ,----[ 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. > --=-=-=--