[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] problem exporting an image to latex
From: |
Eric S Fraga |
Subject: |
[Orgmode] problem exporting an image to latex |
Date: |
Mon, 05 Jul 2010 12:59:59 +0100 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Hello,
with the most up to date org, I am having a problem exporting to
latex, specifically if there is a link to an image. See the attached
example with emacs and org version information. The error in
*Messages* I get is:
,----
| Exporting to LaTeX...
| org-babel-exp processing...
| insert: Wrong number of arguments: (lambda (path caption label attr) "Format
the image element, depending on user settings." (let (ind floatp wrapp
multicolumnp placement figenv) (setq floatp (or caption label)) (setq ind
(org-get-text-property-any 0 (quote original-indentation) path)) (when (and
attr (stringp attr)) (if (string-match "[ ]*\\<wrap\\>" attr) (setq wrapp t
floatp nil attr (replace-match "" t t attr))) (if (string-match "[
]*\\<float\\>" attr) (setq wrapp nil floatp t attr (replace-match "" t t
attr))) (if (string-match "[ ]*\\<multicolumn\\>" attr) (setq multicolumnp t
attr (replace-match "" t t attr)))) (setq placement (cond (wrapp
"{l}{0.5\\textwidth}") (floatp "[htb]") (t ""))) (when (and attr (stringp attr)
(string-match "[ ]*\\<placement=\\(\\S-+\\)" attr)) (setq placement
(match-string 1 attr) attr (replace-match "" t t attr))) (setq attr (and attr
(org-trim attr))) (when (or (not attr) (= (length attr) 0)) (setq attr (cond
(floatp "width=0.7\\textwidth") (wrapp "width=0.48\\textwidth") (t attr))))
(setq figenv (cond (wrapp "\\begin{wrapfigure}%placement
| \\centering
| \\includegraphics[%attr]{%path}
| \\caption%shortn{%labelcmd%caption}
| \\end{wrapfigure}") (multicolumnp "\\begin{figure*}%placement
| \\centering
| \\includegraphics[%attr]{%path}
| \\caption{%labelcmd%caption}
| \\end{figure*}") (floatp "\\begin{figure}%placement
| \\centering
| \\includegraphics[%attr]{%path}
| \\caption{%labelcmd%caption}
| \\end{figure}") (t "\\includegraphics[%attr]{%path}"))) ...)), 5
`----
and the debug trail is:
,----
| Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (path
caption label attr) "Format the image element, depending on user settings."
(let (ind floatp wrapp multicolumnp placement figenv) (setq floatp (or caption
label)) (setq ind (org-get-text-property-any 0 (quote original-indentation)
path)) (when (and attr (stringp attr)) (if (string-match "[ ]*\\<wrap\\>"
attr) (setq wrapp t floatp nil attr (replace-match "" t t attr))) (if
(string-match "[ ]*\\<float\\>" attr) (setq wrapp nil floatp t attr
(replace-match "" t t attr))) (if (string-match "[ ]*\\<multicolumn\\>" attr)
(setq multicolumnp t attr (replace-match "" t t attr)))) (setq placement (cond
(wrapp "{l}{0.5\\textwidth}") (floatp "[htb]") (t ""))) (when (and attr
(stringp attr) (string-match "[ ]*\\<placement=\\(\\S-+\\)" attr)) (setq
placement (match-string 1 attr) attr (replace-match "" t t attr))) (setq attr
(and attr (org-trim attr))) (when (or (not attr) (= (length attr) 0)) (setq
attr (cond (floatp "width=0.7\\textwidth") (wrapp "width=0.48\\textwidth") (t
attr)))) (setq figenv (cond (wrapp "\\begin{wrapfigure}%placement
| \\centering
| \\includegraphics[%attr]{%path}
| \\caption%shortn{%labelcmd%caption}
| \\end{wrapfigure}") (multicolumnp "\\begin{figure*}%placement
| \\centering
| \\includegraphics[%attr]{%path}
| \\caption{%labelcmd%caption}
| \\end{figure*}") (floatp "\\begin{figure}%placement
| \\centering
| \\includegraphics[%attr]{%path}
| \\caption{%labelcmd%caption}
| \\end{figure}") (t "\\includegraphics[%attr]{%path}"))) (setq figenv
(mapconcat (quote identity) (split-string figenv "
| ") (save-excursion (beginning-of-line 1) (looking-at "[ ]*") (concat "
| " (match-string 0))))) (if (and (not label) (not caption) (string-match
"^\\\\caption{.*
| " figenv)) (setq figenv (replace-match "" t t figenv))) (org-add-props
(org-fill-template figenv (list (cons "path" (if (file-name-absolute-p path)
(expand-file-name path) path)) (cons "attr" attr) (cons "shortn" (if shortn
(format "[%s]" shortn) "")) (cons "labelcmd" (if label (format "\\label{%s}"
label) "")) (cons "caption" (or caption "")) (cons "placement" (or placement
"")))) nil (quote original-indentation) ind))) 5)
| org-export-latex-format-image(#("mip.png" 0 6 (org-no-description t
org-protected t fontified nil help-echo "LINK: file:mip.png" hilit-chg
hilit-chg font-lock-fontified t org-caption nil org-caption-shortn nil
org-attributes #("width=0.8\\linewidth" 0 19 ...) org-label nil face org-link
org-attr nil) 6 7 (org-no-description t org-protected t fontified nil help-echo
"LINK: file:mip.png" hilit-chg hilit-chg rear-nonsticky (mouse-face highlight
keymap invisible intangible help-echo org-linked-text) font-lock-fontified t
org-caption nil org-caption-shortn nil org-attributes #("width=0.8\\linewidth"
0 19 ...) org-label nil face org-link org-attr nil)) nil nil
#("width=0.8\\linewidth" 0 19 (fontified nil hilit-chg hilit-chg
font-lock-fontified t)) nil)
| (insert (org-export-latex-format-image raw-path caption label attr shortn))
| (cond ((and imgp ...) (insert ...)) (coderefp (insert ...)) (radiop (insert
...)) ((not type) (insert ...)) (path (when ... ...) (insert ...)) ((functionp
...) (insert ...)) (t (insert "\\texttt{" desc "}")))
| (let* ((re-radio org-export-latex-all-targets-re) (remove ...) (raw-path
...) (full-raw-path ...) (desc ...) (type ...) (coderefp ...) (caption ...)
(shortn ...) (attr ...) (label ...) imgp radiop fnc (path ...)) (apply (quote
delete-region) remove) (setq caption (and caption ...)) (cond (... ...)
(coderefp ...) (radiop ...) (... ...) (path ... ...) (... ...) (t ...)))
| (if (get-text-property (1- ...) (quote org-protected)) nil (goto-char
(match-beginning 0)) (let* (... ... ... ... ... ... ... ... ... ... ... imgp
radiop fnc ...) (apply ... remove) (setq caption ...) (cond ... ... ... ... ...
... ...)))
| (unless (get-text-property (1- ...) (quote org-protected)) (goto-char
(match-beginning 0)) (let* (... ... ... ... ... ... ... ... ... ... ... imgp
radiop fnc ...) (apply ... remove) (setq caption ...) (cond ... ... ... ... ...
... ...)))
| (org-if-unprotected-1 (goto-char (match-beginning 0)) (let* (... ... ...
... ... ... ... ... ... ... ... imgp radiop fnc ...) (apply ... remove) (setq
caption ...) (cond ... ... ... ... ... ... ...)))
| (while (re-search-forward org-bracket-link-analytic-regexp++ nil t)
(org-if-unprotected-1 (goto-char ...) (let* ... ... ... ...)))
| org-export-latex-links()
| (if (memq (quote links) exclude-list) nil (org-export-latex-links))
| (unless (memq (quote links) exclude-list) (org-export-latex-links))
| (progn (insert content) (unless (memq ... exclude-list)
(org-export-latex-time-stamps)) (unless (memq ... exclude-list)
(org-export-latex-quotation-marks)) (unless (memq ... exclude-list) (when ...
...)) (unless (memq ... exclude-list) (org-export-latex-special-chars ...))
(unless (memq ... exclude-list) (org-export-latex-links)) (unless (memq ...
exclude-list) (org-export-latex-keywords)) (unless (memq ... exclude-list)
(org-export-latex-lists)) (unless (memq ... exclude-list)
(org-export-latex-tables ...)) (unless (memq ... exclude-list)
(org-export-latex-fixed-width ...)) (buffer-substring (point-min) (point-max)))
| (unwind-protect (progn (insert content) (unless ... ...) (unless ... ...)
(unless ... ...) (unless ... ...) (unless ... ...) (unless ... ...) (unless ...
...) (unless ... ...) (unless ... ...) (buffer-substring ... ...)) (and
(buffer-name temp-buffer) (kill-buffer temp-buffer)))
| (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ...
... ... ... ... ... ... ... ... ... ...) (and ... ...)))
| (with-current-buffer temp-buffer (unwind-protect (progn ... ... ... ... ...
... ... ... ... ... ...) (and ... ...)))
| (let ((temp-buffer ...)) (with-current-buffer temp-buffer (unwind-protect
... ...)))
| (with-temp-buffer (insert content) (unless (memq ... exclude-list)
(org-export-latex-time-stamps)) (unless (memq ... exclude-list)
(org-export-latex-quotation-marks)) (unless (memq ... exclude-list) (when ...
...)) (unless (memq ... exclude-list) (org-export-latex-special-chars ...))
(unless (memq ... exclude-list) (org-export-latex-links)) (unless (memq ...
exclude-list) (org-export-latex-keywords)) (unless (memq ... exclude-list)
(org-export-latex-lists)) (unless (memq ... exclude-list)
(org-export-latex-tables ...)) (unless (memq ... exclude-list)
(org-export-latex-fixed-width ...)) (buffer-substring (point-min) (point-max)))
| org-export-latex-content(#("\n\n [[file:mip.png][file:mip.png]]\n
\n\\begin{verbatim}\n (format \"%s\\n%s\" (org-version)
(emacs-version))\n\\end{verbatim}\n\n\n" 0 2 (fontified nil) 2 3 (fontified nil
hilit-chg hilit-chg-delete font-lock-fontified t org-caption nil
org-caption-shortn nil org-attributes #("width=0.8\\linewidth" 0 19 ...)
org-label nil) 3 4 (fontified nil font-lock-fontified t org-caption nil
org-caption-shortn nil org-attributes #("width=0.8\\linewidth" 0 19 ...)
org-label nil) 4 6 (face org-link) 6 11 (org-no-description t org-protected t
fontified nil help-echo "LINK: file:mip.png" font-lock-fontified t org-caption
nil org-caption-shortn nil org-attributes #("width=0.8\\linewidth" 0 19 ...)
org-label nil face org-link) 11 17 (org-no-description t org-protected t
fontified nil help-echo "LINK: file:mip.png" hilit-chg hilit-chg
font-lock-fontified t org-caption nil org-caption-shortn nil org-attributes
#("width=0.8\\linewidth" 0 19 ...) org-label nil face org-link) 17 18
(org-no-description t org-protected t fontified nil help-echo "LINK:
file:mip.png" hilit-chg hilit-chg rear-nonsticky (mouse-face highlight keymap
invisible intangible help-echo org-linked-text) font-lock-fontified t
org-caption nil org-caption-shortn nil org-attributes #("width=0.8\\linewidth"
0 19 ...) org-label nil face org-link) 18 19 (face org-link) 19 20 (face
org-link) 20 25 (org-label nil org-attributes #("width=0.8\\linewidth" 0 19
...) org-caption-shortn nil org-caption nil font-lock-fontified t help-echo
"LINK: file:mip.png" fontified nil face org-link) 25 31 (org-label nil
org-attributes #("width=0.8\\linewidth" 0 19 ...) org-caption-shortn nil
org-caption nil font-lock-fontified t hilit-chg hilit-chg help-echo "LINK:
file:mip.png" fontified nil face org-link) 31 32 (org-label nil org-attributes
#("width=0.8\\linewidth" 0 19 ...) org-caption-shortn nil org-caption nil
font-lock-fontified t rear-nonsticky (mouse-face highlight keymap invisible
intangible help-echo org-linked-text) hilit-chg hilit-chg help-echo "LINK:
file:mip.png" fontified nil face org-link) 32 33 (face org-link) 33 34 (face
org-link) 34 35 (fontified nil) 35 37 (fontified nil) 37 38 (fontified nil) 38
48 (org-example t org-protected t original-indentation 0) 48 120 (org-example t
org-protected t original-indentation 0) 120 121 (fontified nil hilit-chg
hilit-chg) 121 122 (fontified nil hilit-chg hilit-chg)))
| (insert (org-export-latex-content content))
| (let* ((sec ...) start end) (if (consp ...) (setq start ... end ...) (setq
start ...)) (insert (format start ... ...)) (insert "\n") (when label (insert
... "\n")) (insert (org-export-latex-content content)) (cond (... ...) (... ...
...)) (when (and end ...) (let ... ...) (insert end "\n")))
| (cond ((<= level depth) (let* ... ... ... ... ... ... ... ...)) ((> level
depth) (cond ... ... ... ...)))
| (let* ((heading ...) (level ...) (occur ...) (content ...) (subcontent ...)
(label ...) (label-list ...) (sectioning org-export-latex-sectioning) (depth
org-export-latex-sectioning-depth) main-heading sub-heading) (when (symbolp
...) (setq sectioning ...) (when sectioning ...) (if sectioning ...) (setq
depth ...)) (if (string-match "[ ]*\\\\\\\\[ ]*" heading) (setq
main-heading ... sub-heading ...)) (setq heading
(org-export-latex-fontify-headline heading) sub-heading (and sub-heading ...)
main-heading (and main-heading ...)) (cond (... ...) (... ...)))
| org-export-latex-subcontent(((pos . 2) (level . 1) (occur . 1) (heading .
#(" problem with latex export " 1 2 ... 2 26 ...)) (content . #("\n\n
[[file:mip.png][file:mip.png]]\n \n\\begin{verbatim}\n (format \"%s\\n%s\"
(org-version) (emacs-version))\n\\end{verbatim}\n\n\n" 0 2 ... 2 3 ... 3 4 ...
4 6 ... 6 11 ... 11 17 ... 17 18 ... 18 19 ... 19 20 ... 20 25 ... 25 31 ... 31
32 ... 32 33 ... 33 34 ... 34 35 ... 35 37 ... 37 38 ... 38 48 ... 48 120 ...
120 121 ... 121 122 ...)) (subcontent)) t)
| (lambda (x) (org-export-latex-subcontent x num))(((pos . 2) (level . 1)
(occur . 1) (heading . #(" problem with latex export " 1 2 ... 2 26 ...))
(content . #("\n\n [[file:mip.png][file:mip.png]]\n \n\\begin{verbatim}\n
(format \"%s\\n%s\" (org-version) (emacs-version))\n\\end{verbatim}\n\n\n" 0 2
... 2 3 ... 3 4 ... 4 6 ... 6 11 ... 11 17 ... 17 18 ... 18 19 ... 19 20 ... 20
25 ... 25 31 ... 31 32 ... 32 33 ... 33 34 ... 34 35 ... 35 37 ... 37 38 ... 38
48 ... 48 120 ... 120 121 ... 121 122 ...)) (subcontent)))
| mapc((lambda (x) (org-export-latex-subcontent x num)) (((pos . 2) (level .
1) (occur . 1) (heading . #(" problem with latex export " 1 2 ... 2 26 ...))
(content . #("\n\n [[file:mip.png][file:mip.png]]\n \n\\begin{verbatim}\n
(format \"%s\\n%s\" (org-version) (emacs-version))\n\\end{verbatim}\n\n\n" 0 2
... 2 3 ... 3 4 ... 4 6 ... 6 11 ... 11 17 ... 17 18 ... 18 19 ... 19 20 ... 20
25 ... 25 31 ... 31 32 ... 32 33 ... 33 34 ... 34 35 ... 35 37 ... 37 38 ... 38
48 ... 48 120 ... 120 121 ... 121 122 ...)) (subcontent))))
| (let ((num ...)) (mapc (lambda ... ...) subcontent))
| org-export-latex-sub((((pos . 2) (level . 1) (occur . 1) (heading . #("
problem with latex export " 1 2 ... 2 26 ...)) (content . #("\n\n
[[file:mip.png][file:mip.png]]\n \n\\begin{verbatim}\n (format \"%s\\n%s\"
(org-version) (emacs-version))\n\\end{verbatim}\n\n\n" 0 2 ... 2 3 ... 3 4 ...
4 6 ... 6 11 ... 11 17 ... 17 18 ... 18 19 ... 19 20 ... 20 25 ... 25 31 ... 31
32 ... 32 33 ... 33 34 ... 34 35 ... 35 37 ... 37 38 ... 38 48 ... 48 120 ...
120 121 ... 121 122 ...)) (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((((... ... ... ... ... ...))))
| (let* ((wcf ...) (opt-plist org-export-latex-options-plist) (region-p ...)
(rbeg ...) (rend ...) (subtree-p ...) (opt-plist ...)
(org-export-latex-options-plist ...) (org-current-export-dir ...)
(org-current-export-file buffer-file-name) (title ...) (filename ...) (filename
...) (buffer ...) (odd org-odd-levels-only) (header ...) (skip ...) (text ...)
(org-export-preprocess-hook ...) (first-lines ...) (coding-system ...)
(coding-system-for-write ...) (save-buffer-coding-system ...) (region ...)
(text ...) (string-for-export ...)) (set-buffer buffer) (erase-buffer)
(org-install-letbind) (and (fboundp ...) (set-buffer-file-coding-system
coding-system-for-write)) (unless (or ... body-only) (insert header)) (when
(and text ...) (insert ... "\n\n")) (unless skip (insert first-lines))
(org-export-latex-global (with-temp-buffer ... ... ...)) (unless body-only
(insert "\n\\end{document}")) (goto-char (point-min)) (while (re-search-forward
"^[ ]*\\\\item\\([ ]+\\)\\[" nil t) (delete-region ... ...)) (goto-char
(point-min)) (when (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
(goto-char ...) (while ... ...) (goto-char ...) (and ... ...)) (goto-char
(point-min)) (while (re-search-forward "^[
]*\\\\item\\>.*\\(\\\\\\\\\\)[ ]*\\(\n\\\\label.*\\)*\n\\\\begin" nil t)
(delete-region ... ...)) (goto-char (point-min)) (while (re-search-forward "^[
]*\\\\item\\>.*\\(\\\\\\\\\\)[ ]*\\(\n\\\\label.*\\)*" nil t) (if ...
...)) (run-hooks (quote org-export-latex-final-hook)) (if to-buffer (unless ...
...) (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 ... ... ...) (set-window-configuration wcf)))
| org-export-as-latex(nil)
| call-interactively(org-export-as-latex)
| (if (and bg (nth 2 ass) (not ...) (not ...)) (let (...)
(set-process-sentinel p ...) (message "Background process \"%s\": started" p))
(if subtree-p (progn ... ...)) (call-interactively (nth 1 ass)) (when (and bpos
...) (let ... ... ... ... ...)))
| (let* ((bg ...) subtree-p (help "[t] insert the export option
template\n[v] limit export to visible part of outline tree\n[1] only export
the current subtree\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 ...) r1 r2 ass
(cpos ...) (cbuf ...) bpos) (save-excursion (save-window-excursion ... ... ...
... ... ... ...)) (and bpos (goto-char bpos)) (setq r2 (if ... ... r1)) (unless
(setq ass ...) (error "No command associated with key %c" r1)) (if (and bg ...
... ...) (let ... ... ...) (if subtree-p ...) (call-interactively ...) (when
... ...)))
| org-export(nil)
| call-interactively(org-export nil nil)
`----
Thanks,
eric
txtc3CUrg2aW8.txt
Description: Text document
--
Eric S Fraga
GnuPG: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D
- [Orgmode] problem exporting an image to latex,
Eric S Fraga <=