emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX export for numbered equations
@ 2012-06-03 21:17 Sebastien Vauban
  2012-06-04  6:07 ` Nick Dokos
  2012-06-04  6:14 ` Nick Dokos
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastien Vauban @ 2012-06-03 21:17 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

I'm trying to get numbered equations in Beamer, hence using the begin_equation
block, but the formula is not correctly translated to LaTeX, and I have no
clue why...

Here an ECM:

--8<---------------cut here---------------start------------->8---
#+TITLE:     ECM Equations
#+DATE:      2012-06-13
#+Time-stamp: <2012-06-03 Sun 23:13 Fabrice on MEDIACENTER>

#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation,t]
#+BEAMER_HEADER_EXTRA: \usetheme{default}\usecolortheme{default}
#+BEAMER_FRAME_LEVEL: 1
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)

* Equations

- This is a displayed formula, not numbered:
  \[\frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }\]

- These should be numbered:

#+begin_equation
\frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
#+end_equation

#+begin_equation
\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
#+end_equation

* LaTeX output

- The first equation, unnumbered, is correctly translated to:

    \[\frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }\]

- The two other are wrongly translated:

  + the first one with two curly brackets escaped:
                                   v                               v
    \begin{equation}
    \frac{1}{\sqrt{2\pi\sigma^2}}e^\{ -\frac{(x-\mu)^2}{2\sigma^2} \}
    \end{equation}

  + the last one with one curly bracket escaped:
                                   v
    \begin{equation}
    \frac{1}{\sqrt{2\pi\sigma^2}}e^\{-\frac{(x-\mu)^2}{2\sigma^2}}
    \end{equation}
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: LaTeX export for numbered equations
  2012-06-03 21:17 LaTeX export for numbered equations Sebastien Vauban
