From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: New exporter documentation? Date: Thu, 17 Jan 2013 22:02:00 -1000 Message-ID: References: <50F8F320.70709@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw6uE-0004XG-U5 for Emacs-orgmode@gnu.org; Fri, 18 Jan 2013 03:02:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tw6uC-0004zB-Km for Emacs-orgmode@gnu.org; Fri, 18 Jan 2013 03:02:30 -0500 Received: from oproxy9.bluehost.com ([69.89.24.6]:36311) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Tw6uC-0004yv-DU for Emacs-orgmode@gnu.org; Fri, 18 Jan 2013 03:02:28 -0500 In-Reply-To: <50F8F320.70709@gmail.com> (James Harkins's message of "Fri, 18 Jan 2013 15:00:48 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: James Harkins Cc: Emacs-orgmode@gnu.org Aloha James, James Harkins writes: > I apologize in advance for what is likely to be a dumb question, but > I'm struggling to find documentation of the new exporter. Google > pointed to [1], but this is documentation for developers of new > backends. I only want to use the existing backends, and I want to > understand how the new _exporter_ is different from the old__. > > Specific question: Is there an easy way to use a given LaTeX template > (.cls and .bib)? (I also found [2] but "easy" is not how I would > describe that.) Not a dumb question. The Org mode community is working to move the new exporter out of contrib/. The documentation at this point is the source code, several of Nicolas Goaziou's posts to the mailing list, and some "not easy" experiments that you've found. The answer to your specific question is, yes, this works in the same way as the old exporter. The following set up is one that I'm using for an article prepared for PLOS-One. See the variable org-e-latex-classes for how to use a LaTeX cls file. See the \bibliographystyle{} command for how to specify a particular .bib file. I run the editing-setup code block when I first enter the buffer. The export-setup-plos-one code block needs to be tangled so there is an init-plos.el file in the same folder as the Org mode file. If you change the name of the tangled file, then this needs to be changed also in the variable org-export-async-init-file in the editing-setup source code block. Beware! The asynchronous export is habit forming :) ** Editing setup #+name: editing-setup #+header: :noweb yes #+header: :results silent #+begin_src emacs-lis p (require 'org-e-latex) (setq org-export-in-background t) (setq org-export-async-debug t) (setq org-export-async-init-file (expand-file-name "init-plos.el")) (setq org-entities-user nil) (add-to-list 'org-entities-user '("space" "\\ " nil " " " " " " "=E2=80= =93")) (add-to-list 'org-entities-user '("amacron" "\\=3D{a}" nil "ā" "a" "= a" "=C4=81")) (add-to-list 'org-entities-user '("emacron" "\\=3D{e}" nil "ē" "e" "= e" "=C4=93")) (add-to-list 'org-entities-user '("imacron" "\\=3D{\\i}" nil "ī" "i"= "i" "=C4=AB")) (add-to-list 'org-entities-user '("omacron" "\\=3D{o}" nil "ō" "o" "= o" "=C5=8D")) (add-to-list 'org-entities-user '("umacron" "\\=3D{u}" nil "ū" "u" "= u" "=C5=AB")) (add-to-list 'org-entities-user '("Amacron" "\\=3D{A}" nil "Ā" "A" "= A" "=C4=80")) (add-to-list 'org-entities-user '("Emacron" "\\=3D{E}" nil "Ē" "E" "= E" "=C4=92")) (add-to-list 'org-entities-user '("Imacron" "\\=3D{I}" nil "Ī" "I" "= I" "=C4=AA")) (add-to-list 'org-entities-user '("Omacron" "\\=3D{O}" nil "Ō" "O" "= O" "=C5=8C")) (add-to-list 'org-entities-user '("Umacron" "\\=3D{U}" nil "Ū" "U" "= U" "=C5=AA")) (define-key org-mode-map (kbd "C-c e") 'org-export-dispatch) <> #+end_src ** Export setup for PLOS-One #+name: export-setup-plos-one #+header: :noweb yes #+header: :results silent #+header: :tangle init-plos.el #+begin_src emacs-lisp (setq load-path (cons "~/.emacs.d/src/org-mode/lisp" load-path)) (setq load-path (cons "~/.emacs.d/src/org-mode/contrib/lisp" load-path)) (require 'org-e-latex) (org-babel-lob-ingest "~/org/td-lob.org") (setq org-confirm-babel-evaluate nil) (org-babel-do-load-languages 'org-babel-load-languages '((R . t) (dot . t) (emacs-lisp . t) (latex . t) (org . t) (sh . t))) (setq org-entities-user nil) (add-to-list 'org-entities-user '("space" "\\ " nil " " " " " " "=E2=80= =93")) (add-to-list 'org-entities-user '("amacron" "\\=3D{a}" nil "ā" "a" "= a" "=C4=81")) (add-to-list 'org-entities-user '("emacron" "\\=3D{e}" nil "ē" "e" "= e" "=C4=93")) (add-to-list 'org-entities-user '("imacron" "\\=3D{\\i}" nil "ī" "i"= "i" "=C4=AB")) (add-to-list 'org-entities-user '("omacron" "\\=3D{o}" nil "ō" "o" "= o" "=C5=8D")) (add-to-list 'org-entities-user '("umacron" "\\=3D{u}" nil "ū" "u" "= u" "=C5=AB")) (add-to-list 'org-entities-user '("Amacron" "\\=3D{A}" nil "Ā" "A" "= A" "=C4=80")) (add-to-list 'org-entities-user '("Emacron" "\\=3D{E}" nil "Ē" "E" "= E" "=C4=92")) (add-to-list 'org-entities-user '("Imacron" "\\=3D{I}" nil "Ī" "I" "= I" "=C4=AA")) (add-to-list 'org-entities-user '("Omacron" "\\=3D{O}" nil "Ō" "O" "= O" "=C5=8C")) (add-to-list 'org-entities-user '("Umacron" "\\=3D{U}" nil "Ū" "U" "= U" "=C5=AA")) (setq org-export-latex-packages-alist nil) (add-to-list 'org-export-latex-packages-alist '("" "setspace")) (add-to-list 'org-export-latex-packages-alist '("" "amsmath")) (add-to-list 'org-export-latex-packages-alist '("" "amssymb")) (add-to-list 'org-export-latex-packages-alist '("" "graphicx")) (add-to-list 'org-export-latex-packages-alist '("" "cite")) (add-to-list 'org-export-latex-packages-alist '("" "color")) (add-to-list 'org-export-latex-packages-alist '("" "setspace")) (add-to-list 'org-export-latex-packages-alist '("labelfont=3Dbf,labelsep= =3Dperiod,justification=3Draggedright" "caption")) (setq org-e-latex-pdf-process '("latexmk -pdf %f")) (setq org-e-latex-tables-booktabs nil) (setq org-e-latex-title-command nil) (setq org-export-latex-hyperref-format "\\ref{%s}") (setq org-e-latex-remove-logfiles nil) (setq org-e-latex-toc-command "\\tableofcontents\n\n") (setq org-e-latex-classes nil) (add-to-list 'org-e-latex-classes '("plos-article" "\\documentclass[10pt]{article} [NO-DEFAULT-PACKAGES] [PACKAGES] [EXTRA] \\doublespacing % Text layout \\topmargin 0.0cm \\oddsidemargin 0.5cm \\evensidemargin 0.5cm \\textwidth 16cm=20 \\textheight 21cm \\bibliographystyle{plos2009} \\makeatletter \\renewcommand{\\@biblabel}[1]{\\quad#1.} \\makeatother \\pagestyle{myheadings} %% ** EDIT HERE ** %% ** EDIT HERE ** %% PLEASE INCLUDE ALL MACROS BELOW \\newcommand{\\texttwosuperior}{$^{2}$} \\newcommand{\\textpm}{$\\pm$} \\newcommand{\\rc}{$^{14}C$} %% END MACROS SECTION" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) <> <> <> #+end_src Hope this helps, Tom --=20 Thomas S. Dye http://www.tsdye.com