Re: [O] New exporter documentation?

2013-01-18 Thread Thomas S. Dye
Aloha James,

James Harkins jamshar...@gmail.com 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   –))
  (add-to-list 'org-entities-user '(amacron \\={a} nil #0257 a a 
ā))
  (add-to-list 'org-entities-user '(emacron \\={e} nil #0275 e e 
ē))
  (add-to-list 'org-entities-user '(imacron \\={\\i} nil #0299 i i 
ī))
  (add-to-list 'org-entities-user '(omacron \\={o} nil #0333 o o 
ō))
  (add-to-list 'org-entities-user '(umacron \\={u} nil #0363 u u 
ū))
  (add-to-list 'org-entities-user '(Amacron \\={A} nil #0256 A A 
Ā))
  (add-to-list 'org-entities-user '(Emacron \\={E} nil #0274 E E 
Ē))
  (add-to-list 'org-entities-user '(Imacron \\={I} nil #0298 I I 
Ī))
  (add-to-list 'org-entities-user '(Omacron \\={O} nil #0332 O O 
Ō))
  (add-to-list 'org-entities-user '(Umacron \\={U} nil #0362 U U 
Ū))
  (define-key org-mode-map (kbd C-c e) 'org-export-dispatch)
  define-cite-link
#+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   –))
  (add-to-list 'org-entities-user '(amacron \\={a} nil #0257 a a 
ā))
  (add-to-list 'org-entities-user '(emacron \\={e} nil #0275 e e 
ē))
  (add-to-list 'org-entities-user '(imacron \\={\\i} nil #0299 i i 
ī))
  (add-to-list 'org-entities-user '(omacron \\={o} nil #0333 o o 
ō))
  (add-to-list 'org-entities-user '(umacron \\={u} nil #0363 u u 
ū))
  (add-to-list 'org-entities-user '(Amacron \\={A} nil #0256 A A 
Ā))
  (add-to-list 'org-entities-user '(Emacron \\={E} nil #0274 E E 
Ē))
  (add-to-list 'org-entities-user '(Imacron \\={I} nil #0298 I I 
Ī))
  (add-to-list 'org-entities-user '(Omacron \\={O} nil #0332 O O 
Ō))
  (add-to-list 'org-entities-user '(Umacron \\={U} nil #0362 U U 
Ū))
  (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=bf,labelsep=period,justification=raggedright 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
   

Re: [O] New exporter documentation?

2013-01-18 Thread Florian Beck
James Harkins jamshar...@gmail.com writes:

 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.)

The easiest way is probably

#+BEGIN_SRC emacs-lisp
(require 'org-export)
(require 'org-e-latex)

(setq org-e-latex-default-class new-article)

(add-to-list
 'org-e-latex-classes
 '(new-article \\documentclass[10pt]{my-style}
\n\\bibliography{/path/to/bibfile.bib}
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s})))
#+END_SRC

This works just like `org-export-latex-classes' but see the docstring.

Now you are ready to go: M-x org-export-dispatch


-- 
Florian Beck



Re: [O] New exporter documentation?

2013-01-18 Thread James Harkins
On Jan 18, 2013 4:11 PM, Florian Beck f...@miszellen.de wrote:

 James Harkins jamshar...@gmail.com writes:

  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.)

 The easiest way is probably
... snip code

Thanks - that seems pretty straightforward. I'll try later.
hjh


[O] New exporter documentation?

2013-01-17 Thread James Harkins
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.)


I suppose I've just overlooked a blindingly obvious link somewhere...TIA,
hjh

[1] http://orgmode.org/worg/dev/org-export-reference.html
[2] https://github.com/novoid/orgmode-ACM-template