@ 2012-06-04  6:07 ` Nick Dokos
  2012-06-04  7:26   ` Sebastien Vauban
  2012-06-04  6:14 ` Nick Dokos
  1 sibling, 1 reply; 8+ messages in thread
From: Nick Dokos @ 2012-06-04  6:07 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:

> Hello,
> 
> I'm trying to get numbered equations in Beamer, hence using the begin_equation
> block, but the formula is not correctly translated to LaTeX, and I have no
> clue why...
> 


Confirmed (except that I have to comment out hyperref in order to
process the latex file - I get fatal errors otherwise), plus the new
exporter chokes on the same example with the appended backtrace.

Nick

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-string def-pkg snippets-p t)) tpl (replace-match rpl t t tpl)) (if def-pkg (setq end (org-latex-packages-to-string def-pkg snippets-p))))
  (let (rpl (end "")) (if (string-match "^[ 	]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ 	]*\n?" tpl) (setq rpl (if (or (match-end 1) (not def-pkg)) "" (org-latex-packages-to-string def-pkg snippets-p t)) tpl (replace-match rpl t t tpl)) (if def-pkg (setq end (org-latex-packages-to-string def-pkg snippets-p)))) (if (string-match "\\[\\(NO-\\)?PACKAGES\\][ 	]*\n?" tpl) (setq rpl (if (or (match-end 1) (not pkg)) "" (org-latex-packages-to-string pkg snippets-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 (string-match "\\S-" extra)) (setq end (concat end "
 \n" extra)))) (if (string-match "\\S-" end) (concat tpl "\n" end) tpl))
  org-splice-latex-header(nil (("AUTO" "inputenc" t) ("T1" "fontenc" t) ("" "fixltx2e" nil) ("" "graphicx" t) ("" "longtable" nil) ("" "float" nil) ("" "wrapfig" nil) ("" "soul" t) ("" "textcomp" t) ("" "marvosym" t) ("" "wasysym" t) ("" "latexsym" t) ("" "amssymb" t) ("pdfborder={0,0,0},colorlinks=true" "hyperref" nil) "\\tolerance=1000") (("" "minted" t)) nil nil)
  (org-e-latex--guess-inputenc (org-splice-latex-header document-class-string 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) header)))) (org-e-latex--guess-inputenc (org-splice-latex-header document-class-string org-export-latex-default-packages-alist org-export-latex-packages-alist nil (plist-get info :latex-header-extra))))
  (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 "^[ 	]*\\\\documentclass\\(\\[.*?\\]\\)" class-options header t nil 1) header)))) (org-e-latex--guess-inputenc (org-splice-latex-header document-class-string org-export-latex-default-packages-alist org-export-latex-packages-alist nil (plist-get info :latex-header-extra)))))
  (let ((class (plist-get info :latex-class)) (class-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 (replace-regexp-in-string "^[ 	]*\\\\documentclass\\(\\[.*?\\]\\)" class-options header t nil 1) header)))) (org-e-latex--guess-inputenc (org-splice-latex-header document-class-string org-export-latex-default-packages-alist org-export-latex-packages-alist nil (plist-get info :latex-header-extra))))))
  (concat (and (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 (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-export-latex-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-num) (format "\\setcounter{secnumdepth}{%d}\n" sec-num))) (let ((author (and (plist-get info :with-author) (let ((auth 
 ...)) (and auth (org-export-data auth info))))) (email (and (plist-get info :with-email) (org-export-data (plist-get info :email) info)))) (cond ((and author email (not (string= "" 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={%s},\n  pdfsubject={%s},\n  pdfcreator={%s}}\n" (or (plist-get info :keywords) "") (or (plist-get info :description) "") (if (not (plist-get info :with-creator)) "" (plist-get info :creator))) "\\begin{document}\n\n" (org-element-normalize-string (cond ((string= "" title) nil) ((not (stringp org-e-latex-title-command)) 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 (whol
 enump depth) (format "\\setcounter{tocdepth}{%d}\n" depth)) "\\tableofcontents\n\\vspace*{1cm}\n\n"))) contents (let ((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}")
  (let ((title (org-export-data (plist-get info :title) info))) (concat (and (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-latex-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-num) (format "\\setcounter{secnumdepth}{%d}\n" sec-num))) (let ((author (and (plist-get info :with-author) (let (...) (and aut
 h ...)))) (email (and (plist-get info :with-email) (org-export-data (plist-get info :email) info)))) (cond ((and author email (not (string= "" email))) (format "\\author{%s\\thanks{%s}}\n" a
 uthor 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={%s},\n  pdfsubject={%s},\n  pdfcreator={%s}}\n" (or (plist-get info :keywords) "") (or (plist-get info :description) "") (if (not (plist-get info :with-creator)) "" (plist-get info :creator))) "\\begin{document}\n\n" (org-element-normalize-string (cond ((string= "" title) nil) ((not (stringp org-e-latex-title-command)) 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 (wholenump depth) (format "\\setcounter{toc
 depth}{%d}\n" depth)) "\\tableofcontents\n\\vspace*{1cm}\n\n"))) contents (let ((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("\\begin{itemize}\n\\item This is a displayed formula, not numbered:\n  \\[\\frac{1}{\\sqrt{2\\pi\\sigma^2}}e^{ -\\frac{(x-\\mu)^2}{2\\sigma^2} }\\]\n\n\\item These should be numbered:\n\\end{itemize}\n\n\\begin{equation}\n\\frac{1}\\{\\sqrt{2\\pi\\sigma^2}\\}e$^{\\mathrm{ -\\frac{(x-\\mu)^2}{2\\sigma^2} }}$\n\\end{equation}\n\n\\begin{equation}\n\\frac{1}\\{\\sqrt{2\\pi\\sigma^2}\\}e$^{\\mathrm{-\\frac{(x-\\mu)^2}{2\\sigma^2}}}$\n\\end{equation}\n" (:author ("Seb Vauban") :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.2." :date "2012-06-13" :description nil :email "nick@alphaville" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("ECM Equatio
 ns") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnote
 s t :with-plannings nil ...))
  funcall(org-e-latex-template "\\begin{itemize}\n\\item This is a displayed formula, not numbered:\n  \\[\\frac{1}{\\sqrt{2\\pi\\sigma^2}}e^{ -\\frac{(x-\\mu)^2}{2\\sigma^2} }\\]\n\n\\item These should be numbered:\n\\end{itemize}\n\n\\begin{equation}\n\\frac{1}\\{\\sqrt{2\\pi\\sigma^2}\\}e$^{\\mathrm{ -\\frac{(x-\\mu)^2}{2\\sigma^2} }}$\n\\end{equation}\n\n\\begin{equation}\n\\frac{1}\\{\\sqrt{2\\pi\\sigma^2}\\}e$^{\\mathrm{-\\frac{(x-\\mu)^2}{2\\sigma^2}}}$\n\\end{equation}\n" (:author ("Seb Vauban") :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.2." :date "2012-06-13" :description nil :email "nick@alphaville" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("ECM
  Equations") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-
 footnotes t :with-plannings nil ...))
  (if (or (not (fboundp template)) body-only) body (funcall template body info))
  (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not (fboundp template)) body-only) body (funcall template body info)) info)
  (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (intern (format "org-%s-template" backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not (fboundp template)) body-only) body (funcall template body info)) info))) (when org-export-copy-to-kill-ring (org-kill-new output)) output)
  (let ((info (org-export-install-filters (org-export-store-footnote-definitions (org-export-get-environment backend subtreep ext-plist)))) (tree (let ((buf (or (buffer-file-name ...) (current-buffer)))) (org-export-with-current-buffer-copy (unless noexpand (org-export-expand-include-keyword) (let (...) (org-export-blocks-preprocess))) (goto-char (point-min)) (let ((org-export-current-backend backend)) (run-hooks (quote org-export-before-parsing-hook))) (org-element-parse-buffer nil visible-only))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (intern (format "org-%s-template
 " backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not ...) body-only) 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 (point-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let ((info (org-export-install-filters (org-export-store-footnote-definitions (org-export-get-environment backend subtreep ext-plist)))) (tree (let ((buf (or ... ...))) (org-export-with-current-buffer-copy (unless noexpand (org-export-expand-include-keyword) (let ... ...)) (goto-char (point-min)) (let (...) (run-hooks ...)) (org-element-parse-buffer nil visible-only))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-norma
 lize-string (org-export-data tree info))) (template (intern (format "org-%s-template" backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or ... 
 body-only) body (funcall template body info)) info))) (when org-export-copy-to-kill-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-max)))) (let ((info (org-export-install-filters (org-export-store-footnote-definitions (org-export-get-environment backend subtreep ext-plist)))) (tree (let ((buf ...)) (org-export-with-current-buffer-copy (unless noexpand ... ...) (goto-char ...) (let ... ...) (org-element-parse-buffer nil visible-only))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (inte
 rn (format "org-%s-template" backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if ... body ...) info))) (when org-export-copy-to-kill-ring (org-kil
 l-new output)) output))))
  org-export-as(e-latex org-e-latex nil nil nil nil)
  (let ((out (org-export-as backend subtreep visible-only body-only ext-plist noexpand))) (with-temp-buffer (insert out) (let ((coding-system-for-write org-export-coding-system)) (write-file file))))
  org-export-to-file(e-latex "/home/nick/src/org/beamer/numbered-equations.tex" org-e-latex nil nil nil)
  (let ((outfile (org-export-output-file-name ".tex" subtreep pub-dir))) (org-export-to-file (quote e-latex) outfile subtreep visible-only body-only ext-plist))
  org-e-latex-export-to-latex(org-e-latex nil nil nil)
  (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-to-ascii (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset (\, (case raw-key (97 ...) (110 ...) (t ...))))))) ((eql --cl-var-- (quote 76)) (require (quote org-e-latex)) (let ((outbuf (org-export-to-buffer (quote e-latex) "
 *Org E-LaTeX Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-
 buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-- (quote 108)) (require (quote org-e-latex)) (org-e-latex-export-to-latex (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 subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 100)) (require (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)))) ((eql --cl-var-- (quote 72)) (require (quote org-e-html)) (let ((outbuf (org-export-to-buffer (quote e-html) "*Org E-HTML Export*" (memq (quote subtree) optns) (memq (quote visible) o
 ptns) (memq (quote body) optns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-export-buffer (switch-to-buffer-
 other-window outbuf)))) ((eql --cl-var-- (quote 104)) (require (quote org-e-html)) (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((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 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-- (quote 79)) (require (quote org-e-odt)) (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 70)) (require (quote org-e-publish)) (o
 rg-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 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-- (quote 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))))
  (let ((--cl-var-- (if (< raw-key 27) (+ raw-key 96) raw-key))) (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 ... optns) (memq ... optns) (memq ... optns) (\` ...)))) (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-to-ascii (memq (quote subtree) optns) (memq (quote visible) optns) (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) "*O
 rg E-LaTeX Export*" (memq ... optns) (memq ... optns) (memq ... optns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-wind
 ow outbuf)))) ((eql --cl-var-- (quote 108)) (require (quote org-e-latex)) (org-e-latex-export-to-latex (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 subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 100)) (require (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)))) ((eql --cl-var-- (quote 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-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-- (quote 104)) (require (quot
 e org-e-html)) (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((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 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-- (quote 79)) (require (quote org-e-odt)) (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 70)) (require (quote org-e-publish)) (org-e-publish-current-file (memq (quote force) optns))) ((eql --cl-va
 r-- (quote 80)) (require (quote org-e-publish)) (org-e-publish-current-project (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-- (quote 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)))))
  (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 (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)))) ((97 110 117) (require (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 (97 ...) (110 ...) (t ...))))))) (76 (require (quote org-e-latex)) (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (memq (quote subtree) optns) (memq (quote v
 isible) optns) (memq (quote body) optns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) (108 (require (q
 uote org-e-latex)) (org-e-latex-export-to-latex (require (quote org-e-latex)) (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (112 (require (quote org-e-latex)) (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (100 (require (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 (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-export-
 buffer (switch-to-buffer-other-window outbuf)))) (104 (require (quote org-e-html)) (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) opt
 ns))) (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 org-e-odt)) (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (79 (require (quote org-e-odt)) (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (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 (quote force) optns))) (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)))) (69 (require (quote org-e-publish)) (org-e-publish-all (memq (quote force) optns))) (t (error "No command asso
 ciated with key %s" (char-to-string 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-dispatch-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) (require (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-latex)) (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (memq ... optns) (memq ... optns) (memq ... optns)))) (with-current-buffer outbuf (lat
 ex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) (108 (require (quote org-e-latex)) (org-e-latex-export-to-latex (require (quote org-e-latex)) (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (112 (require (quote org-e-latex)) (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (100 (require (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-buffer (switch-to-buffer-other-window outbuf)))) (104 (require (quote org-e-html)) (org-e-html-export-to-html
  (memq (quote subtree) optns) (memq (quote visible) 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 org-e-odt)) (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (79 (require (quote org-e-odt)) (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (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 (quote force) optns))) (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)))) (69 (require (quote org-e-pub
 lish)) (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 nil nil)

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

* Re: LaTeX export for numbered equations
  2012-06-03 21:17 LaTeX export for numbered equations Sebastien Vauban
  2012-06-04  6:07 ` Nick Dokos
