emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: James Harkins <jamshark70@gmail.com>
Cc: Emacs-orgmode@gnu.org
Subject: Re: New exporter documentation?
Date: Thu, 17 Jan 2013 22:02:00 -1000	[thread overview]
Message-ID: <m1bocmhqbr.fsf@poto.myhome.westell.com> (raw)
In-Reply-To: <50F8F320.70709@gmail.com> (James Harkins's message of "Fri, 18 Jan 2013 15:00:48 +0800")

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

  reply	other threads:[~2013-01-18  8:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18  7:00 New exporter documentation? James Harkins
2013-01-18  8:02 ` Thomas S. Dye [this message]
2013-01-18  8:11 ` Florian Beck
2013-01-19  1:26   ` James Harkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1bocmhqbr.fsf@poto.myhome.westell.com \
    --to=tsd@tsdye.com \
    --cc=Emacs-orgmode@gnu.org \
    --cc=jamshark70@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).