emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* New exporter documentation?
@ 2013-01-18  7:00 James Harkins
  2013-01-18  8:02 ` Thomas S. Dye
  2013-01-18  8:11 ` Florian Beck
  0 siblings, 2 replies; 4+ messages in thread
From: James Harkins @ 2013-01-18  7:00 UTC (permalink / raw)
  To: Emacs-orgmode

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

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

* Re: New exporter documentation?
  2013-01-18  7:00 New exporter documentation? James Harkins
@ 2013-01-18  8:02 ` Thomas S. Dye
  2013-01-18  8:11 ` Florian Beck
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas S. Dye @ 2013-01-18  8:02 UTC (permalink / raw)
  To: James Harkins; +Cc: Emacs-orgmode

Aloha James,

James Harkins <jamshark70@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
               '("plos-article"
                 "\\documentclass[10pt]{article}
[NO-DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA]
\\doublespacing
% Text layout
\\topmargin 0.0cm
\\oddsidemargin 0.5cm
\\evensidemargin 0.5cm
\\textwidth 16cm 
\\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}")))
  <<ngz-nbsp>>
  <<tsd-textpm>>
  <<define-cite-link>>
#+end_src

Hope this helps,

Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: New exporter documentation?
  2013-01-18  7:00 New exporter documentation? James Harkins
  2013-01-18  8:02 ` Thomas S. Dye
@ 2013-01-18  8:11 ` Florian Beck
  2013-01-19  1:26   ` James Harkins
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Beck @ 2013-01-18  8:11 UTC (permalink / raw)
  To: James Harkins; +Cc: Emacs-orgmode

James Harkins <jamshark70@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

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

* Re: New exporter documentation?
  2013-01-18  8:11 ` Florian Beck
@ 2013-01-19  1:26   ` James Harkins
  0 siblings, 0 replies; 4+ messages in thread
From: James Harkins @ 2013-01-19  1:26 UTC (permalink / raw)
  To: Emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

On Jan 18, 2013 4:11 PM, "Florian Beck" <fb@miszellen.de> wrote:
>
> James Harkins <jamshark70@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

[-- Attachment #2: Type: text/html, Size: 583 bytes --]

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

end of thread, other threads:[~2013-01-19  1:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-18  7:00 New exporter documentation? James Harkins
2013-01-18  8:02 ` Thomas S. Dye
2013-01-18  8:11 ` Florian Beck
2013-01-19  1:26   ` James Harkins

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