@ 2012-06-04  6:14 ` Nick Dokos
  2012-06-04  7:41   ` Sebastien Vauban
  2012-06-04 13:41   ` Carsten Dominik
  1 sibling, 2 replies; 8+ messages in thread
From: Nick Dokos @ 2012-06-04  6:14 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:

> Hello,
> 
> I'm trying to get numbered equations in Beamer, hence using the begin_equation
> block, but the formula is not correctly translated to LaTeX, and I have no
> clue why...
> 
> Here an ECM:
> ... 
> - These should be numbered:
> 
> #+begin_equation
> \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
> #+end_equation
> 
> #+begin_equation
> \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
> #+end_equation
> ... 

The following workaround seems to be effective in both of these cases:

#+begin_equation
#+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
#+end_equation

Nick

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

* Re: LaTeX export for numbered equations
  2012-06-04  6:07 ` Nick Dokos
@ 2012-06-04  7:26   ` Sebastien Vauban
  2012-06-04  7:33     ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastien Vauban @ 2012-06-04  7:26 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Nick,

Nick Dokos wrote:
> Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> wrote:
>> 
>> I'm trying to get numbered equations in Beamer, hence using the
>> begin_equation block, but the formula is not correctly translated to LaTeX,
>> and I have no clue why...
>
> Confirmed (except that I have to comment out hyperref in order to process
> the latex file - I get fatal errors otherwise),

Weird. I do use hyperref...

> plus the new exporter chokes on the same example with the appended
> backtrace.

Regarding the new exporter (which I can't test -- I have problems when
activating it, still have to look why with emacs -Q and dichotomic search...),
IIRC Beamer is not supported (yet?).

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: LaTeX export for numbered equations
  2012-06-04  7:26   ` Sebastien Vauban
