emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Crash with LaTeX exporter
@ 2011-04-06  5:00 Jambunathan K
  2011-04-06  9:14 ` Lawrence Mitchell
  2011-04-06  9:27 ` Giovanni Ridolfi
  0 siblings, 2 replies; 4+ messages in thread
From: Jambunathan K @ 2011-04-06  5:00 UTC (permalink / raw)
  To: emacs-orgmode


Exporting the below table to LaTeX throws an error. Let me know if you
need any additional info.

--8<---------------cut here---------------start------------->8---

*** Table.el Table with no Spanning
    +---------------+---------------+
    |Term           |Percentage     |
    +---------------+---------------+
    |Quarter        |25%            |
    |One-Fourth     |               |
    +---------------+---------------+
    |Half           |50%            |
    |One-by-Two     |               |
    +---------------+---------------+
    |Three-Quarters |75%            |
    |Three-Fourths  |               |
    +---------------+---------------+
    |Full           |100%           |
    |Whole          |               |
    +---------------+---------------+
--8<---------------cut here---------------end--------------->8---


Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
  re-search-forward("\\s *\\'" 60 t)
  table--buffer-substring-and-trim(61 60)
  #[(from to) "\306\307\b	B!\307\n	B!\"\310\311!r\fq\210\312\216\vc\210eb\210\313\314\315\316#\203P\317\224\2036\212\317\224b\210\320c\210)\202\0\321\224\203D\322\323\316\211#\210\202\0\322\324\325\326!\324Q!\210\202\0ed{+rq\210\x1e\204o`Sf\327=\203j\330\202k\331\332\261\210\x1f\317V\203\213\333\334\x1f\x1e\203\203\335\202\204\330\v$c\210\202\216\vc\210)\315\x1e\317\x1f !8\211\")\207" [from y to line temp-buffer dest-buffer table--buffer-substring-and-trim table--goto-coordinate generate-new-buffer " *temp*" ((byte-code "\301\b!\203\n\302\b!\210\301\207" [temp-buffer buffer-name kill-buffer] 2)) re-search-forward "\\([#$~_^%{}]\\)\\|\\(\\\\\\)\\|\\([<>|]\\)" nil t 1 "\\" 2 replace-match "$\\backslash$" "$" match-string 3 32 "" " " "& " format "\\multicolumn{%d}{%sl|}{%s}" "|" first-p span i col-list start] 5](21 20)
  table--generate-source-scan-lines(#<buffer *org-export-table*> latex (45 . 60) (466 . 520) (5 21) (2 4 7 10 13))
  table-generate-source(latex "*org-export-table*" "caption")
  (let (tbl caption shortn label line floatp attr align rmlines) (setq line (buffer-substring (point-at-bol) (point-at-eol)) label (org-get-text-property-any 0 (quote org-label) line) caption (org-get-text-property-any 0 (quote org-caption) line) shortn (org-get-text-property-any 0 (quote org-caption-shortn) line) attr (org-get-text-property-any 0 (quote org-attributes) line) align (and attr (stringp attr) (string-match "\\<align=\\([^ 	\n,]+\\)" attr) (match-string 1 attr)) rmlines (and attr (stringp attr) (string-match "\\<rmlines\\>" attr)) floatp (or label caption)) (and (get-buffer "*org-export-table*") (kill-buffer (get-buffer "*org-export-table*"))) (table-generate-source (quote latex) "*org-export-table*" "caption") (setq tbl (with-current-buffer "*org-export-table*" (buffer-string))) (while (string-match "^%.*\n" tbl) (setq tbl (replace-match "" t t tbl))) (when rmlines (let ((n 0) lines) (setq lines (mapcar (lambda (x) (if (string-match "^\\\\hline$" x) (progn ... ...) x)) (org-split-string tbl "\n"))) (setq tbl (mapconcat (quote identity) (delq nil lines) "\n")))) (when (and align (string-match "\\\\begin{tabular}{.*}" tbl)) (setq tbl (replace-match (concat "\\begin{tabular}{" align "}") t t tbl))) (and (get-buffer "*org-export-table*") (kill-buffer (get-buffer "*org-export-table*"))) (beginning-of-line 0) (while (looking-at "[ 	]*\\(|\\|\\+-\\)") (delete-region (point) (1+ (point-at-eol)))) (when org-export-latex-tables-centered (setq tbl (concat "\\begin{center}\n" tbl "\\end{center}"))) (when floatp (setq tbl (concat "\\begin{table}\n" (format "\\caption%s{%s}%s\n" (if shortn (format "[%s]" shortn) "") (if label (format "\\label{%s}" label) "") (or caption "")) tbl "\n\\end{table}\n"))) (insert (org-export-latex-protect-string tbl)))
  org-export-latex-convert-table\.el-table()
  (if (get-text-property (point) (quote org-protected)) nil (require (quote table)) (org-export-latex-convert-table\.el-table))
  (unless (get-text-property (point) (quote org-protected)) (require (quote table)) (org-export-latex-convert-table\.el-table))
  (org-if-unprotected (require (quote table)) (org-export-latex-convert-table\.el-table))
  (while (re-search-forward "^[ 	]*\\(\\+-[-+]*\\+\\)[ 	]*\n[ 	]*|" nil t) (org-if-unprotected (require (quote table)) (org-export-latex-convert-table\.el-table)))
  org-export-latex-tables(t)
  (if (memq (quote tables) exclude-list) nil (org-export-latex-tables (plist-get org-export-latex-options-plist :tables)))
  (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables)))
  (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max)))
  (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max)))
  org-export-latex-content(#("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test")))
  (insert (org-export-latex-content content))
  (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 (quote org-insert-hook) end))) (and (functionp hook) (funcall hook))) (insert end "\n")))
  (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 ... end))) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" (symbol-name org-export-latex-low-levels)))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent)))))))
  (let* ((heading (cdr (assoc (quote heading) subcontent))) (level (- (cdr (assoc (quote level) subcontent)) org-export-latex-add-level)) (occur (number-to-string (cdr (assoc (quote occur) subcontent)))) (content (cdr (assoc (quote content) subcontent))) (subcontent (cadr (assoc (quote subcontent) subcontent))) (label (org-get-text-property-any 0 (quote target) heading)) (label-list (cons label (cdr (assoc label org-export-target-aliases)))) (sectioning org-export-latex-sectioning) (depth org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp (car sectioning)) (setq sectioning (funcall (car sectioning) level heading)) (when sectioning (setq heading (car sectioning) sectioning (cdr sectioning) label (org-get-text-property-any 0 (quote target) heading) label-list (cons label (cdr (assoc label org-export-target-aliases))))) (if sectioning (setq sectioning (make-list 10 sectioning))) (setq depth (if sectioning 10000 0))) (if (string-match "[ 	]*\\\\\\\\[ 	]*" heading) (setq main-heading (substring heading 0 (match-beginning 0)) sub-heading (substring heading (match-end 0)))) (setq heading (org-export-latex-fontify-headline heading) sub-heading (and sub-heading (org-export-latex-fontify-headline sub-heading)) main-heading (and main-heading (org-export-latex-fontify-headline main-heading))) (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda ... ...) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook ...)) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" ...))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))))))))
  org-export-latex-subcontent(((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)) nil)
  (lambda (x) (org-export-latex-subcontent x num))(((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)))
  mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))
  (let ((num (plist-get org-export-latex-options-plist :section-numbers))) (mapc (lambda (x) (org-export-latex-subcontent x num)) subcontent))
  org-export-latex-sub((((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))
  (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent)))
  (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 (quote org-insert-hook) end))) (and (functionp hook) (funcall hook))) (insert end "\n")))
  (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 ... end))) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" (symbol-name org-export-latex-low-levels)))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent)))))))
  (let* ((heading (cdr (assoc (quote heading) subcontent))) (level (- (cdr (assoc (quote level) subcontent)) org-export-latex-add-level)) (occur (number-to-string (cdr (assoc (quote occur) subcontent)))) (content (cdr (assoc (quote content) subcontent))) (subcontent (cadr (assoc (quote subcontent) subcontent))) (label (org-get-text-property-any 0 (quote target) heading)) (label-list (cons label (cdr (assoc label org-export-target-aliases)))) (sectioning org-export-latex-sectioning) (depth org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp (car sectioning)) (setq sectioning (funcall (car sectioning) level heading)) (when sectioning (setq heading (car sectioning) sectioning (cdr sectioning) label (org-get-text-property-any 0 (quote target) heading) label-list (cons label (cdr (assoc label org-export-target-aliases))))) (if sectioning (setq sectioning (make-list 10 sectioning))) (setq depth (if sectioning 10000 0))) (if (string-match "[ 	]*\\\\\\\\[ 	]*" heading) (setq main-heading (substring heading 0 (match-beginning 0)) sub-heading (substring heading (match-end 0)))) (setq heading (org-export-latex-fontify-headline heading) sub-heading (and sub-heading (org-export-latex-fontify-headline sub-heading)) main-heading (and main-heading (org-export-latex-fontify-headline main-heading))) (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda ... ...) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook ...)) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" ...))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))))))))
  org-export-latex-subcontent(((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))) nil)
  (lambda (x) (org-export-latex-subcontent x num))(((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))))
  mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)))))))
  (let ((num (plist-get org-export-latex-options-plist :section-numbers))) (mapc (lambda (x) (org-export-latex-subcontent x num)) subcontent))
  org-export-latex-sub((((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)))))))
  (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent)))
  (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 (quote org-insert-hook) end))) (and (functionp hook) (funcall hook))) (insert end "\n")))
  (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 ... end))) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" (symbol-name org-export-latex-low-levels)))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent)))))))
  (let* ((heading (cdr (assoc (quote heading) subcontent))) (level (- (cdr (assoc (quote level) subcontent)) org-export-latex-add-level)) (occur (number-to-string (cdr (assoc (quote occur) subcontent)))) (content (cdr (assoc (quote content) subcontent))) (subcontent (cadr (assoc (quote subcontent) subcontent))) (label (org-get-text-property-any 0 (quote target) heading)) (label-list (cons label (cdr (assoc label org-export-target-aliases)))) (sectioning org-export-latex-sectioning) (depth org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp (car sectioning)) (setq sectioning (funcall (car sectioning) level heading)) (when sectioning (setq heading (car sectioning) sectioning (cdr sectioning) label (org-get-text-property-any 0 (quote target) heading) label-list (cons label (cdr (assoc label org-export-target-aliases))))) (if sectioning (setq sectioning (make-list 10 sectioning))) (setq depth (if sectioning 10000 0))) (if (string-match "[ 	]*\\\\\\\\[ 	]*" heading) (setq main-heading (substring heading 0 (match-beginning 0)) sub-heading (substring heading (match-end 0)))) (setq heading (org-export-latex-fontify-headline heading) sub-heading (and sub-heading (org-export-latex-fontify-headline sub-heading)) main-heading (and main-heading (org-export-latex-fontify-headline main-heading))) (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda ... ...) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook ...)) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" ...))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))))))))
  org-export-latex-subcontent(((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 ... 2 32 ...)) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 ... 1 5 ... 5 22 ... 22 38 ... 38 39 ... 39 43 ... 43 76 ... 76 81 ... 81 98 ... 98 114 ... 114 115 ... 115 119 ... 119 152 ... 152 157 ... 157 190 ... 190 195 ... 195 212 ... 212 228 ... 228 229 ... 229 233 ... 233 266 ... 266 271 ... 271 304 ... 304 309 ... 309 326 ... 326 342 ... 342 343 ... 343 347 ... 347 380 ... 380 385 ... 385 418 ... 418 423 ... 423 440 ... 440 456 ... 456 457 ... 457 461 ... 461 494 ... 494 495 ... 495 499 ... 499 532 ... 532 537 ... 537 554 ... 554 570 ... 570 571 ... 571 576 ... 576 577 ... 577 578 ... 578 580 ... 580 581 ... 581 582 ... 582 583 ... 583 584 ... 584 585 ... 585 586 ...)) (subcontent)))))))) nil)
  (lambda (x) (org-export-latex-subcontent x num))(((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 ... 2 32 ...)) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 ... 1 5 ... 5 22 ... 22 38 ... 38 39 ... 39 43 ... 43 76 ... 76 81 ... 81 98 ... 98 114 ... 114 115 ... 115 119 ... 119 152 ... 152 157 ... 157 190 ... 190 195 ... 195 212 ... 212 228 ... 228 229 ... 229 233 ... 233 266 ... 266 271 ... 271 304 ... 304 309 ... 309 326 ... 326 342 ... 342 343 ... 343 347 ... 347 380 ... 380 385 ... 385 418 ... 418 423 ... 423 440 ... 440 456 ... 456 457 ... 457 461 ... 461 494 ... 494 495 ... 495 499 ... 499 532 ... 532 537 ... 537 554 ... 554 570 ... 570 571 ... 571 576 ... 576 577 ... 577 578 ... 578 580 ... 580 581 ... 581 582 ... 582 583 ... 583 584 ... 584 585 ... 585 586 ...)) (subcontent)))))))))
  mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent ((... ... ... ... ... ...)))))))))
  (let ((num (plist-get org-export-latex-options-plist :section-numbers))) (mapc (lambda (x) (org-export-latex-subcontent x num)) subcontent))
  org-export-latex-sub((((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent ((... ... ... ... ... ...)))))))))
  (if (eq (car content) (quote subcontent)) (mapc (quote org-export-latex-sub) (cdr content)) (org-export-latex-sub (car content)))
  org-export-latex-global(((((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 ... 2 7 ...)) (content . #("\n\n\n\n\n" 0 1 ... 1 3 ... 3 4 ... 4 5 ...)) (subcontent (...)))))))))
  (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) (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[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) (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)) (if (re-search-backward "^[ 	]+\\(:latex_class:\\|:export_title:\\)[ 	]+\\S-" nil 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_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) (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)
  recursive-edit()
  byte-code("\306	@\307=\203!\310\311\312\"\210\313\311!\211A@)\242\314=\203!\310\315\312\"\210\316\v!\210\317 \210\320	!\210\f\203d\321ed\"V\203Web\210\322\245y\210`^[db\210\322\245Zy\210^[`|\210)\323c\210eb\210\324\325\326 \"\210\327\306!\210\324\330!\210\331\312\x1c\x1d\324\330!\210\212\332 \210+\331\207" [unread-command-char debugger-args x debugger-buffer noninteractive debugger-batch-max-lines -1 debug backtrace-debug 4 t backtrace-frame lambda 5 pop-to-buffer debugger-mode debugger-setup-buffer count-lines 2 "...\n" message "%s" buffer-string kill-emacs "" nil recursive-edit middlestart buffer-read-only standard-output] 4)
  debug(error (error "Invalid search bound (wrong side of point)"))
  re-search-forward("\\s *\\'" 60 t)
  table--buffer-substring-and-trim(61 60)
  #[(from to) "\306\307\b	B!\307\n	B!\"\310\311!r\fq\210\312\216\vc\210eb\210\313\314\315\316#\203P\317\224\2036\212\317\224b\210\320c\210)\202\0\321\224\203D\322\323\316\211#\210\202\0\322\324\325\326!\324Q!\210\202\0ed{+rq\210\x1e\204o`Sf\327=\203j\330\202k\331\332\261\210\x1f\317V\203\213\333\334\x1f\x1e\203\203\335\202\204\330\v$c\210\202\216\vc\210)\315\x1e\317\x1f !8\211\")\207" [from y to line temp-buffer dest-buffer table--buffer-substring-and-trim table--goto-coordinate generate-new-buffer " *temp*" ((byte-code "\301\b!\203\n\302\b!\210\301\207" [temp-buffer buffer-name kill-buffer] 2)) re-search-forward "\\([#$~_^%{}]\\)\\|\\(\\\\\\)\\|\\([<>|]\\)" nil t 1 "\\" 2 replace-match "$\\backslash$" "$" match-string 3 32 "" " " "& " format "\\multicolumn{%d}{%sl|}{%s}" "|" first-p span i col-list start] 5](21 20)
  table--generate-source-scan-lines(#<killed buffer> latex (45 . 60) (466 . 520) (5 21) (2 4 7 10 13))
  table-generate-source(latex "*org-export-table*" "caption")
  (let (tbl caption shortn label line floatp attr align rmlines) (setq line (buffer-substring (point-at-bol) (point-at-eol)) label (org-get-text-property-any 0 (quote org-label) line) caption (org-get-text-property-any 0 (quote org-caption) line) shortn (org-get-text-property-any 0 (quote org-caption-shortn) line) attr (org-get-text-property-any 0 (quote org-attributes) line) align (and attr (stringp attr) (string-match "\\<align=\\([^ 	\n,]+\\)" attr) (match-string 1 attr)) rmlines (and attr (stringp attr) (string-match "\\<rmlines\\>" attr)) floatp (or label caption)) (and (get-buffer "*org-export-table*") (kill-buffer (get-buffer "*org-export-table*"))) (table-generate-source (quote latex) "*org-export-table*" "caption") (setq tbl (with-current-buffer "*org-export-table*" (buffer-string))) (while (string-match "^%.*\n" tbl) (setq tbl (replace-match "" t t tbl))) (when rmlines (let ((n 0) lines) (setq lines (mapcar (lambda (x) (if (string-match "^\\\\hline$" x) (progn ... ...) x)) (org-split-string tbl "\n"))) (setq tbl (mapconcat (quote identity) (delq nil lines) "\n")))) (when (and align (string-match "\\\\begin{tabular}{.*}" tbl)) (setq tbl (replace-match (concat "\\begin{tabular}{" align "}") t t tbl))) (and (get-buffer "*org-export-table*") (kill-buffer (get-buffer "*org-export-table*"))) (beginning-of-line 0) (while (looking-at "[ 	]*\\(|\\|\\+-\\)") (delete-region (point) (1+ (point-at-eol)))) (when org-export-latex-tables-centered (setq tbl (concat "\\begin{center}\n" tbl "\\end{center}"))) (when floatp (setq tbl (concat "\\begin{table}\n" (format "\\caption%s{%s}%s\n" (if shortn (format "[%s]" shortn) "") (if label (format "\\label{%s}" label) "") (or caption "")) tbl "\n\\end{table}\n"))) (insert (org-export-latex-protect-string tbl)))
  org-export-latex-convert-table\.el-table()
  (if (get-text-property (point) (quote org-protected)) nil (require (quote table)) (org-export-latex-convert-table\.el-table))
  (unless (get-text-property (point) (quote org-protected)) (require (quote table)) (org-export-latex-convert-table\.el-table))
  (org-if-unprotected (require (quote table)) (org-export-latex-convert-table\.el-table))
  (while (re-search-forward "^[ 	]*\\(\\+-[-+]*\\+\\)[ 	]*\n[ 	]*|" nil t) (org-if-unprotected (require (quote table)) (org-export-latex-convert-table\.el-table)))
  org-export-latex-tables(t)
  (if (memq (quote tables) exclude-list) nil (org-export-latex-tables (plist-get org-export-latex-options-plist :tables)))
  (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables)))
  (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max)))
  (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max)))
  org-export-latex-content(#("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test")))
  (insert (org-export-latex-content content))
  (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 (quote org-insert-hook) end))) (and (functionp hook) (funcall hook))) (insert end "\n")))
  (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 ... end))) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" (symbol-name org-export-latex-low-levels)))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent)))))))
  (let* ((heading (cdr (assoc (quote heading) subcontent))) (level (- (cdr (assoc (quote level) subcontent)) org-export-latex-add-level)) (occur (number-to-string (cdr (assoc (quote occur) subcontent)))) (content (cdr (assoc (quote content) subcontent))) (subcontent (cadr (assoc (quote subcontent) subcontent))) (label (org-get-text-property-any 0 (quote target) heading)) (label-list (cons label (cdr (assoc label org-export-target-aliases)))) (sectioning org-export-latex-sectioning) (depth org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp (car sectioning)) (setq sectioning (funcall (car sectioning) level heading)) (when sectioning (setq heading (car sectioning) sectioning (cdr sectioning) label (org-get-text-property-any 0 (quote target) heading) label-list (cons label (cdr (assoc label org-export-target-aliases))))) (if sectioning (setq sectioning (make-list 10 sectioning))) (setq depth (if sectioning 10000 0))) (if (string-match "[ 	]*\\\\\\\\[ 	]*" heading) (setq main-heading (substring heading 0 (match-beginning 0)) sub-heading (substring heading (match-end 0)))) (setq heading (org-export-latex-fontify-headline heading) sub-heading (and sub-heading (org-export-latex-fontify-headline sub-heading)) main-heading (and main-heading (org-export-latex-fontify-headline main-heading))) (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda ... ...) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook ...)) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" ...))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))))))))
  org-export-latex-subcontent(((pos . 1) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1" org-category "test" fontified nil) 2 32 (target "sec-1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test"))) (subcontent)) nil)
  (lambda (x) (org-export-latex-subcontent x num))(((pos . 1) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1" org-category "test" fontified nil) 2 32 (target "sec-1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test"))) (subcontent)))
  mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 1) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1" org-category "test" fontified nil) 2 32 (target "sec-1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test"))) (subcontent))))
  (let ((num (plist-get org-export-latex-options-plist :section-numbers))) (mapc (lambda (x) (org-export-latex-subcontent x num)) subcontent))
  org-export-latex-sub((((pos . 1) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1" org-category "test" fontified nil) 2 32 (target "sec-1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test"))) (subcontent))))
  (if (eq (car content) (quote subcontent)) (mapc (quote org-export-latex-sub) (cdr content)) (org-export-latex-sub (car content)))
  org-export-latex-global(((((pos . 1) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1" org-category "test" fontified nil) 2 32 (target "sec-1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 499 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 499 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 537 (fontified nil org-category "test") 537 554 (fontified nil org-category "test") 554 570 (fontified nil org-category "test") 570 571 (fontified nil org-category "test"))) (subcontent)))))
  (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 nil (:ignore-subtree-p t) "*Org LaTeX Export*" nil)
  (setq rtn (org-export-as-latex nil nil ext-plist buffer body-only))
  (let ((transient-mark-mode t) (zmacs-regions t) ext-plist rtn) (setq ext-plist (plist-put ext-plist :ignore-subtree-p t)) (goto-char end) (set-mark (point)) (goto-char beg) (setq rtn (org-export-as-latex nil nil ext-plist buffer body-only)) (if (fboundp (quote deactivate-mark)) (deactivate-mark)) (if (and (interactive-p) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))
  org-export-region-as-latex(13448 14054 nil)
  call-interactively(org-export-region-as-latex t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)
  recursive-edit()
  byte-code("\306	@\307=\203!\310\311\312\"\210\313\311!\211A@)\242\314=\203!\310\315\312\"\210\316\v!\210\317 \210\320	!\210\f\203d\321ed\"V\203Web\210\322\245y\210`^[db\210\322\245Zy\210^[`|\210)\323c\210eb\210\324\325\326 \"\210\327\306!\210\324\330!\210\331\312\x1c\x1d\324\330!\210\212\332 \210+\331\207" [unread-command-char debugger-args x debugger-buffer noninteractive debugger-batch-max-lines -1 debug backtrace-debug 4 t backtrace-frame lambda 5 pop-to-buffer debugger-mode debugger-setup-buffer count-lines 2 "...\n" message "%s" buffer-string kill-emacs "" nil recursive-edit middlestart buffer-read-only standard-output] 4)
  debug(error (error "Invalid search bound (wrong side of point)"))
  re-search-forward("\\s *\\'" 60 t)
  table--buffer-substring-and-trim(61 60)
  #[(from to) "\306\307\b	B!\307\n	B!\"\310\311!r\fq\210\312\216\vc\210eb\210\313\314\315\316#\203P\317\224\2036\212\317\224b\210\320c\210)\202\0\321\224\203D\322\323\316\211#\210\202\0\322\324\325\326!\324Q!\210\202\0ed{+rq\210\x1e\204o`Sf\327=\203j\330\202k\331\332\261\210\x1f\317V\203\213\333\334\x1f\x1e\203\203\335\202\204\330\v$c\210\202\216\vc\210)\315\x1e\317\x1f !8\211\")\207" [from y to line temp-buffer dest-buffer table--buffer-substring-and-trim table--goto-coordinate generate-new-buffer " *temp*" ((byte-code "\301\b!\203\n\302\b!\210\301\207" [temp-buffer buffer-name kill-buffer] 2)) re-search-forward "\\([#$~_^%{}]\\)\\|\\(\\\\\\)\\|\\([<>|]\\)" nil t 1 "\\" 2 replace-match "$\\backslash$" "$" match-string 3 32 "" " " "& " format "\\multicolumn{%d}{%sl|}{%s}" "|" first-p span i col-list start] 5](21 20)
  table--generate-source-scan-lines(#<killed buffer> latex (45 . 60) (466 . 520) (5 21) (2 4 7 10 13))
  table-generate-source(latex "*org-export-table*" "caption")
  (let (tbl caption shortn label line floatp attr align rmlines) (setq line (buffer-substring (point-at-bol) (point-at-eol)) label (org-get-text-property-any 0 (quote org-label) line) caption (org-get-text-property-any 0 (quote org-caption) line) shortn (org-get-text-property-any 0 (quote org-caption-shortn) line) attr (org-get-text-property-any 0 (quote org-attributes) line) align (and attr (stringp attr) (string-match "\\<align=\\([^ 	\n,]+\\)" attr) (match-string 1 attr)) rmlines (and attr (stringp attr) (string-match "\\<rmlines\\>" attr)) floatp (or label caption)) (and (get-buffer "*org-export-table*") (kill-buffer (get-buffer "*org-export-table*"))) (table-generate-source (quote latex) "*org-export-table*" "caption") (setq tbl (with-current-buffer "*org-export-table*" (buffer-string))) (while (string-match "^%.*\n" tbl) (setq tbl (replace-match "" t t tbl))) (when rmlines (let ((n 0) lines) (setq lines (mapcar (lambda (x) (if (string-match "^\\\\hline$" x) (progn ... ...) x)) (org-split-string tbl "\n"))) (setq tbl (mapconcat (quote identity) (delq nil lines) "\n")))) (when (and align (string-match "\\\\begin{tabular}{.*}" tbl)) (setq tbl (replace-match (concat "\\begin{tabular}{" align "}") t t tbl))) (and (get-buffer "*org-export-table*") (kill-buffer (get-buffer "*org-export-table*"))) (beginning-of-line 0) (while (looking-at "[ 	]*\\(|\\|\\+-\\)") (delete-region (point) (1+ (point-at-eol)))) (when org-export-latex-tables-centered (setq tbl (concat "\\begin{center}\n" tbl "\\end{center}"))) (when floatp (setq tbl (concat "\\begin{table}\n" (format "\\caption%s{%s}%s\n" (if shortn (format "[%s]" shortn) "") (if label (format "\\label{%s}" label) "") (or caption "")) tbl "\n\\end{table}\n"))) (insert (org-export-latex-protect-string tbl)))
  org-export-latex-convert-table\.el-table()
  (if (get-text-property (point) (quote org-protected)) nil (require (quote table)) (org-export-latex-convert-table\.el-table))
  (unless (get-text-property (point) (quote org-protected)) (require (quote table)) (org-export-latex-convert-table\.el-table))
  (org-if-unprotected (require (quote table)) (org-export-latex-convert-table\.el-table))
  (while (re-search-forward "^[ 	]*\\(\\+-[-+]*\\+\\)[ 	]*\n[ 	]*|" nil t) (org-if-unprotected (require (quote table)) (org-export-latex-convert-table\.el-table)))
  org-export-latex-tables(t)
  (if (memq (quote tables) exclude-list) nil (org-export-latex-tables (plist-get org-export-latex-options-plist :tables)))
  (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables)))
  (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max)))
  (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (org-install-letbind) (insert content) (unless (memq (quote timestamps) exclude-list) (org-export-latex-time-stamps)) (unless (memq (quote quotation-marks) exclude-list) (org-export-latex-quotation-marks)) (unless (memq (quote emphasis) exclude-list) (when (plist-get org-export-latex-options-plist :emphasize) (org-export-latex-fontify))) (unless (memq (quote sub-superscript) exclude-list) (org-export-latex-special-chars (plist-get org-export-latex-options-plist :sub-superscript))) (unless (memq (quote links) exclude-list) (org-export-latex-links)) (unless (memq (quote keywords) exclude-list) (org-export-latex-keywords)) (unless (memq (quote lists) exclude-list) (org-export-latex-lists)) (unless (memq (quote tables) exclude-list) (org-export-latex-tables (plist-get org-export-latex-options-plist :tables))) (unless (memq (quote fixed-width) exclude-list) (org-export-latex-fixed-width (plist-get org-export-latex-options-plist :fixed-width))) (buffer-substring (point-min) (point-max)))
  org-export-latex-content(#("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test")))
  (insert (org-export-latex-content content))
  (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 (quote org-insert-hook) end))) (and (functionp hook) (funcall hook))) (insert end "\n")))
  (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 ... end))) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" (symbol-name org-export-latex-low-levels)))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent)))))))
  (let* ((heading (cdr (assoc (quote heading) subcontent))) (level (- (cdr (assoc (quote level) subcontent)) org-export-latex-add-level)) (occur (number-to-string (cdr (assoc (quote occur) subcontent)))) (content (cdr (assoc (quote content) subcontent))) (subcontent (cadr (assoc (quote subcontent) subcontent))) (label (org-get-text-property-any 0 (quote target) heading)) (label-list (cons label (cdr (assoc label org-export-target-aliases)))) (sectioning org-export-latex-sectioning) (depth org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp (car sectioning)) (setq sectioning (funcall (car sectioning) level heading)) (when sectioning (setq heading (car sectioning) sectioning (cdr sectioning) label (org-get-text-property-any 0 (quote target) heading) label-list (cons label (cdr (assoc label org-export-target-aliases))))) (if sectioning (setq sectioning (make-list 10 sectioning))) (setq depth (if sectioning 10000 0))) (if (string-match "[ 	]*\\\\\\\\[ 	]*" heading) (setq main-heading (substring heading 0 (match-beginning 0)) sub-heading (substring heading (match-end 0)))) (setq heading (org-export-latex-fontify-headline heading) sub-heading (and sub-heading (org-export-latex-fontify-headline sub-heading)) main-heading (and main-heading (org-export-latex-fontify-headline main-heading))) (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda ... ...) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook ...)) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" ...))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))))))))
  org-export-latex-subcontent(((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)) nil)
  (lambda (x) (org-export-latex-subcontent x num))(((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)))
  mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))
  (let ((num (plist-get org-export-latex-options-plist :section-numbers))) (mapc (lambda (x) (org-export-latex-subcontent x num)) subcontent))
  org-export-latex-sub((((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))
  (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent)))
  (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 (quote org-insert-hook) end))) (and (functionp hook) (funcall hook))) (insert end "\n")))
  (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 ... end))) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" (symbol-name org-export-latex-low-levels)))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent)))))))
  (let* ((heading (cdr (assoc (quote heading) subcontent))) (level (- (cdr (assoc (quote level) subcontent)) org-export-latex-add-level)) (occur (number-to-string (cdr (assoc (quote occur) subcontent)))) (content (cdr (assoc (quote content) subcontent))) (subcontent (cadr (assoc (quote subcontent) subcontent))) (label (org-get-text-property-any 0 (quote target) heading)) (label-list (cons label (cdr (assoc label org-export-target-aliases)))) (sectioning org-export-latex-sectioning) (depth org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp (car sectioning)) (setq sectioning (funcall (car sectioning) level heading)) (when sectioning (setq heading (car sectioning) sectioning (cdr sectioning) label (org-get-text-property-any 0 (quote target) heading) label-list (cons label (cdr (assoc label org-export-target-aliases))))) (if sectioning (setq sectioning (make-list 10 sectioning))) (setq depth (if sectioning 10000 0))) (if (string-match "[ 	]*\\\\\\\\[ 	]*" heading) (setq main-heading (substring heading 0 (match-beginning 0)) sub-heading (substring heading (match-end 0)))) (setq heading (org-export-latex-fontify-headline heading) sub-heading (and sub-heading (org-export-latex-fontify-headline sub-heading)) main-heading (and main-heading (org-export-latex-fontify-headline main-heading))) (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda ... ...) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook ...)) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" ...))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))))))))
  org-export-latex-subcontent(((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))) nil)
  (lambda (x) (org-export-latex-subcontent x num))(((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent))))))
  mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)))))))
  (let ((num (plist-get org-export-latex-options-plist :section-numbers))) (mapc (lambda (x) (org-export-latex-subcontent x num)) subcontent))
  org-export-latex-sub((((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 (target "sec-1_1_1" org-category "test" fontified nil) 2 32 (target "sec-1_1_1" org-category "test" fontified nil))) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 5 (fontified nil org-category "test") 5 22 (fontified nil org-category "test") 22 38 (fontified nil org-category "test") 38 39 (fontified nil org-category "test") 39 43 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 43 76 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 76 81 (fontified nil org-category "test") 81 98 (fontified nil org-category "test") 98 114 (fontified nil org-category "test") 114 115 (fontified nil org-category "test") 115 119 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 119 152 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 152 157 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 157 190 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 190 195 (fontified nil org-category "test") 195 212 (fontified nil org-category "test") 212 228 (fontified nil org-category "test") 228 229 (fontified nil org-category "test") 229 233 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 233 266 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 266 271 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 271 304 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 304 309 (fontified nil org-category "test") 309 326 (fontified nil org-category "test") 326 342 (fontified nil org-category "test") 342 343 (fontified nil org-category "test") 343 347 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 347 380 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 380 385 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 385 418 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 418 423 (fontified nil org-category "test") 423 440 (fontified nil org-category "test") 440 456 (fontified nil org-category "test") 456 457 (fontified nil org-category "test") 457 461 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 461 494 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 494 495 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 495 532 (fontified nil org-category "test" org-caption nil org-caption-shortn nil org-attributes nil org-label nil) 532 571 (fontified nil org-category "test") 571 576 (fontified nil org-category "test") 576 577 (fontified nil org-category "test") 577 578 (fontified nil org-category "test") 578 580 (fontified nil org-category "test") 580 581 (fontified nil org-category "test") 581 582 (fontified nil org-category "test") 582 583 (fontified nil org-category "test") 583 584 (fontified nil org-category "test") 584 585 (fontified nil org-category "test") 585 586 (fontified nil org-category "test"))) (subcontent)))))))
  (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent)))
  (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 (quote org-insert-hook) end))) (and (functionp hook) (funcall hook))) (insert end "\n")))
  (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook (org-get-text-property-any 0 ... end))) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" (symbol-name org-export-latex-low-levels)))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring (point-at-bol 0) (point))) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label (format "\\label{%s}" label) ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent)))))))
  (let* ((heading (cdr (assoc (quote heading) subcontent))) (level (- (cdr (assoc (quote level) subcontent)) org-export-latex-add-level)) (occur (number-to-string (cdr (assoc (quote occur) subcontent)))) (content (cdr (assoc (quote content) subcontent))) (subcontent (cadr (assoc (quote subcontent) subcontent))) (label (org-get-text-property-any 0 (quote target) heading)) (label-list (cons label (cdr (assoc label org-export-target-aliases)))) (sectioning org-export-latex-sectioning) (depth org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp (car sectioning)) (setq sectioning (funcall (car sectioning) level heading)) (when sectioning (setq heading (car sectioning) sectioning (cdr sectioning) label (org-get-text-property-any 0 (quote target) heading) label-list (cons label (cdr (assoc label org-export-target-aliases))))) (if sectioning (setq sectioning (make-list 10 sectioning))) (setq depth (if sectioning 10000 0))) (if (string-match "[ 	]*\\\\\\\\[ 	]*" heading) (setq main-heading (substring heading 0 (match-beginning 0)) sub-heading (substring heading (match-end 0)))) (setq heading (org-export-latex-fontify-headline heading) sub-heading (and sub-heading (org-export-latex-fontify-headline sub-heading)) main-heading (and main-heading (org-export-latex-fontify-headline main-heading))) (cond ((<= level depth) (let* ((sec (nth (1- level) sectioning)) (num (if (integerp num) (>= num level) num)) start end) (if (consp (cdr sec)) (setq start (nth (if num 0 2) sec) end (nth (if num 1 3) sec)) (setq start (if num (car sec) (cdr sec)))) (insert (format start (if main-heading main-heading heading) (or sub-heading ""))) (insert "\n") (when label (insert (mapconcat (lambda ... ...) label-list "\n") "\n")) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (while (org-looking-back "\n\n") (backward-delete-char 1)) (org-export-latex-sub subcontent))) (when (and end (string-match "[^ 	]" end)) (let ((hook ...)) (and (functionp hook) (funcall hook))) (insert end "\n")))) ((> level depth) (cond ((eq org-export-latex-low-levels (quote description)) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert "\\begin{description}\n")) (insert (format "\n\\item[%s]%s~\n" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert "\\end{description} % ends low level\n")) ((memq org-export-latex-low-levels (quote (itemize enumerate))) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (format "\\begin{%s}\n" ...))) (insert (format "\n\\item %s\\\\\n%s%%" heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (format "\\end{%s} %% ends low level\n" (symbol-name org-export-latex-low-levels)))) ((listp org-export-latex-low-levels) (if (string-match "% ends low level$" (buffer-substring ... ...)) (delete-region (point-at-bol 0) (point)) (insert (car org-export-latex-low-levels) "\n")) (insert (format (nth 2 org-export-latex-low-levels) heading (if label ... ""))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))) (insert (nth 1 org-export-latex-low-levels) " %% ends low level\n")) ((stringp org-export-latex-low-levels) (insert (format org-export-latex-low-levels heading) "\n") (when label (insert (format "\\label{%s}\n" label))) (insert (org-export-latex-content content)) (cond ((stringp subcontent) (insert subcontent)) ((listp subcontent) (org-export-latex-sub subcontent))))))))
  org-export-latex-subcontent(((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 ... 2 32 ...)) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 ... 1 5 ... 5 22 ... 22 38 ... 38 39 ... 39 43 ... 43 76 ... 76 81 ... 81 98 ... 98 114 ... 114 115 ... 115 119 ... 119 152 ... 152 157 ... 157 190 ... 190 195 ... 195 212 ... 212 228 ... 228 229 ... 229 233 ... 233 266 ... 266 271 ... 271 304 ... 304 309 ... 309 326 ... 326 342 ... 342 343 ... 343 347 ... 347 380 ... 380 385 ... 385 418 ... 418 423 ... 423 440 ... 440 456 ... 456 457 ... 457 461 ... 461 494 ... 494 495 ... 495 532 ... 532 571 ... 571 576 ... 576 577 ... 577 578 ... 578 580 ... 580 581 ... 581 582 ... 582 583 ... 583 584 ... 584 585 ... 585 586 ...)) (subcontent)))))))) nil)
  (lambda (x) (org-export-latex-subcontent x num))(((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent (((pos . 71) (level . 3) (occur . 1) (heading . #(" Table.el Table with no Spanning " 1 2 ... 2 32 ...)) (content . #("\n    +---------------+---------------+\n    |Term           |Percentage     |\n    +---------------+---------------+\n    |Quarter        |25%            |\n    |One-Fourth     |               |\n    +---------------+---------------+\n    |Half           |50%            |\n    |One-by-Two     |               |\n    +---------------+---------------+\n    |Three-Quarters |75%            |\n    |Three-Fourths  |               |\n    +---------------+---------------+\n    |Full           |100%           |\n    |Whole          |               |\n    +---------------+---------------+\n    \n\n\n\n\n\n\n\n\n\n\n" 0 1 ... 1 5 ... 5 22 ... 22 38 ... 38 39 ... 39 43 ... 43 76 ... 76 81 ... 81 98 ... 98 114 ... 114 115 ... 115 119 ... 119 152 ... 152 157 ... 157 190 ... 190 195 ... 195 212 ... 212 228 ... 228 229 ... 229 233 ... 233 266 ... 266 271 ... 271 304 ... 304 309 ... 309 326 ... 326 342 ... 342 343 ... 343 347 ... 347 380 ... 380 385 ... 385 418 ... 418 423 ... 423 440 ... 440 456 ... 456 457 ... 457 461 ... 461 494 ... 494 495 ... 495 532 ... 532 571 ... 571 576 ... 576 577 ... 577 578 ... 578 580 ... 580 581 ... 581 582 ... 582 583 ... 583 584 ... 584 585 ... 585 586 ...)) (subcontent)))))))))
  mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent ((... ... ... ... ... ...)))))))))
  (let ((num (plist-get org-export-latex-options-plist :section-numbers))) (mapc (lambda (x) (org-export-latex-subcontent x num)) subcontent))
  org-export-latex-sub((((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 (target "sec-1_1" org-category "test" fontified nil) 2 7 (target "sec-1_1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test"))) (subcontent ((... ... ... ... ... ...)))))))))
  (if (eq (car content) (quote subcontent)) (mapc (quote org-export-latex-sub) (cdr content)) (org-export-latex-sub (car content)))
  org-export-latex-global(((((pos . 4) (level . 1) (occur . 1) (heading . #(" Sample Content (Proof Of Concept) " 1 2 (target "sec-1" org-category "test" fontified nil) 2 34 (target "sec-1" org-category "test" fontified nil))) (content . #("\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 0 1 (fontified nil org-category "test") 1 2 (fontified nil org-category "test") 2 3 (fontified nil org-category "test") 3 4 (fontified nil org-category "test") 4 5 (fontified nil org-category "test") 5 6 (fontified nil org-category "test") 6 7 (fontified nil org-category "test") 7 8 (fontified nil org-category "test") 8 9 (fontified nil org-category "test") 9 10 (fontified nil org-category "test") 10 12 (fontified nil org-category "test") 12 13 (fontified nil org-category "test") 13 14 (fontified nil org-category "test"))) (subcontent (((pos . 55) (level . 2) (occur . 1) (heading . #(" Tables " 1 2 ... 2 7 ...)) (content . #("\n\n\n\n\n" 0 1 ... 1 3 ... 3 4 ... 4 5 ...)) (subcontent (...)))))))))
  (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) (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[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) (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)) (if (re-search-backward "^[ 	]+\\(:latex_class:\\|:export_title:\\)[ 	]+\\S-" nil 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_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) (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)




-- 

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

* Re: [BUG] Crash with LaTeX exporter
  2011-04-06  5:00 [BUG] Crash with LaTeX exporter Jambunathan K
@ 2011-04-06  9:14 ` Lawrence Mitchell
  2011-05-24 12:06   ` Carsten Dominik
  2011-04-06  9:27 ` Giovanni Ridolfi
  1 sibling, 1 reply; 4+ messages in thread
From: Lawrence Mitchell @ 2011-04-06  9:14 UTC (permalink / raw)
  To: emacs-orgmode

Jambunathan K wrote:
> [1. text/plain]


> Exporting the below table to LaTeX throws an error. Let me know if you
> need any additional info.

> [2. text/x-verbatim]


> *** Table.el Table with no Spanning
>     +---------------+---------------+
>     |Term           |Percentage     |
>     +---------------+---------------+
>     |Quarter        |25%            |
>     |One-Fourth     |               |
>     +---------------+---------------+
>     |Half           |50%            |
>     |One-by-Two     |               |
>     +---------------+---------------+
>     |Three-Quarters |75%            |
>     |Three-Fourths  |               |
>     +---------------+---------------+
>     |Full           |100%           |
>     |Whole          |               |
>     +---------------+---------------+
> [3. text/plain]

A more minimal table demonstrating the problem is:

+---+---+
|foo|bar|
+---+---+
|baz|33%|
+---+---+

This is because the percent signs are escaped in the table that
table.el sees, but the column width is not updated
appropriately.  The export process converts "%" into "\%" so that
table.el sees the following table:

+---+---+
|foo|bar|
+---+---+
|baz|33\%|
+---+---+

And so column/row calculations are incorrect.  Since table.el's
export correctly deals with escaping of percent signs, one could
just remove the escapes from the table.

It's possible that something like the below would fix things.

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index b8be87a..d591358 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1963,6 +1963,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 	  floatp (or label caption))
     (and (get-buffer "*org-export-table*")
 	 (kill-buffer (get-buffer "*org-export-table*")))
+    (save-excursion
+      (while (search-forward "\\%" nil t)
+	(replace-match "%" nil t)))
     (table-generate-source 'latex "*org-export-table*" "caption")
     (setq tbl (with-current-buffer "*org-export-table*"
 		(buffer-string)))

Patchwork maintainers, please don't pick this up, it's a horrible
fix :P.

Lawrence

-- 
Lawrence Mitchell <wence@gmx.li>

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

* Re: [BUG] Crash with LaTeX exporter
  2011-04-06  5:00 [BUG] Crash with LaTeX exporter Jambunathan K
  2011-04-06  9:14 ` Lawrence Mitchell
@ 2011-04-06  9:27 ` Giovanni Ridolfi
  1 sibling, 0 replies; 4+ messages in thread
From: Giovanni Ridolfi @ 2011-04-06  9:27 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode

Jambunathan K <kjambunathan@gmail.com> writes:

Hi, Jambunathan,

> Exporting the below table to LaTeX throws an error. Let me know if you
> need any additional info.
>
>
> *** Table.el Table with no Spanning
>     +---------------+---------------+
>     |Term           |Percentage     |
>     +---------------+---------------+
>     |Quarter        |25%            |
>     |One-Fourth     |               |
>     +---------------+---------------+
>     |Half           |50%            |
>     |One-by-Two     |               |
>     +---------------+---------------+
>     |Three-Quarters |75%            |
>     |Three-Fourths  |               |
>     +---------------+---------------+
>     |Full           |100%           |
>     |Whole          |               |
>     +---------------+---------------+

Skimming the archive list can be found that the exporter of 
table.el-tables has some problems[1-2].

More recently on Fri, 11 Feb 2011 14:16:42 +0100 Bastien suggested 
to convert to org-table before exporting.

http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg00566.html


cheers, 
Giovanni

[1]
http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01889.html
[2]
http://lists.gnu.org/archive/html/emacs-orgmode/2011-01/msg00314.html
  (David Maus, on Sun, 09 Jan 2011 14:42:46 +0100 
    replying to... you)
>At Sun, 19 Dec 2010 19:37:25 +0530,
> Jambunathan K wrote:
;-)

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

* Re: [BUG] Crash with LaTeX exporter
  2011-04-06  9:14 ` Lawrence Mitchell
@ 2011-05-24 12:06   ` Carsten Dominik
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2011-05-24 12:06 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: emacs-orgmode


On Apr 6, 2011, at 11:14 AM, Lawrence Mitchell wrote:

> Jambunathan K wrote:
>> [1. text/plain]
> 
> 
>> Exporting the below table to LaTeX throws an error. Let me know if you
>> need any additional info.
> 
>> [2. text/x-verbatim]
> 
> 
>> *** Table.el Table with no Spanning
>>    +---------------+---------------+
>>    |Term           |Percentage     |
>>    +---------------+---------------+
>>    |Quarter        |25%            |
>>    |One-Fourth     |               |
>>    +---------------+---------------+
>>    |Half           |50%            |
>>    |One-by-Two     |               |
>>    +---------------+---------------+
>>    |Three-Quarters |75%            |
>>    |Three-Fourths  |               |
>>    +---------------+---------------+
>>    |Full           |100%           |
>>    |Whole          |               |
>>    +---------------+---------------+
>> [3. text/plain]
> 
> A more minimal table demonstrating the problem is:
> 
> +---+---+
> |foo|bar|
> +---+---+
> |baz|33%|
> +---+---+
> 
> This is because the percent signs are escaped in the table that
> table.el sees, but the column width is not updated
> appropriately.  The export process converts "%" into "\%" so that
> table.el sees the following table:
> 
> +---+---+
> |foo|bar|
> +---+---+
> |baz|33\%|
> +---+---+
> 
> And so column/row calculations are incorrect.  Since table.el's
> export correctly deals with escaping of percent signs, one could
> just remove the escapes from the table.
> 
> It's possible that something like the below would fix things.
> 
> diff --git a/lisp/org-latex.el b/lisp/org-latex.el
> index b8be87a..d591358 100644
> --- a/lisp/org-latex.el
> +++ b/lisp/org-latex.el
> @@ -1963,6 +1963,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
> 	  floatp (or label caption))
>     (and (get-buffer "*org-export-table*")
> 	 (kill-buffer (get-buffer "*org-export-table*")))
> +    (save-excursion
> +      (while (search-forward "\\%" nil t)
> +	(replace-match "%" nil t)))
>     (table-generate-source 'latex "*org-export-table*" "caption")
>     (setq tbl (with-current-buffer "*org-export-table*"
> 		(buffer-string)))
> 
> Patchwork maintainers, please don't pick this up, it's a horrible
> fix :P.

I have now turned off Org-mode special character preprocessing
in table.el.  So the above table should now export OK.
However, note that table.el does not protect the ampersand,
so tables with that will still fail.

- Carsten

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

end of thread, other threads:[~2011-05-24 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-06  5:00 [BUG] Crash with LaTeX exporter Jambunathan K
2011-04-06  9:14 ` Lawrence Mitchell
2011-05-24 12:06   ` Carsten Dominik
2011-04-06  9:27 ` Giovanni Ridolfi

Code repositories for project(s) associated with this 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).