emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Org-mode <emacs-orgmode@gnu.org>
Subject: New LaTeX exporter and source code blocks
Date: Sat, 05 May 2012 09:53:47 -1000	[thread overview]
Message-ID: <m1y5p69zg4.fsf@tsdye.com> (raw)

Aloha,

The new LaTeX exporter doesn't properly handle source code blocks with
:exports results.  The following snippet exports correctly with the old
exporter. 

---- Org-mode source ----
#+name: ACM-categories
#+header: :var c=categories
#+header: :results latex 
#+header: :exports results
#+BEGIN_SRC emacs-lisp
  (defun category-record (r)
    (format "\\category{%s}{%s}{%s}[%s]" 
            (first r) (second r) (third r) (fourth r)))
  (let ( (i (mapcar (lambda (row)
            (category-record row))
          (cdr (cdr c)))))
     (mapconcat 'identity i "\n")
)
#+END_SRC

#+RESULTS: ACM-categories
#+BEGIN_LaTeX
\category{H.4}{Information Systems Applications}{Miscellaneous}[]
\category{D.2.8}{Software Engineering}{Metrics}[complexity measures, performance measures]
#+END_LaTeX
-------------------------

---- LaTeX output ----
\#+name: ACM-categories
\#+header: :var c=categories
\#+header: :results latex 
\#+header: :exports results
----------------------

Also, the new exporter seems to skip over #+BEGIN_LaTeX ... #+END_LaTeX
blocks.

---- Org-mode source ----
#+BEGIN_LaTeX
\title{A Sample {\ttlit ACM} SIG Proceedings Paper in Org-mode Format\titlenote{(Does NOT produce the permission block, copyright information nor page numbering). For use with ACM\_PROC\_ARTICLE-SP.CLS. Supported by ACM.}}
\subtitle{[Extended Abstract]
\titlenote{A full version of this paper is available as
\textit{Author's Guide to Preparing ACM SIG Proceedings Using
\LaTeX$2_\epsilon$\ and BibTeX} at
\texttt{www.acm.org/eaddress.htm}}}
#+END_LaTeX
-------------------------

---- LaTeX output ----

----------------------

This is with the master branch pulled earlier today running on Emacs
23.4.  My initialization file is at the bottom.

Let me know if I can provide more information.

All the best,
Tom

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

#+name: initialize-new-exporter
#+header: :tangle init-new.el
#+header: :results silent
#+header: :exports none
#+begin_src emacs-lisp 
  (add-to-list 'load-path "~/.emacs.d/src/org/contrib/lisp") ;; <- adjust
  (add-to-list 'load-path "~/.emacs.d/src/org/lisp") ;; <- adjust
  (add-to-list 'load-path "~/.emacs.d/src/org") ;; <- adjust
  
  (require 'org-install)
  (require 'org-export)
  (require 'org-e-latex)
  
  ;; this line only required until the upcomming Org-mode/Emacs24 sync
  (load "~/.emacs.d/src/org/lisp/org-exp-blocks.el")
  
  
  ;; Configure Babel to support all languages included in the manuscript
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((emacs-lisp . t)
     (org        . t)))
  (setq org-confirm-babel-evaluate nil)
  
  ;; Configure Org-mode
    (setq org-export-latex-hyperref-format "\\ref{%s}")
    (setq org-entities-user nil) 
    (add-to-list 'org-entities-user '("space" "\\ " nil " " " " " " " "))
    (setq org-e-latex-pdf-process '("texi2dvi --clean --verbose --batch %f"))
    (setq org-export-latex-packages-alist nil)
    (add-to-list 'org-export-latex-packages-alist '("" "hyperref"))
    (add-to-list 'org-export-latex-packages-alist '("" "graphicx"))

    (require 'org-special-blocks)
  
  (org-add-link-type 
     "cite" nil
     (lambda (path desc format)
       (cond
        ((eq format 'latex)
               (format "\\cite{%s}" path)))))
  
  (org-add-link-type 
     "acm" nil
     (lambda (path desc format)
       (cond
        ((eq format 'latex)
               (format "{\\%s{%s}}" path desc)))))
  
  (add-to-list 'org-e-latex-classes
                 '("acm-proc-article-sp"
                   "\\documentclass{acm_proc_article-sp}
                [NO-DEFAULT-PACKAGES]
                [PACKAGES]
                [EXTRA]"
                   ("\\section{%s}" . "\\section*{%s}")
                   ("\\subsection{%s}" . "\\subsection*{%s}")
                   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                   ("\\paragraph{%s}" . "\\paragraph*{%s}")
                   ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
#+end_src

             reply	other threads:[~2012-05-05 19:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-05 19:53 Thomas S. Dye [this message]
2012-05-05 20:58 ` New LaTeX exporter and source code blocks Nicolas Goaziou
2012-05-05 21:32   ` Thomas S. Dye
2012-05-05 21:37     ` Nicolas Goaziou
2012-05-05 22:55       ` Thomas S. Dye
2012-05-06  6:31         ` Nicolas Goaziou
2012-05-06 17:53           ` Thomas S. Dye
2012-05-06 18:17             ` Nicolas Goaziou

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=m1y5p69zg4.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    /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).