@ 2012-06-04  7:33     ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2012-06-04  7:33 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Regarding the new exporter (which I can't test -- I have problems when
> activating it, still have to look why with emacs -Q and dichotomic search...),
> IIRC Beamer is not supported (yet?).

Yes, it is not.

-- 
 Bastien

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

* Re: LaTeX export for numbered equations
  2012-06-04  6:14 ` Nick Dokos
@ 2012-06-04  7:41   ` Sebastien Vauban
  2012-06-04 12:21     ` suvayu ali
  2012-06-04 13:41   ` Carsten Dominik
  1 sibling, 1 reply; 8+ messages in thread
From: Sebastien Vauban @ 2012-06-04  7:41 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Nick,

Nick Dokos wrote:
> Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> wrote:
>
>> I'm trying to get numbered equations in Beamer, hence using the begin_equation
>> block, but the formula is not correctly translated to LaTeX, and I have no
>> clue why...
>> 
>> Here an ECM:
>> ... 
>> - These should be numbered:
>> 
>> #+begin_equation
>> \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
>> #+end_equation
>> 
>> #+begin_equation
>> \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
>> #+end_equation
>> ... 
>
> The following workaround seems to be effective in both of these cases:
>
> #+begin_equation
> #+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
> #+end_equation

I confirm your workaround is working in my case as well -- I would never have
thought doing that. Thanks!

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: LaTeX export for numbered equations
  2012-06-04  7:41   ` Sebastien Vauban
@ 2012-06-04 12:21     ` suvayu ali
  0 siblings, 0 replies; 8+ messages in thread
