From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [latex] Problems with old exporter (for Beamer) and with new exporter Date: Thu, 14 Jun 2012 15:06:31 +0200 Message-ID: <80aa062gbs.fsf@somewhere.org> References: <80ipf2hmdy.fsf@somewhere.org> <87lijwdyte.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello Nicolas, Nicolas Goaziou wrote: > "Sebastien Vauban" writes: > >> With the new exporter, most things work. What does not work: >> - macro does not get executed (no string in orange color), > > Macro are meant to produce contents, not to talk to back-ends. Every text > they produce will be protected. Do you mean the template must be pure text? Do you mean that a thing such as http://frozenlock.org/2011/11/05/on-the-fly-key-sequence-insertion/ won't w= ork anymore? >> - the =3D\end{verbatim}=3D disappears from the LaTeX output > > This is a limitation from LaTeX: you cannot have "\end{verbatim}" string > within a verbatim environment. OK, I thought it would be in a listings. But I did not customize the variab= le `org-e-latex-listings' (well the old exporter one). Though, now, when trying to export to LaTeX (with the new exporter and up-to-date Org[1]), I get an error: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match("^[ ]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ ]*\n?" nil) (if (string-match "^[ ]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ ]*\n?" tpl) (= setq rpl (if (or (match-end 1) (not def-pkg)) "" (org-latex-packages-to-str= ing def-pkg snippets-p t)) tpl (replace-match rpl t t tpl)) (if def-pkg (se= tq end (org-latex-packages-to-string def-pkg snippets-p)))) (let (rpl (end "")) (if (string-match "^[ ]*\\[\\(NO-\\)?DEFAULT-PACKAGE= S\\][ ]*\n?" tpl) (setq rpl (if (or (match-end 1) (not def-pkg)) "" (org-l= atex-packages-to-string def-pkg snippets-p t)) tpl (replace-match rpl t t t= pl)) (if def-pkg (setq end (org-latex-packages-to-string def-pkg snippets-p= )))) (if (string-match "\\[\\(NO-\\)?PACKAGES\\][ ]*\n?" tpl) (setq rpl (i= f (or (match-end 1) (not pkg)) "" (org-latex-packages-to-string pkg snippet= s-p t)) tpl (replace-match rpl t t tpl)) (if pkg (setq end (concat end "\n"= (org-latex-packages-to-string pkg snippets-p))))) (if (string-match "\\[\\= (NO-\\)?EXTRA\\][ ]*\n?" tpl) (setq rpl (if (or (match-end 1) (not extra))= "" (concat extra "\n")) tpl (replace-match rpl t t tpl)) (if (and extra (s= tring-match "\\S-" extra)) (setq end (concat end "\n" extra)))) (if (string= -match "\\S-" end) (concat tpl "\n" end) tpl)) org-splice-latex-header(nil (("" "fixltx2e" nil) ("" "graphicx" t) ("" "l= ongtable" nil) ("" "float" nil) ("" "wrapfig" nil) ("" "soul" t) ("" "marvo= sym" t) ("" "wasysym" t) ("" "latexsym" t) ("" "amssymb" t) ("" "hyperref" = nil) "\\tolerance=3D1000" ("" "listings") ("" "xcolor")) (("AUTO" "inputenc= " t) ("T1" "fontenc" t) ("" "textcomp" t)) nil "\\lstdefinelanguage{org}{%\= nmorekeywords=3D{:results, :session, :var, :noweb, :exports},\nsensitive=3D= false,\nmorestring=3D[b]\",\nmorecomment=3D[l]{\\#},\n}\n\\lstdefinelanguag= e{dot}{%\nmorekeywords=3D{graph},\nsensitive=3Dfalse,\n}\n\\lstset{%\nexten= dedchars=3Dfalse,\ninputencoding=3Dutf8x,\n%\nmathescape=3Dfalse,\nescapech= ar=3D`, % allow escaping to (La)TeX mode within `..`\ncolumns=3Dflexible,\n= keepspaces=3Dtrue,\n%\nliterate=3D\n{=C3=A1}{{\\'a}}1\n{=C3=A0}{{\\`a}}1\n{= =C3=A2}{{\\^a}}1\n{=C3=A4}{{\\\"a}}1\n{=C3=A9}{{\\'e}}1\n{=C3=A8}{{\\`e}}1\= n{=C3=AA}{{\\^e}}1\n{=C3=AB}{{\\\"e}}1\n{=C3=AD}{{\\'i}}1\n{=C3=AC}{{\\`i}}= 1\n{=C3=AE}{{\\^i}}1\n{=C3=AF}{{\\\"i}}1\n{=C3=B3}{{\\'o}}1\n{=C3=B2}{{\\`o= }}1\n{=C3=B4}{{\\^o}}1\n{=C3=B6}{{\\\"o}}1\n{=C3=BA}{{\\'u}}1\n{=C3=B9}{{\\= `u}}1\n{=C3=BB}{{\\^u}}1\n{=C3=BC}{{\\\"u}}1\n}") (org-e-latex--guess-inputenc (org-splice-latex-header document-class-stri= ng org-export-latex-default-packages-alist org-export-latex-packages-alist = nil (plist-get info :latex-header-extra))) (let* ((header (nth 1 (assoc class org-e-latex-classes))) (document-class= -string (and (stringp header) (if class-options (replace-regexp-in-string "= ^[ ]*\\\\documentclass\\(\\[.*?\\]\\)" class-options header t nil 1) heade= r)))) (org-e-latex--guess-inputenc (org-splice-latex-header document-class-= string org-export-latex-default-packages-alist org-export-latex-packages-al= ist nil (plist-get info :latex-header-extra)))) (org-element-normalize-string (let* ((header (nth 1 (assoc class org-e-la= tex-classes))) (document-class-string (and (stringp header) (if class-optio= ns (replace-regexp-in-string "^[ ]*\\\\documentclass\\(\\[.*?\\]\\)" class= -options header t nil 1) header)))) (org-e-latex--guess-inputenc (org-splic= e-latex-header document-class-string org-export-latex-default-packages-alis= t org-export-latex-packages-alist nil (plist-get info :latex-header-extra))= ))) (let ((class (plist-get info :latex-class)) (class-options (plist-get inf= o :latex-class-options))) (org-element-normalize-string (let* ((header (nth= 1 (assoc class org-e-latex-classes))) (document-class-string (and (stringp= header) (if class-options (replace-regexp-in-string "^[ ]*\\\\documentcla= ss\\(\\[.*?\\]\\)" class-options header t nil 1) header)))) (org-e-latex--g= uess-inputenc (org-splice-latex-header document-class-string org-export-lat= ex-default-packages-alist org-export-latex-packages-alist nil (plist-get in= fo :latex-header-extra)))))) (concat (and (plist-get info :time-stamp-file) (format-time-string "%% Cr= eated %Y-%m-%d %a %H:%M\n")) (let ((class (plist-get info :latex-class)) (c= lass-options (plist-get info :latex-class-options))) (org-element-normalize= -string (let* ((header (nth 1 (assoc class org-e-latex-classes))) (document= -class-string (and (stringp header) (if class-options ... header)))) (org-e= -latex--guess-inputenc (org-splice-latex-header document-class-string org-e= xport-latex-default-packages-alist org-export-latex-packages-alist nil (pli= st-get info :latex-header-extra)))))) "\\providecommand{\\alert}[1]{\\textb= f{#1}}\n" (let ((sec-num (plist-get info :section-numbers))) (when (integer= p sec-num) (format "\\setcounter{secnumdepth}{%d}\n" sec-num))) (let ((auth= or (and (plist-get info :with-author) (let ((auth ...)) (and auth (org-expo= rt-data auth info))))) (email (and (plist-get info :with-email) (org-export= -data (plist-get info :email) info)))) (cond ((and author email (not (strin= g=3D "" email))) (format "\\author{%s\\thanks{%s}}\n" author email)) (autho= r (format "\\author{%s}\n" author)) (t "\\author{}\n"))) (let ((date (plist= -get info :date))) (and date (format "\\date{%s}\n" date))) (format "\\titl= e{%s}\n" title) (format "\\hypersetup{\n pdfkeywords=3D{%s},\n pdfsubject= =3D{%s},\n pdfcreator=3D{%s}}\n" (or (plist-get info :keywords) "") (or (p= list-get info :description) "") (if (not (plist-get info :with-creator)) ""= (plist-get info :creator))) "\\begin{document}\n\n" (org-element-normalize= -string (cond ((string=3D "" title) nil) ((not (stringp org-e-latex-title-c= ommand)) nil) ((string-match "\\(?:[^%]\\|^\\)%s" org-e-latex-title-command= ) (format org-e-latex-title-command title)) (t org-e-latex-title-command)))= (let ((depth (plist-get info :with-toc))) (when depth (concat (when (whole= nump depth) (format "\\setcounter{tocdepth}{%d}\n" depth)) "\\tableofconten= ts\n\\vspace*{1cm}\n\n"))) contents (let ((creator-info (plist-get info :wi= th-creator))) (cond ((not creator-info) "") ((eq creator-info (quote commen= t)) (format "%% %s\n" (plist-get info :creator))) (t (concat (plist-get inf= o :creator) "\n")))) "\\end{document}") (let ((title (org-export-data (plist-get info :title) info))) (concat (an= d (plist-get info :time-stamp-file) (format-time-string "%% Created %Y-%m-%= d %a %H:%M\n")) (let ((class (plist-get info :latex-class)) (class-options = (plist-get info :latex-class-options))) (org-element-normalize-string (let*= ((header (nth 1 ...)) (document-class-string (and ... ...))) (org-e-latex-= -guess-inputenc (org-splice-latex-header document-class-string org-export-l= atex-default-packages-alist org-export-latex-packages-alist nil (plist-get = info :latex-header-extra)))))) "\\providecommand{\\alert}[1]{\\textbf{#1}}\= n" (let ((sec-num (plist-get info :section-numbers))) (when (integerp sec-n= um) (format "\\setcounter{secnumdepth}{%d}\n" sec-num))) (let ((author (and= (plist-get info :with-author) (let (...) (and auth ...)))) (email (and (pl= ist-get info :with-email) (org-export-data (plist-get info :email) info))))= (cond ((and author email (not (string=3D "" email))) (format "\\author{%s\= \thanks{%s}}\n" author email)) (author (format "\\author{%s}\n" author)) (t= "\\author{}\n"))) (let ((date (plist-get info :date))) (and date (format "= \\date{%s}\n" date))) (format "\\title{%s}\n" title) (format "\\hypersetup{= \n pdfkeywords=3D{%s},\n pdfsubject=3D{%s},\n pdfcreator=3D{%s}}\n" (or = (plist-get info :keywords) "") (or (plist-get info :description) "") (if (n= ot (plist-get info :with-creator)) "" (plist-get info :creator))) "\\begin{= document}\n\n" (org-element-normalize-string (cond ((string=3D "" title) ni= l) ((not (stringp org-e-latex-title-command)) nil) ((string-match "\\(?:[^%= ]\\|^\\)%s" org-e-latex-title-command) (format org-e-latex-title-command ti= tle)) (t org-e-latex-title-command))) (let ((depth (plist-get info :with-to= c))) (when depth (concat (when (wholenump depth) (format "\\setcounter{tocd= epth}{%d}\n" depth)) "\\tableofcontents\n\\vspace*{1cm}\n\n"))) contents (l= et ((creator-info (plist-get info :with-creator))) (cond ((not creator-info= ) "") ((eq creator-info (quote comment)) (format "%% %s\n" (plist-get info = :creator))) (t (concat (plist-get info :creator) "\n")))) "\\end{document}"= )) org-e-latex-template("\n\\begin{enumerate}\n\\item Contexte\n\\label{sec-= 1}\n\nI want to write a document where I show:\n\n\\begin{itemize}\n\\item = Org code to type in a buffer\n\\item (sometimes) its \\LaTeX{} translation\= n\\item its effect in the output PDF\n\\end{itemize}\n\nThough, I have big = troubles outputting the Org code one is suppose to write in\nthe Org buffer= s. It often gets replaced or modified\\ldots{} See examples in the\nfollowi= ng ECM.\n\nWith the old exporter (necessary for Beamer), all the below case= s fail\\ldots{}\n\nWith the new exporter, most things work. What does not w= ork:\n\\begin{itemize}\n\\item macro does not get executed (no string in or= ange color),\n\\item the \\texttt{\\textbackslash{}end\\{verbatim\\}} disap= pears from the \\LaTeX{} output\n\\end{itemize}\n\n\\item Macros\n\\label{s= ec-2}\n\n\\begin{itemize}\n\\item With the following macro definition\n\n\\= begin{verbatim}\n #+MACRO: key \\textcolor{orange}{\\texttt{$1}}\n\\end{ve= rbatim}\n\n\\item Every time we write\n\n\\begin{verbatim}\n {{{key(C-c C-= e)}}}\n\\end{verbatim}\n\nHERE ABOVE, WE SHOULD SEE THE MACRO NAME AND PARA= METER INSIDE CURLY\nBRACKETS. INSTEAD, WE SEE THE LATEX REPLACEMENT CODE.\n= \n\\item We get $\\backslash$textcolor\\{orange\\}\\{$\\backslash$texttt\\{= C-c C-e\\}\\}\n\\end{itemize}\n\n\\item Listings informatiques\n\\label{sec= -3}\n\n\\begin{itemize}\n\\item To input a block of code in Org, type it li= ke this:\n\\end{itemize}\n\n\\begin{verbatim}\n#+begin_src sql\nSELECT *\nF= ROM inventory\nWHERE product =3D 'ABC123'\n#+end_src\n\\end{verbatim}\n\nHE= RE, WE SHOULD SEE \\texttt{\\#+begin\\_src sql}. INSTEAD, WE SEE \\texttt{\= \textbackslash{}begin\\{\\}sql}.\n\n\\begin{itemize}\n\\item And see the ni= ce listing:\n\\end{itemize}\n\n\\begin{verbatim}\nSELECT *\nFROM inventory\= nWHERE product =3D 'ABC123'\n\\end{verbatim}\n\n\\item Verbatim\n\\label{se= c-4}\n\n\\begin{itemize}\n\\item Same problem for verbatim\\ldots{} Here, t= he Org code\n\\end{itemize}\n\n\\begin{verbatim}\n#+begin_verbatim\nverbati= m d i s p l a y s with spaces!\n#+end_verbatim\n\\end{verbatim}\n\nHERE, = THE META LINE IS CONVERTED INTO ITS LATEX FORM.\n\n\\begin{itemize}\n\\item= And its translation into \\LaTeX{}:\n\\end{itemize}\n\n\\begin{verbatim}\n= \\begin{verbatim}\nverbatim d i s p l a y s with spaces!\n\\end{verbatim}= \n\\end{verbatim}\n\n\\item Comment\n\\label{sec-5}\n\nIt is also impossibl= e to show how to type a comment block:\n\n\\begin{verbatim}\n#+begin_commen= t\nQuelques paragraphes qui ne vont pas appara=C3=AEtre dans le PDF.\n#+end= _comment\n\\end{verbatim}\n\nTHE ABOVE NEVER IS SHOWN!\n\\end{enumerate}\n"= (:author "Fabrice Niessen" :creator "Generated by Org mode 7.8.11 in Emacs= 24.1.1." :date "\\today" :description nil :email "fni-djc/iPCCuDYQheJpep6IeZlAfpA4pxzR@public.gmane.org= m" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "e= n" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-st= amp-file t :title ("Org mode examples") :with-archived-trees headline :with= -author t :with-clocks nil :with-creator nil :with-drawers nil :with-email = nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes = t :with-plannings nil ...)) funcall(org-e-latex-template "\n\\begin{enumerate}\n\\item Contexte\n\\la= bel{sec-1}\n\nI want to write a document where I show:\n\n\\begin{itemize}\= n\\item Org code to type in a buffer\n\\item (sometimes) its \\LaTeX{} tran= slation\n\\item its effect in the output PDF\n\\end{itemize}\n\nThough, I h= ave big troubles outputting the Org code one is suppose to write in\nthe Or= g buffers. It often gets replaced or modified\\ldots{} See examples in the\= nfollowing ECM.\n\nWith the old exporter (necessary for Beamer), all the be= low cases fail\\ldots{}\n\nWith the new exporter, most things work. What do= es not work:\n\\begin{itemize}\n\\item macro does not get executed (no stri= ng in orange color),\n\\item the \\texttt{\\textbackslash{}end\\{verbatim\\= }} disappears from the \\LaTeX{} output\n\\end{itemize}\n\n\\item Macros\n\= \label{sec-2}\n\n\\begin{itemize}\n\\item With the following macro definiti= on\n\n\\begin{verbatim}\n #+MACRO: key \\textcolor{orange}{\\texttt{$1}}\n= \\end{verbatim}\n\n\\item Every time we write\n\n\\begin{verbatim}\n {{{ke= y(C-c C-e)}}}\n\\end{verbatim}\n\nHERE ABOVE, WE SHOULD SEE THE MACRO NAME = AND PARAMETER INSIDE CURLY\nBRACKETS. INSTEAD, WE SEE THE LATEX REPLACEMENT= CODE.\n\n\\item We get $\\backslash$textcolor\\{orange\\}\\{$\\backslash$t= exttt\\{C-c C-e\\}\\}\n\\end{itemize}\n\n\\item Listings informatiques\n\\l= abel{sec-3}\n\n\\begin{itemize}\n\\item To input a block of code in Org, ty= pe it like this:\n\\end{itemize}\n\n\\begin{verbatim}\n#+begin_src sql\nSEL= ECT *\nFROM inventory\nWHERE product =3D 'ABC123'\n#+end_src\n\\end{verbati= m}\n\nHERE, WE SHOULD SEE \\texttt{\\#+begin\\_src sql}. INSTEAD, WE SEE \\= texttt{\\textbackslash{}begin\\{\\}sql}.\n\n\\begin{itemize}\n\\item And se= e the nice listing:\n\\end{itemize}\n\n\\begin{verbatim}\nSELECT *\nFROM in= ventory\nWHERE product =3D 'ABC123'\n\\end{verbatim}\n\n\\item Verbatim\n\\= label{sec-4}\n\n\\begin{itemize}\n\\item Same problem for verbatim\\ldots{}= Here, the Org code\n\\end{itemize}\n\n\\begin{verbatim}\n#+begin_verbatim\= nverbatim d i s p l a y s with spaces!\n#+end_verbatim\n\\end{verbatim}\n= \nHERE, THE META LINE IS CONVERTED INTO ITS LATEX FORM.\n\n\\begin{itemize}= \n\\item And its translation into \\LaTeX{}:\n\\end{itemize}\n\n\\begin{ver= batim}\n\\begin{verbatim}\nverbatim d i s p l a y s with spaces!\n\\end{v= erbatim}\n\\end{verbatim}\n\n\\item Comment\n\\label{sec-5}\n\nIt is also i= mpossible to show how to type a comment block:\n\n\\begin{verbatim}\n#+begi= n_comment\nQuelques paragraphes qui ne vont pas appara=C3=AEtre dans le PDF= .\n#+end_comment\n\\end{verbatim}\n\nTHE ABOVE NEVER IS SHOWN!\n\\end{enume= rate}\n" (:author "Fabrice Niessen" :creator "Generated by Org mode 7.8.11 = in Emacs 24.1.1." :date "\\today" :description nil :email "fni@missioncriti= calit.com" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :lan= guage "en" :preserve-breaks nil :section-numbers t :select-tags ("export") = :time-stamp-file t :title ("Org mode examples") :with-archived-trees headli= ne :with-author t :with-clocks nil :with-creator nil :with-drawers nil :wit= h-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-fo= otnotes t :with-plannings nil ...)) (if (or (not (fboundp template)) body-only) body (funcall template body i= nfo)) (org-export-filter-apply-functions (plist-get info :filter-final-output) = (if (or (not (fboundp template)) body-only) body (funcall template body inf= o)) info) (let* ((body (org-element-normalize-string (org-export-data tree info))) = (template (cdr (assq (quote template) (plist-get info :translate-alist)))) = (output (org-export-filter-apply-functions (plist-get info :filter-final-ou= tput) (if (or (not (fboundp template)) body-only) body (funcall template bo= dy info)) info))) (when org-export-copy-to-kill-ring (org-kill-new output))= output) (let ((info (org-export-install-filters (org-export-get-environment backe= nd subtreep ext-plist))) (tree (let ((buf (or (buffer-file-name ...) (curre= nt-buffer)))) (org-export-with-current-buffer-copy (unless noexpand (org-ex= port-expand-include-keyword) (let (...) (org-export-blocks-preprocess))) (g= oto-char (point-min)) (let ((org-export-current-backend backend)) (run-hook= s (quote org-export-before-parsing-hook))) (org-element-parse-buffer nil vi= sible-only))))) (setq tree (org-export-filter-apply-functions (plist-get in= fo :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org= -export-collect-tree-properties tree info))) (let* ((body (org-element-norm= alize-string (org-export-data tree info))) (template (cdr (assq (quote temp= late) (plist-get info :translate-alist)))) (output (org-export-filter-apply= -functions (plist-get info :filter-final-output) (if (or (not ...) body-onl= y) body (funcall template body info)) info))) (when org-export-copy-to-kill= -ring (org-kill-new output)) output)) (save-restriction (cond ((org-region-active-p) (narrow-to-region (region-= beginning) (region-end))) (subtreep (org-narrow-to-subtree) (goto-char (poi= nt-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let ((inf= o (org-export-install-filters (org-export-get-environment backend subtreep = ext-plist))) (tree (let ((buf (or ... ...))) (org-export-with-current-buffe= r-copy (unless noexpand (org-export-expand-include-keyword) (let ... ...)) = (goto-char (point-min)) (let (...) (run-hooks ...)) (org-element-parse-buff= er nil visible-only))))) (setq tree (org-export-filter-apply-functions (pli= st-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists = info (org-export-collect-tree-properties tree info))) (let* ((body (org-ele= ment-normalize-string (org-export-data tree info))) (template (cdr (assq (q= uote template) (plist-get info :translate-alist)))) (output (org-export-fil= ter-apply-functions (plist-get info :filter-final-output) (if (or ... body-= only) body (funcall template body info)) info))) (when org-export-copy-to-k= ill-ring (org-kill-new output)) output))) (save-excursion (save-restriction (cond ((org-region-active-p) (narrow-to= -region (region-beginning) (region-end))) (subtreep (org-narrow-to-subtree)= (goto-char (point-min)) (forward-line) (narrow-to-region (point) (point-ma= x)))) (let ((info (org-export-install-filters (org-export-get-environment b= ackend subtreep ext-plist))) (tree (let ((buf ...)) (org-export-with-curren= t-buffer-copy (unless noexpand ... ...) (goto-char ...) (let ... ...) (org-= element-parse-buffer nil visible-only))))) (setq tree (org-export-filter-ap= ply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (o= rg-combine-plists info (org-export-collect-tree-properties tree info))) (le= t* ((body (org-element-normalize-string (org-export-data tree info))) (temp= late (cdr (assq ... ...))) (output (org-export-filter-apply-functions (plis= t-get info :filter-final-output) (if ... body ...) info))) (when org-export= -copy-to-kill-ring (org-kill-new output)) output)))) org-export-as(e-latex nil nil nil nil nil) (let ((out (org-export-as backend subtreep visible-only body-only ext-pli= st noexpand))) (with-temp-buffer (insert out) (let ((coding-system-for-writ= e org-export-coding-system)) (write-file file)))) org-export-to-file(e-latex "c:/home/sva/Examples/Org-scraps/ecm-Org-code-= blocks-doc.tex" nil nil nil nil) (let ((outfile (org-export-output-file-name ".tex" subtreep pub-dir))) (o= rg-export-to-file (quote e-latex) outfile subtreep visible-only body-only e= xt-plist)) org-e-latex-export-to-latex(nil nil nil nil nil) (org-e-latex-compile (org-e-latex-export-to-latex subtreep visible-only b= ody-only ext-plist pub-dir)) org-e-latex-export-to-pdf(nil nil nil) (org-open-file (org-e-latex-export-to-pdf (memq (quote subtree) optns) (m= emq (quote visible) optns) (memq (quote body) optns))) (cond ((eql --cl-var-- (quote 113)) nil) ((member* --cl-var-- (quote (65 = 78 85))) (require (quote org-e-ascii)) (let ((outbuf (org-export-to-buffer = (quote e-ascii) "*Org E-ASCII Export*" (memq (quote subtree) optns) (memq (= quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset ...))))= ) (with-current-buffer outbuf (text-mode)) (when org-export-show-temporary-= export-buffer (switch-to-buffer-other-window outbuf)))) ((member* --cl-var-= - (quote (97 110 117))) (require (quote org-e-ascii)) (org-e-ascii-export-t= o-ascii (memq (quote subtree) optns) (memq (quote visible) optns) (memq (qu= ote body) optns) (\` (:ascii-charset (\, (case raw-key (97 ...) (110 ...) (= t ...))))))) ((eql --cl-var-- (quote 76)) (require (quote org-e-latex)) (le= t ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (me= mq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) o= ptns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-te= mporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-= var-- (quote 108)) (require (quote org-e-latex)) (org-e-latex-export-to-lat= ex (require (quote org-e-latex)) (memq (quote subtree) optns) (memq (quote = visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 112)) (= require (quote org-e-latex)) (org-e-latex-export-to-pdf (memq (quote subtre= e) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --= cl-var-- (quote 100)) (require (quote org-e-latex)) (org-open-file (org-e-l= atex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns= ) (memq (quote body) optns)))) ((eql --cl-var-- (quote 72)) (require (quote= org-e-html)) (let ((outbuf (org-export-to-buffer (quote e-html) "*Org E-HT= ML Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq= (quote body) optns)))) (with-current-buffer outbuf (if (featurep (quote nx= html-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-exp= ort-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-- (quot= e 104)) (require (quote org-e-html)) (org-e-html-export-to-html (memq (quot= e subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) = ((eql --cl-var-- (quote 98)) (require (quote org-e-html)) (org-open-file (o= rg-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible)= optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 111)) (require= (quote org-e-odt)) (org-e-odt-export-to-odt (memq (quote subtree) optns) (= memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (q= uote 79)) (require (quote org-e-odt)) (org-open-file (org-e-odt-export-to-o= dt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote b= ody) optns)))) ((eql --cl-var-- (quote 70)) (require (quote org-e-publish))= (org-e-publish-current-file (memq (quote force) optns))) ((eql --cl-var-- = (quote 80)) (require (quote org-e-publish)) (org-e-publish-current-project = (memq (quote force) optns))) ((eql --cl-var-- (quote 88)) (require (quote o= rg-e-publish)) (let ((project (assoc (org-icompleting-read "Publish project= : " org-e-publish-project-alist nil t) org-e-publish-project-alist))) (org-= e-publish project (memq (quote force) optns)))) ((eql --cl-var-- (quote 69)= ) (require (quote org-e-publish)) (org-e-publish-all (memq (quote force) op= tns))) (t (error "No command associated with key %s" (char-to-string raw-ke= y)))) (let ((--cl-var-- (if (< raw-key 27) (+ raw-key 96) raw-key))) (cond ((eq= l --cl-var-- (quote 113)) nil) ((member* --cl-var-- (quote (65 78 85))) (re= quire (quote org-e-ascii)) (let ((outbuf (org-export-to-buffer (quote e-asc= ii) "*Org E-ASCII Export*" (memq ... optns) (memq ... optns) (memq ... optn= s) (\` ...)))) (with-current-buffer outbuf (text-mode)) (when org-export-sh= ow-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((memb= er* --cl-var-- (quote (97 110 117))) (require (quote org-e-ascii)) (org-e-a= scii-export-to-ascii (memq (quote subtree) optns) (memq (quote visible) opt= ns) (memq (quote body) optns) (\` (:ascii-charset (\, (case raw-key ... ...= ...)))))) ((eql --cl-var-- (quote 76)) (require (quote org-e-latex)) (let = ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (memq= ... optns) (memq ... optns) (memq ... optns)))) (with-current-buffer outbu= f (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-bu= ffer-other-window outbuf)))) ((eql --cl-var-- (quote 108)) (require (quote = org-e-latex)) (org-e-latex-export-to-latex (require (quote org-e-latex)) (m= emq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) = optns))) ((eql --cl-var-- (quote 112)) (require (quote org-e-latex)) (org-e= -latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) opt= ns) (memq (quote body) optns))) ((eql --cl-var-- (quote 100)) (require (quo= te org-e-latex)) (org-open-file (org-e-latex-export-to-pdf (memq (quote sub= tree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eq= l --cl-var-- (quote 72)) (require (quote org-e-html)) (let ((outbuf (org-ex= port-to-buffer (quote e-html) "*Org E-HTML Export*" (memq ... optns) (memq = ... optns) (memq ... optns)))) (with-current-buffer outbuf (if (featurep (q= uote nxhtml-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-tempor= ary-export-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-= - (quote 104)) (require (quote org-e-html)) (org-e-html-export-to-html (mem= q (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) op= tns))) ((eql --cl-var-- (quote 98)) (require (quote org-e-html)) (org-open-= file (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote v= isible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 111)) (= require (quote org-e-odt)) (org-e-odt-export-to-odt (memq (quote subtree) o= ptns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-v= ar-- (quote 79)) (require (quote org-e-odt)) (org-open-file (org-e-odt-expo= rt-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (= quote body) optns)))) ((eql --cl-var-- (quote 70)) (require (quote org-e-pu= blish)) (org-e-publish-current-file (memq (quote force) optns))) ((eql --cl= -var-- (quote 80)) (require (quote org-e-publish)) (org-e-publish-current-p= roject (memq (quote force) optns))) ((eql --cl-var-- (quote 88)) (require (= quote org-e-publish)) (let ((project (assoc (org-icompleting-read "Publish = project: " org-e-publish-project-alist nil t) org-e-publish-project-alist))= ) (org-e-publish project (memq (quote force) optns)))) ((eql --cl-var-- (qu= ote 69)) (require (quote org-e-publish)) (org-e-publish-all (memq (quote fo= rce) optns))) (t (error "No command associated with key %s" (char-to-string= raw-key))))) (case (if (< raw-key 27) (+ raw-key 96) raw-key) (113 nil) ((65 78 85) (r= equire (quote org-e-ascii)) (let ((outbuf (org-export-to-buffer (quote e-as= cii) "*Org E-ASCII Export*" (memq (quote subtree) optns) (memq (quote visib= le) optns) (memq (quote body) optns) (\` (:ascii-charset ...))))) (with-cur= rent-buffer outbuf (text-mode)) (when org-export-show-temporary-export-buff= er (switch-to-buffer-other-window outbuf)))) ((97 110 117) (require (quote = org-e-ascii)) (org-e-ascii-export-to-ascii (memq (quote subtree) optns) (me= mq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset (\,= (case raw-key (97 ...) (110 ...) (t ...))))))) (76 (require (quote org-e-l= atex)) (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Ex= port*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quo= te body) optns)))) (with-current-buffer outbuf (latex-mode)) (when org-expo= rt-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) (= 108 (require (quote org-e-latex)) (org-e-latex-export-to-latex (require (qu= ote org-e-latex)) (memq (quote subtree) optns) (memq (quote visible) optns)= (memq (quote body) optns))) (112 (require (quote org-e-latex)) (org-e-late= x-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (= memq (quote body) optns))) (100 (require (quote org-e-latex)) (org-open-fil= e (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visi= ble) optns) (memq (quote body) optns)))) (72 (require (quote org-e-html)) (= let ((outbuf (org-export-to-buffer (quote e-html) "*Org E-HTML Export*" (me= mq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) o= ptns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode)) (nx= html-mode) (nxml-mode))) (when org-export-show-temporary-export-buffer (swi= tch-to-buffer-other-window outbuf)))) (104 (require (quote org-e-html)) (or= g-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) = optns) (memq (quote body) optns))) (98 (require (quote org-e-html)) (org-op= en-file (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quot= e visible) optns) (memq (quote body) optns)))) (111 (require (quote org-e-o= dt)) (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote vis= ible) optns) (memq (quote body) optns))) (79 (require (quote org-e-odt)) (o= rg-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (q= uote visible) optns) (memq (quote body) optns)))) (70 (require (quote org-e= -publish)) (org-e-publish-current-file (memq (quote force) optns))) (80 (re= quire (quote org-e-publish)) (org-e-publish-current-project (memq (quote fo= rce) optns))) (88 (require (quote org-e-publish)) (let ((project (assoc (or= g-icompleting-read "Publish project: " org-e-publish-project-alist nil t) o= rg-e-publish-project-alist))) (org-e-publish project (memq (quote force) op= tns)))) (69 (require (quote org-e-publish)) (org-e-publish-all (memq (quote= force) optns))) (t (error "No command associated with key %s" (char-to-str= ing raw-key)))) (let* ((input (org-export-dispatch-ui (if (listp org-export-initial-scope= ) org-export-initial-scope (list org-export-initial-scope)) org-export-disp= atch-use-expert-ui)) (raw-key (car input)) (optns (cdr input))) (case (if (= < raw-key 27) (+ raw-key 96) raw-key) (113 nil) ((65 78 85) (require (quote= org-e-ascii)) (let ((outbuf (org-export-to-buffer (quote e-ascii) "*Org E-= ASCII Export*" (memq ... optns) (memq ... optns) (memq ... optns) (\` ...))= )) (with-current-buffer outbuf (text-mode)) (when org-export-show-temporary= -export-buffer (switch-to-buffer-other-window outbuf)))) ((97 110 117) (req= uire (quote org-e-ascii)) (org-e-ascii-export-to-ascii (memq (quote subtree= ) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii= -charset (\, (case raw-key ... ... ...)))))) (76 (require (quote org-e-late= x)) (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Expor= t*" (memq ... optns) (memq ... optns) (memq ... optns)))) (with-current-buf= fer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (swi= tch-to-buffer-other-window outbuf)))) (108 (require (quote org-e-latex)) (o= rg-e-latex-export-to-latex (require (quote org-e-latex)) (memq (quote subtr= ee) optns) (memq (quote visible) optns) (memq (quote body) optns))) (112 (r= equire (quote org-e-latex)) (org-e-latex-export-to-pdf (memq (quote subtree= ) optns) (memq (quote visible) optns) (memq (quote body) optns))) (100 (req= uire (quote org-e-latex)) (org-open-file (org-e-latex-export-to-pdf (memq (= quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns= )))) (72 (require (quote org-e-html)) (let ((outbuf (org-export-to-buffer (= quote e-html) "*Org E-HTML Export*" (memq ... optns) (memq ... optns) (memq= ... optns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode= )) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-export-buffe= r (switch-to-buffer-other-window outbuf)))) (104 (require (quote org-e-html= )) (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote vis= ible) optns) (memq (quote body) optns))) (98 (require (quote org-e-html)) (= org-open-file (org-e-html-export-to-html (memq (quote subtree) optns) (memq= (quote visible) optns) (memq (quote body) optns)))) (111 (require (quote o= rg-e-odt)) (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quo= te visible) optns) (memq (quote body) optns))) (79 (require (quote org-e-od= t)) (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (m= emq (quote visible) optns) (memq (quote body) optns)))) (70 (require (quote= org-e-publish)) (org-e-publish-current-file (memq (quote force) optns))) (= 80 (require (quote org-e-publish)) (org-e-publish-current-project (memq (qu= ote force) optns))) (88 (require (quote org-e-publish)) (let ((project (ass= oc (org-icompleting-read "Publish project: " org-e-publish-project-alist ni= l t) org-e-publish-project-alist))) (org-e-publish project (memq (quote for= ce) optns)))) (69 (require (quote org-e-publish)) (org-e-publish-all (memq = (quote force) optns))) (t (error "No command associated with key %s" (char-= to-string raw-key))))) org-export-dispatch() call-interactively(org-export-dispatch) --8<---------------cut here---------------end--------------->8--- FYI, before calling `M-x org-export-dispatch', I've required `org-e-latex' = and `org-export'. Is there anything I've made wrong? Best regards, Seb [1] On GNU Emacs 24.1.1 (i386-mingw-nt5.1.2600) of 2012-06-02 on MARVIN with Org-mode version 7.8.11 (release_7.8.11-64-g168c83.dirty @ c:/home/sva= /src/org-mode/lisp/) --=20 Sebastien Vauban