* Source block returns error before first headline
@ 2012-05-01 16:56 Thomas S. Dye
0 siblings, 0 replies; only message in thread
From: Thomas S. Dye @ 2012-05-01 16:56 UTC (permalink / raw)
To: Org-mode
Aloha all,
I have a source code block that returns LaTeX results that should be
placed before the first headline. The source block works correctly *if*
if is placed after a headline, but if I place it before the headline it
fails with Invalid read syntax: "#"
I'm enclosing an excerpt, but will work up an ECM if this is necessary.
All the best,
Tom
---Excerpt ----
* Shouldn't need this heading
#+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
# Note that add-author-record isn't fully correct. It formats a comma
# separated list, when it should return a list with the final element
# separated by "and".
#+name: author-list
#+header: :var authors=authorlist
#+header: :var add-authors=additional-authors
#+header: :results latex
#+header: :exports results
#+BEGIN_SRC emacs-lisp
(defun author-record (r)
(if (> (length (first r)) 0)
(format "\\alignauthor\n%s\\titlenote{%s}\\\\
\\affaddr{%s}\\\\
\\affaddr{%s}\\\\
\\affaddr{%s}\\\\
\\email{%s}" (first r) (second r) (third r) (fourth r) (fifth r)
(sixth r))
"\\and")
)
(defun non-empty (list)
(let ( (i 0))
(mapcar #'(lambda (elem)
(if (> (length (first elem)) 0)
(incf i)))
list)
i)
)
(defun add-author-record (r)
(format "%s (%s, email:
{\\texttt{%s}})"
(first r) (second r) (third r)))
(let ( (i (+ (non-empty (setcdr authors (cdr (cdr authors)))) (- (length add-authors) 2) ))
(a (mapcar (lambda (row)
(author-record row))
(setcdr authors (cdr (cdr authors)))))
(b (mapcar (lambda (row)
(add-author-record row))
(setcdr add-authors (cdr (cdr add-authors)))))
)
(concat
(format "\\numberofauthors{%s}\n\\author{\n" i)
(mapconcat 'identity a "\n")
"}"
(if (> (length add-authors) 0)
(concat "\n\\additionalauthors{Additional authors: "
(mapconcat 'identity b ", ")
".}")
())))
#+END_SRC
#+RESULTS: author-list
#+BEGIN_LaTeX
\numberofauthors{8}
\author{
\alignauthor
G.K.M. Tobin\titlenote{The secretary disavows any knowledge of this author's actions.}\\
\affaddr{Institute for Clarity in Documentation}\\
\affaddr{P.O. Box 1212}\\
\affaddr{Dublin, Ohio 43017-6221}\\
\email{webmaster@marysville-ohio.com}
\alignauthor
Lars Th{\o}rv{\"a}ld\titlenote{This author is the one who did all the really hard work.}\\
\affaddr{The Th{\o}rv{\"a}ld Group}\\
\affaddr{1 Th{\o}rv{\"a}ld Circle}\\
\affaddr{Hekla, Iceland}\\
\email{larst@affiliation.org}
\and
\alignauthor
Lawrence P. Leipuner\titlenote{}\\
\affaddr{Brookhaven Laboratories}\\
\affaddr{Brookhaven National Lab}\\
\affaddr{P.O. Box 5000}\\
\email{lleipuner@reasearchlabs.org}
\alignauthor
Sean Fogarty\titlenote{}\\
\affaddr{NASA Ames Research Center}\\
\affaddr{Moffett Field}\\
\affaddr{California 94035}\\
\email{fogarty@amesres.org}
\alignauthor
Charles Palmer\titlenote{}\\
\affaddr{Palmer Research Laboratories}\\
\affaddr{8600 Datapoint Drive}\\
\affaddr{San Antonio, Texas 78229}\\
\email{cpalmer@prl.com}}
\additionalauthors{Additional authors: John Smith (The Th{\o}rv{\"a}ld Group, email:
{\texttt{jsmith@affiliation.org}}), Julius P. Kumquat (The Kumquat Consortium, email:
{\texttt{jpkumquat@consortium}}).}
#+END_LaTeX
\maketitle
#+BEGIN_abstract
This paper provides a sample of a LaTeX document which resembles the
style of original ACM LaTeX template ``Option 1: LaTeX2e - Strict
Adherence to SIGS style''. The focus on this template is the usage
with Emacs Org-mode. Therefore the content is reduced to a minimum.
#+END_abstract
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-05-01 16:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 16:56 Source block returns error before first headline Thomas S. Dye
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.