emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: andrew dasys <adasys@objectivity.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Tables and Latex "Wrong-number-of-arguments" error
Date: Mon, 09 Mar 2009 18:22:32 -0400	[thread overview]
Message-ID: <11073.1236637352@alphaville.usa.hp.com> (raw)
In-Reply-To: Your message of "Mon\, 09 Mar 2009 16\:15\:26 EDT." <8aca08a00903091315r12623c88r3c50f2ef6c7aa8bf@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 7016 bytes --]

andrew dasys <adasys@objectivity.ca> wrote:

> 
> * MASH 
> | id | Actor         | Character                 |
> |----+---------------+---------------------------|
> |  1 | Allan Alda    | "Hawkeye" Benjamin Pierce |
> |  2 | Gary Burghoff | "Radar" Walter O'Reilly   |
> |  3 | Loretta Switt | "Hotlips" Margaret Hoolihan  |
> 
> ....[export to latex gets error]....

I cannot reproduce this - the export succeeds (but see below). Version info:

GNU Emacs 23.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2009-03-06 on alphaville.usa.hp.com
Org-mode version 6.24

> 
> Debugger entered--Lisp error: (wrong-number-of-arguments #[(string &optional separators) "\b†\x05\0ÆÇȉ\x19\x1a^[\x1cÉ\f
> ƒ&\0\vÇ”Uƒ&\0\v\rGWƒ&\0\vT‚'\0\v#ƒY\0Ç”\rGWƒY\0Ê\x12Ç”Ç=„S\0ǔǕ=ƒK\0Ç”\v=„S\0\r\vÇ”O	B\x11Ç•\x13‚\f\0\v\rG=„g\0\r\vÈO	B\x11	Ÿ,‡" [separators list notfirst start rexp string "[ \f	
> \r\v]+" 0 nil string-match t] 5 1390318] 3)
>   split-string(#("| id | Actor         | Character                     |\n|----+---------------+-------------------------------|\n|  1 | Allan Alda    | ``Hawkeye'' Benjamin Pierce   |\n|  2 | Gary Burghoff | ``Radar'' Walter O'Reilly     |\n|  3 | Loretta Switt | ``Hotlips'' Margaret Hoolihan |\n" 0 2 nil 2 4 (org-label nil org-attributes nil org-caption nil fontified nil) 4 7 nil 7 12 (org-label nil org-attributes nil org-caption nil fontified nil) 12 23 nil 23 32 (org-label nil org-attributes nil org-caption nil fontified nil) 32 113 nil 113 114 (org-label nil org-attributes nil org-caption nil fontified nil) 114 117 nil 117 127 (org-label nil org-attributes nil org-caption nil fontified nil) 127 133 nil 133 135 (org-protected t) 135 141 (org-label nil org-attributes nil org-caption nil fontified nil) 141 142 (org-protected t fontified nil org-caption nil org-attributes nil org-label nil) 142 144 (org-protected t) 144 160 (org-label nil org-attributes nil org-caption nil fontified nil) 160 168 nil 168 169 (org-label nil org-attributes nil org-caption nil fontified nil) 169 172 nil 172 185 (org-label nil org-attributes nil org-caption nil fontified nil) 185 188 nil 188 190 (org-protected t) 190 194 (org-label nil org-attributes nil org-caption nil fontified nil) 194 195 (org-protected t fontified nil org-caption nil org-attributes nil org-label nil) 195 197 (org-protected t) 197 213 (org-label nil org-attributes nil org-caption nil fontified nil) 213 223 nil 223 224 (org-label nil org-attributes nil org-caption nil fontified nil) 224 227 nil 227 240 (org-label nil org-attributes nil org-caption nil fontified nil) 240 243 nil 243 245 (org-protected t) 245 251 (org-label nil org-attributes nil org-caption nil fontified nil) 251 252 (org-protected t fontified nil org-caption nil org-attributes nil org-label nil) 252 254 (org-protected t) 254 272 (org-label nil org-attributes nil org-caption nil fontified nil) 272 275 nil) "\n" t)
>   (setq lines (split-string raw-table "\n" t))

... and this looks very strange to me: split-string is similar to AWK's or Python's
split() function, which is supposed to split a string using the given separator,
and return a list of substrings. The argument to split-string is correct (the raw table
as a string), as is the separator ("\n"). So where does split-string get the ungodly
mess shown above? Is it possible that you have redefined split-string somehow? Or perhaps
some matching function that split-string uses?
What happens if you evaluate the following (just press C-x C-e after the
closing paren or cut-and-paste the expression into the *scratch* buffer
and press C-j)? What happens if you restart your emacs with -Q and
evaluate the same expression? In my setup, I can evaluate the following
with no errors:

(split-string #("| id | Actor         | Character                     |\n|----+---------------+-------------------------------|\n|  1 | Allan Alda    | ``Hawkeye'' Benjamin Pierce   |\n|  2 | Gary Burghoff | ``Radar'' Walter O'Reilly     |\n|  3 | Loretta Switt | ``Hotlips'' Margaret Hoolihan |\n" 0 2 nil 2 4 (org-label nil org-attributes nil org-caption nil fontified nil) 4 7 nil 7 12 (org-label nil org-attributes nil org-caption nil fontified nil) 12 23 nil 23 32 (org-label nil org-attributes nil org-caption nil fontified nil) 32 113 nil 113 114 (org-label nil org-attributes nil org-caption nil fontified nil) 114 117 nil 117 127 (org-label nil org-attributes nil org-caption nil fontified nil) 127 133 nil 133 135 (org-protected t) 135 141 (org-label nil org-attributes nil org-caption nil fontified nil) 141 142 (org-protected t fontified nil org-caption nil org-attributes nil org-label nil) 142 144 (org-protected t) 144 160 (org-label nil org-attributes nil org-caption nil fontified nil) 160 168 nil 168 169 (org-label nil org-attributes nil org-caption nil fontified nil) 169 172 nil 172 185 (org-label nil org-attributes nil org-caption nil fontified nil) 185 188 nil 188 190 (org-protected t) 190 194 (org-label nil org-attributes nil org-caption nil fontified nil) 194 195 (org-protected t fontified nil org-caption nil org-attributes nil org-label nil) 195 197 (org-protected t) 197 213 (org-label nil org-attributes nil org-caption nil fontified nil) 213 223 nil 223 224 (org-label nil org-attributes nil org-caption nil fontified nil) 224 227 nil 227 240 (org-label nil org-attributes nil org-caption nil fontified nil) 240 243 nil 243 245 (org-protected t) 245 251 (org-label nil org-attributes nil org-caption nil fontified nil) 251 252 (org-protected t fontified nil org-caption nil org-attributes nil org-label nil) 252 254 (org-protected t) 254 272 (org-label nil org-attributes nil org-caption nil fontified nil) 272 275 nil) "\n" t)

What version of emacs are you running? Also, can you do C-h f split-string RET
and tell us what that says?



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

I said above that the export succeeds and it does, in the sense that I
get no errors.  However, the exported latex looks strange - the table
comes *before* the "MASH" section. Is this a bug or is it a peculiarity
of my configuration? Can somebody please try it and let me know?

Thanks,
Nick


,----
| % Created 2009-03-09 Mon 17:34
| \documentclass[11pt]{article}
| \usepackage[utf8]{inputenc}
| \usepackage[T1]{fontenc}
| \usepackage{graphicx}
| \usepackage{longtable}
| \usepackage{hyperref}
| 
| 
| \title{andrew-dasys}
| \author{Nick Dokos}
| \date{09 March 2009}
| 
| \begin{document}
| 
| \maketitle
| 
| \setcounter{tocdepth}{3}
| \tableofcontents
| \vspace*{1cm}
| 
| \begin{center}
| \begin{tabular}{rll}
|  id  &  Actor          &  Character                      \\
| \hline
|   1  &  Allan Alda     &  ``Hawkeye'' Benjamin Pierce    \\
|   2  &  Gary Burghoff  &  ``Radar'' Walter O'Reilly      \\
|   3  &  Loretta Switt  &  ``Hotlips'' Margaret Hoolihan  \\
| \end{tabular}
| \end{center}
| 
| 
| \section{MASH}
| \label{sec-1}
| 
| 
| 
| \end{document}
`----

  reply	other threads:[~2009-03-09 22:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 18:48 Tables and Latex "Wrong-number-of-arguments" error andrew dasys
2009-03-05 14:28 ` Carsten Dominik
2009-03-09 20:15   ` andrew dasys
2009-03-09 22:22     ` Nick Dokos [this message]
2009-03-09 22:42       ` latex exporting strangeness [was: Re: Tables and Latex "Wrong-number-of-arguments" error] Nick Dokos
2009-03-09 23:38         ` andrew dasys
2009-03-10  2:01           ` Nick Dokos
2009-03-09 23:23       ` Tables and Latex "Wrong-number-of-arguments" error andrew dasys
2009-03-10  1:58         ` Nick Dokos
2009-03-10  2:12         ` Nick Dokos
2009-03-10  5:36           ` Carsten Dominik
2009-03-10 13:12             ` andrew dasys

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=11073.1236637352@alphaville.usa.hp.com \
    --to=nicholas.dokos@hp.com \
    --cc=adasys@objectivity.ca \
    --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).