From: suvayu ali @ 2012-06-04 12:21 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hey Seb,

On Mon, Jun 4, 2012 at 9:41 AM, Sebastien Vauban
<wxhgmqzgwmuf@spammotel.com> wrote:
> Hi Nick,
>
> Nick Dokos wrote:
>> Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:
>>
>>> I'm trying to get numbered equations in Beamer, hence using the begin_equation
>>> block, but the formula is not correctly translated to LaTeX, and I have no
>>> clue why...
>>>
>>> Here an ECM:
>>> ...
>>> - These should be numbered:
>>>
>>> #+begin_equation
>>> \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
>>> #+end_equation
>>>
>>> #+begin_equation
>>> \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
>>> #+end_equation
>>> ...
>>
>> The following workaround seems to be effective in both of these cases:
>>
>> #+begin_equation
>> #+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
>> #+end_equation
>
> I confirm your workaround is working in my case as well -- I would never have
> thought doing that. Thanks!
>

I know it should work, but is there any particular reason you need to
use #+begin_equation .. #+end_equation ? The following seems to work for
me well.

  #+begin_latex
    \begin{equation}
      \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
    \end{equation}
  #+end_latex

If you want fontlocking you can even use

  #+begin_src latex :eval yes
    \begin{equation}
      \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
    \end{equation}
  #+end_src

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: LaTeX export for numbered equations
  2012-06-04  6:14 ` Nick Dokos
  2012-06-04  7:41   ` Sebastien Vauban
@ 2012-06-04 13:41   ` Carsten Dominik
  1 sibling, 0 replies; 8+ messages in thread
From: Carsten Dominik @ 2012-06-04 13:41 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode


On 4.6.2012, at 08:14, Nick Dokos wrote:

> Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:
> 
>> Hello,
>> 
>> I'm trying to get numbered equations in Beamer, hence using the begin_equation
>> block, but the formula is not correctly translated to LaTeX, and I have no
>> clue why...
>> 
>> Here an ECM:
>> ... 
>> - These should be numbered:
>> 
>> #+begin_equation
>> \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
>> #+end_equation
>> 
>> #+begin_equation
>> \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
>> #+end_equation
>> ... 
> 
> The following workaround seems to be effective in both of these cases:
> 
> #+begin_equation
> #+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
> #+end_equation

You just use

   \begin{equation}
   \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
   \end{equation}

Entire LaTeX environments should be automatically
protected and passed through for LaTeX export.

- Carsten




> 
> Nick
> 
> 

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

end of thread, other threads:[~2012-06-04 13:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-03 21:17 LaTeX export for numbered equations Sebastien Vauban
2012-06-04  6:07 ` Nick Dokos
2012-06-04  7:26   ` Sebastien Vauban
2012-06-04  7:33     ` Bastien
2012-06-04  6:14 ` Nick Dokos
2012-06-04  7:41   ` Sebastien Vauban
2012-06-04 12:21     ` suvayu ali
2012-06-04 13:41   ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).