From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: LaTeX export problem Date: Fri, 21 Sep 2012 11:21:19 -1000 Message-ID: References: <87392epgfw.fsf@bzg.ath.cx> <878vc3kbgu.fsf@bzg.ath.cx> 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]:59405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFAfB-0006Mk-5m for emacs-orgmode@gnu.org; Fri, 21 Sep 2012 17:21:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFAf9-0001CG-6r for emacs-orgmode@gnu.org; Fri, 21 Sep 2012 17:21:29 -0400 Received: from oproxy8-pub.bluehost.com ([69.89.22.20]:52154) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TFAf8-0001C4-Py for emacs-orgmode@gnu.org; Fri, 21 Sep 2012 17:21:27 -0400 In-Reply-To: (Alexander Vorobiev's message of "Fri, 21 Sep 2012 14:47:21 -0500") 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: Alexander Vorobiev Cc: Bastien , Orgmode Mailing List , Gary Oberbrunner Alexander Vorobiev writes: > I tried the new exporter (using today's snapshot of the sources) and > it produced invalid LaTeX (it calls hypersetup without loading > hyperref package). It also ignored the #+LaTeX_CLASS: and all the > #+LaTeX_HEADER:lines in my file. Are there any examples of org files > which show how to customize the new LaTeX exporter? > > Thanks > Alex Aloha Alex, I've been exploring the new exporter with a recent project. I have the following probably too complex setup that lets me use biblatex in conjunction with ebib. I'm also using a customized setup for the Lucida fonts (packages tsdlucida and lucidabr), which you'll most likely want to change. * Org-mode setup :noexpor= t: This is a setup for Nicolas Goaziou's new exporter #+name: setup #+begin_src emacs-lisp :noweb yes :results silent (require 'org-export) (require 'org-e-latex) (require 'org-e-html) (setq org-export-latex-packages-alist nil) (add-to-list 'org-export-latex-packages-alist '("colorlinks=3Dtrue,urlc= olor=3DSteelBlue4,linkcolor=3DFirebrick4,citecolor=3DGreen4" "hyperref")) (add-to-list 'org-export-latex-packages-alist '("style=3Dauthoryear-com= p,backend=3Dbibtex8" "biblatex")) (add-to-list 'org-export-latex-packages-alist '("x11names" "xcolor")) (add-to-list 'org-export-latex-packages-alist '("" "microtype")) (add-to-list 'org-export-latex-packages-alist '("" "graphicx")) (add-to-list 'org-export-latex-packages-alist '("" "ragged2e")) (add-to-list 'org-export-latex-packages-alist '("" "booktabs")) (add-to-list 'org-export-latex-packages-alist '("" "tabularx")) (add-to-list 'org-export-latex-packages-alist '("" "tsdlucida")) (add-to-list 'org-export-latex-packages-alist '("" "wasysym")) (add-to-list 'org-export-latex-packages-alist '("" "paralist")) (add-to-list 'org-export-latex-packages-alist '("altbullet,lucidasmalls= cale,expert,vargreek" "lucidabr")) (add-to-list 'org-export-latex-packages-alist '("T1" "fontenc")) (add-to-list 'org-export-latex-packages-alist '("AUTO" "inputenc")) (setq org-entities-user nil)=20 (add-to-list 'org-entities-user '("space" "\\ " nil " " " " " " " ")) (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-e-latex-pdf-process '("texi2dvi --pdf --clean --verbose --bat= ch %f")) (require 'org-special-blocks) (define-key org-mode-map (kbd "C-c e") 'org-export-dispatch) (setq org-e-latex-tables-booktabs t) (setq org-export-latex-hyperref-format "\\ref{%s}") (setq org-e-latex-remove-logfiles nil) (setq org-e-latex-toc-command "\\tableofcontents\n\n") (add-to-list 'org-e-latex-classes '("koma-article" "\\documentclass{scrartcl} [NO-DEFAULT-PACKAGES] [PACKAGES] [EXTRA] \\let\\itemize\\compactitem \\let\\description\\compactdesc \\let\\enumerate\\compactenum \\bibliography{local} \\newcolumntype{Y}{>{\\RaggedRight\\arraybackslash}X}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) <> <> <> #+end_src ** Standard Biblatex citation commands #+name: define-standard-biblatex-commands #+begin_src emacs-lisp :noweb yes :results silent :exports none <> <> <> <> <> <> #+end_src #+name: define-biblatex-cite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "cite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "cite:" desc))) (format "\\cite{%s}" path) (format "\\cite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-cap-cite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "Cite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "Cite:" desc))) (format "\\Cite{%s}" path) (format "\\Cite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-parencite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "parencite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "parencite:" desc))) (format "\\parencite{%s}" path) (format "\\parencite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-cap-parencite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "Parencite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "Parencite:" desc))) (format "\\Parencite{%s}" path) (format "\\Parencite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-footcite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "footcite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "footcite:" desc))) (format "\\footcite{%s}" path) (format "\\footcite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-footcitetext-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "footcitetext" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "footcitetext:" desc))) (format "\\footcitetext{%s}" path) (format "\\footcitetext[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src ** Style-specific biblatex commands #+name: define-style-specific-biblatex-commands #+begin_src emacs-lisp :noweb yes :results silent :exports none <> <> <> <> <> <> <> <> #+end_src #+name: define-biblatex-multicite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "multicite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "multicite:" desc))) (format "{%s}" path) (format "[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) =20=20 #+end_src #+name: define-biblatex-textcite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "textcite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "textcite:" desc))) (format "\\textcite{%s}" path) (format "\\textcite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-cap-textcite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "Textcite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "Textcite:" desc))) (format "\\Textcite{%s}" path) (format "\\Textcite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-smartcite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "smartcite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "smartcite:" desc))) (format "\\smartcite{%s}" path) (format "\\smartcite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-cap-smartcite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "Smartcite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "Smartcite:" desc))) (format "\\Smartcite{%s}" path) (format "\\Smartcite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-citestar-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "cite*" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "cite*:" desc))) (format "\\cite*{%s}" path) (format "\\cite*[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-parencitestar-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "parencite*" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "parencite*:" desc))) (format "\\parencite*{%s}" path) (format "\\parencite*[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) #+end_src #+name: define-biblatex-supercite-link #+begin_src emacs-lisp :results silent :exports none (org-add-link-type=20 "supercite" 'ebib (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (format "\\cite*{%s}" path))))) #+end_src ** Nicolas Goaziou's filter for non-breaking spaces #+name: ngz-nbsp #+begin_src emacs-lisp (defun ngz-latex-filter-nobreaks (text backend info) "Ensure \"_\" are properly handled in Beamer/LaTeX export." (when (memq backend '(e-beamer e-latex)) (replace-regexp-in-string "=C2=A0" "~" text))) (add-to-list 'org-export-filter-plain-text-functions 'ngz-latex-filter-nobreaks) #+end_src =20 The header of my org file looks like this: #+TITLE: A Regional Chronology of Leeward North Kohala District, Hawai`= i Island #+AUTHOR: Thomas Dye #+DATE:=20=20=20 #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:1 \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LaTeX_CLASS: koma-article=20 #+LaTeX_HEADER: \subtitle{Draft: Not for citation} #+startup: fnadjust #+TOC: figures #+TOC: tables Currently, I'm exporting with org-export-dispatch, but eventually I'll tangle the setup into an init.el file and have a makefile that launches emacs -q so I can be certain nothing in my .emacs has an influence. Right now, though, I'm quite happy with the new exporter. hth, Tom > On Fri, Sep 21, 2012 at 3:48 AM, Bastien wrote: >> Hi Alexander, >> >> Alexander Vorobiev writes: >> >>> Could you point us to any documentation on how to switch to the new >>> exporter? >> >> Add contrib/lisp to your load-path. >> >> (require 'org-e-latex) >> >> then M-x org-export-dispatch RET to get a menu and be able to >> export to LaTeX from here. >> >>> Is the tutorial >>> http://orgmode.org/worg/org-tutorials/org-latex-export.html still >>> relevant? >> >> No, this tutorial is valid for the current exporter, not for >> Nicolas exporter. >> >> HTH, >> >> -- >> Bastien > > --=20 Thomas S. Dye http://www.tsdye.com