emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Export problem with source code blocks
@ 2013-03-30 19:29 Thomas S. Dye
  2013-03-30 21:29 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas S. Dye @ 2013-03-30 19:29 UTC (permalink / raw)
  To: Org-mode

Aloha all,

The following code block executes fine in the Org buffer, and it
exported cleanly on January 18th, but fails on export to LaTeX with a
recent version of Org from the git repo. Here is the error message:

  executing Emacs-Lisp code block (plos-one-start)...

  Debugger entered--Lisp error: (void-function first)
    (first row)

#+name: plos-one-start
#+header: :var tab=author-table
#+header: :var title="A Regional Chronology"
#+header: :results raw :wrap latex
#+header: :exports results
#+begin_src emacs-lisp
  (defun author-name (recs)
    "Format the author name list."
    (let ((i 0))
      (mapcar (lambda (row)
                (concat (format "%s$^{%d%s" (first row)
                                (incf i)
                                (if (equal "yes" (eighth row)) ",\\ast" ""))
                        (if (equal row (car (last recs))) "}$" "}$,")))
              recs)))
  
  (defun author-affiliation (recs)
    "Format the author affiliation list."
    (let ((i 0))
      (mapcar (lambda (row)
                (format "\\bf{%d} %s, %s, %s, %s, %s" (incf i)
                        (second row) (third row) (fourth row)
                        (fifth row) (sixth row)))
              recs)))
  (defun corresponding-email (recs)
    "Return the corresponding email."
    (mapcar (lambda (row)
              (format "%s" (if (equal "yes" (eighth row)) (seventh row) "")))
            recs))
  
  (let* ((tab (cdr (cdr tab)))
        (a (author-name tab))
        (b (author-affiliation tab))
        (c (corresponding-email tab)))
    (concat (format "\\begin{flushleft}\n{\\Large\n\\textbf{%s}\n}\n\\\\\n" title)
            (mapconcat 'identity a "\n") "\n\\\\\n"
            (mapconcat 'identity b "\n\\\\\n")
            "\n\\\\\n$\\ast$ E-mail: "
            (mapconcat 'identity c "\n")
            "\n\\end{flushleft}"))
#+end_src

#+name: author-table
| Author name   | Department                 | Institution           | City     | State | Country | Email         | Corresponding |
|---------------+----------------------------+-----------------------+----------+-------+---------+---------------+---------------|
| Thomas S. Dye | Department of Anthropology | University of Hawai`i | Honolulu | HI    | USA     | tsd@tsdye.com | yes           |

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

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

* Re: Export problem with source code blocks
  2013-03-30 19:29 Export problem with source code blocks Thomas S. Dye
@ 2013-03-30 21:29 ` Eric Schulte
  2013-03-30 22:32   ` Thomas S. Dye
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2013-03-30 21:29 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org-mode

Hi Tom,

The `first' function is provided by the cl package.  I'd either replace
`first' with `car' in your code block, or add (require 'cl) to your
personal Emacs configuration.

Cheers,

tsd@tsdye.com (Thomas S. Dye) writes:

> Aloha all,
>
> The following code block executes fine in the Org buffer, and it
> exported cleanly on January 18th, but fails on export to LaTeX with a
> recent version of Org from the git repo. Here is the error message:
>
>   executing Emacs-Lisp code block (plos-one-start)...
>
>   Debugger entered--Lisp error: (void-function first)
>     (first row)
>
> #+name: plos-one-start
> #+header: :var tab=author-table
> #+header: :var title="A Regional Chronology"
> #+header: :results raw :wrap latex
> #+header: :exports results
> #+begin_src emacs-lisp
>   (defun author-name (recs)
>     "Format the author name list."
>     (let ((i 0))
>       (mapcar (lambda (row)
>                 (concat (format "%s$^{%d%s" (first row)
>                                 (incf i)
>                                 (if (equal "yes" (eighth row)) ",\\ast" ""))
>                         (if (equal row (car (last recs))) "}$" "}$,")))
>               recs)))
>   
>   (defun author-affiliation (recs)
>     "Format the author affiliation list."
>     (let ((i 0))
>       (mapcar (lambda (row)
>                 (format "\\bf{%d} %s, %s, %s, %s, %s" (incf i)
>                         (second row) (third row) (fourth row)
>                         (fifth row) (sixth row)))
>               recs)))
>   (defun corresponding-email (recs)
>     "Return the corresponding email."
>     (mapcar (lambda (row)
>               (format "%s" (if (equal "yes" (eighth row)) (seventh row) "")))
>             recs))
>   
>   (let* ((tab (cdr (cdr tab)))
>         (a (author-name tab))
>         (b (author-affiliation tab))
>         (c (corresponding-email tab)))
>     (concat (format "\\begin{flushleft}\n{\\Large\n\\textbf{%s}\n}\n\\\\\n" title)
>             (mapconcat 'identity a "\n") "\n\\\\\n"
>             (mapconcat 'identity b "\n\\\\\n")
>             "\n\\\\\n$\\ast$ E-mail: "
>             (mapconcat 'identity c "\n")
>             "\n\\end{flushleft}"))
> #+end_src
>
> #+name: author-table
> | Author name   | Department                 | Institution           | City     | State | Country | Email         | Corresponding |
> |---------------+----------------------------+-----------------------+----------+-------+---------+---------------+---------------|
> | Thomas S. Dye | Department of Anthropology | University of Hawai`i |
> | Honolulu | HI | USA | tsd@tsdye.com | yes |
>
> All the best,
> Tom

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: Export problem with source code blocks
  2013-03-30 21:29 ` Eric Schulte
@ 2013-03-30 22:32   ` Thomas S. Dye
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas S. Dye @ 2013-03-30 22:32 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-mode

Hi Eric,

Yes, that fixes it.  The cl package wasn't loaded for asynchronous
export.  

The code executes in the buffer without an explicit (require 'cl). It's
a mystery to me where it gets loaded in my setup, though. I don't do it
explicitly--perhaps it tags along with some other package that I do load.

Thanks,
Tom


Eric Schulte <schulte.eric@gmail.com> writes:

> Hi Tom,
>
> The `first' function is provided by the cl package.  I'd either replace
> `first' with `car' in your code block, or add (require 'cl) to your
> personal Emacs configuration.
>
> Cheers,
>
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Aloha all,
>>
>> The following code block executes fine in the Org buffer, and it
>> exported cleanly on January 18th, but fails on export to LaTeX with a
>> recent version of Org from the git repo. Here is the error message:
>>
>>   executing Emacs-Lisp code block (plos-one-start)...
>>
>>   Debugger entered--Lisp error: (void-function first)
>>     (first row)
>>
>> #+name: plos-one-start
>> #+header: :var tab=author-table
>> #+header: :var title="A Regional Chronology"
>> #+header: :results raw :wrap latex
>> #+header: :exports results
>> #+begin_src emacs-lisp
>>   (defun author-name (recs)
>>     "Format the author name list."
>>     (let ((i 0))
>>       (mapcar (lambda (row)
>>                 (concat (format "%s$^{%d%s" (first row)
>>                                 (incf i)
>>                                 (if (equal "yes" (eighth row)) ",\\ast" ""))
>>                         (if (equal row (car (last recs))) "}$" "}$,")))
>>               recs)))
>>   
>>   (defun author-affiliation (recs)
>>     "Format the author affiliation list."
>>     (let ((i 0))
>>       (mapcar (lambda (row)
>>                 (format "\\bf{%d} %s, %s, %s, %s, %s" (incf i)
>>                         (second row) (third row) (fourth row)
>>                         (fifth row) (sixth row)))
>>               recs)))
>>   (defun corresponding-email (recs)
>>     "Return the corresponding email."
>>     (mapcar (lambda (row)
>>               (format "%s" (if (equal "yes" (eighth row)) (seventh row) "")))
>>             recs))
>>   
>>   (let* ((tab (cdr (cdr tab)))
>>         (a (author-name tab))
>>         (b (author-affiliation tab))
>>         (c (corresponding-email tab)))
>>     (concat (format "\\begin{flushleft}\n{\\Large\n\\textbf{%s}\n}\n\\\\\n" title)
>>             (mapconcat 'identity a "\n") "\n\\\\\n"
>>             (mapconcat 'identity b "\n\\\\\n")
>>             "\n\\\\\n$\\ast$ E-mail: "
>>             (mapconcat 'identity c "\n")
>>             "\n\\end{flushleft}"))
>> #+end_src
>>
>> #+name: author-table
>> | Author name | Department | Institution | City | State | Country |
>> | Email | Corresponding |
>> |---------------+----------------------------+-----------------------+----------+-------+---------+---------------+---------------|
>> | Thomas S. Dye | Department of Anthropology | University of Hawai`i |
>> | Honolulu | HI | USA | tsd@tsdye.com | yes |
>>
>> All the best,
>> Tom

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

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

end of thread, other threads:[~2013-03-30 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-30 19:29 Export problem with source code blocks Thomas S. Dye
2013-03-30 21:29 ` Eric Schulte
2013-03-30 22:32   ` Thomas S. Dye

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