From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew dasys Subject: Re: Tables and Latex "Wrong-number-of-arguments" error Date: Mon, 9 Mar 2009 19:23:35 -0400 Message-ID: <8aca08a00903091623o63eb296cjb9ff20338f6054d5@mail.gmail.com> References: <8aca08a00903041048g7318ec54v904b984a50daf4c7@mail.gmail.com> <30B609E1-98D5-4A78-9A20-FCB803263DC7@uva.nl> <8aca08a00903091315r12623c88r3c50f2ef6c7aa8bf@mail.gmail.com> <11073.1236637352@alphaville.usa.hp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=000e0cd308f26c992a0464b7ece5 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lgoos-0004nt-TU for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 19:23:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lgoor-0004me-Oo for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 19:23:38 -0400 Received: from [199.232.76.173] (port=46265 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lgoor-0004mO-Cl for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 19:23:37 -0400 Received: from yw-out-1718.google.com ([74.125.46.155]:7993) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lgooq-0000up-P6 for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 19:23:37 -0400 Received: by yw-out-1718.google.com with SMTP id 6so1051459ywa.66 for ; Mon, 09 Mar 2009 16:23:36 -0700 (PDT) In-Reply-To: <11073.1236637352@alphaville.usa.hp.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org --000e0cd308f26c992a0464b7ece5 Content-Type: multipart/alternative; boundary=000e0cd308f26c991d0464b7ece3 --000e0cd308f26c991d0464b7ece3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Nick, thank you for looking at this. I am running Emacs 21.4.1 Nothing bleeding edge here. The help for split-string looks reasonable (compiled Lisp comes from "subr= " ....) (complete output attached) A bit of debugging gets me to the point where split-string works fine if yo= u only include the text that is in the table so from "|id ..... Hoolihan |\n" if you add any of the other text starting at: 0 2 nil 2 4 (org-label nil org.... then I get the error. On Mon, Mar 9, 2009 at 6:22 PM, Nick Dokos wrote: > andrew dasys 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-0= 6 > on alphaville.usa.hp.com > Org-mode version 6.24 > > > > > Debugger entered--Lisp error: (wrong-number-of-arguments #[(string > &optional separators) " =C2=86 =C3=86=C3=87=C3=88=C2=89 =C3=89 > > =C2=83& =C3=87=C2=94U=C2=83& > GW=C2=83& T=C2=82' #=C2=83Y =C3=87=C2=94 > GW=C2=83Y =C3=8A =C3=87=C2=94=C3=87=3D=C2=84S =C3=87=C2=94=C3=87=C2=95=3D= =C2=83K =C3=87=C2=94 =3D=C2=84S > =C3=87=C2=94O B =C3=87=C2=95 =C2=82 > G=3D=C2=84g > =C3=88O B =C2=9F,=C2=87" [separators list notfirst start rexp s= tring "[ > > > ]+" 0 nil string-match t] 5 1390318] 3) > > split-string(#("| id | Actor | Character > |\n|----+---------------+-------------------------------|\n| 1 | Allan A= lda > | ``Hawkeye'' Benjamin Pierce |\n| 2 | Gary Burghoff | ``Radar'' > Walter O'Reilly |\n| 3 | Loretta Switt | ``Hotlips'' Margaret Hoolih= an > |\n" 0 2 nil 2 4 (org-label nil org-attributes nil org-caption nil fontif= ied > 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-capt= ion > 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 n= il > 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 fontifi= ed > 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 n= il > 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 n= il > 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 o= r > 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 A= lda > | ``Hawkeye'' Benjamin Pierce |\n| 2 | Gary Burghoff | ``Radar'' > Walter O'Reilly |\n| 3 | Loretta Switt | ``Hotlips'' Margaret Hoolih= an > |\n" 0 2 nil 2 4 (org-label nil org-attributes nil org-caption nil fontif= ied > 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-capt= ion > 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 n= il > 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 fontifi= ed > 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 n= il > 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 n= il > 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-strin= g > 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} > `---- > --000e0cd308f26c991d0464b7ece3 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Nick,
thank you for looking at this.

I am running Emacs 21.4.1 = Nothing bleeding edge here.

The help for split-string looks reasona= ble=A0 (compiled Lisp comes from "subr" ....) (complete output at= tached)

A bit of debugging gets me to the point where split-string works fine i= f you only include the text that is in the table so from
=A0"|id ..= ... Hoolihan |\n"
if you add any of the other text=A0 starting at:=
0 2 nil 2 4 (org-label nil org....

then I get the error.


=
On Mon, Mar 9, 2009 at 6:22 PM, Nick Dokos <nicholas.dokos@hp= .com> wrote:
andrew dasys <adasys@objectivi= ty.ca> wrote:

>
> * MASH
> | id | Actor =A0 =A0 =A0 =A0 | Character =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 |
> |----+---------------+---------------------------|
> | =A01 | Allan Alda =A0 =A0| "Hawkeye" Benjamin Pierce |
> | =A02 | Gary Burghoff | "Radar" Walter O'Reilly =A0 | > | =A03 | Loretta Switt | "Hotlips" Margaret Hoolihan =A0| >
> ....[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.us= a.hp.com
Org-mode version 6.24

>
> Debugger entered--Lisp error: (wrong-number-of-arguments #[(string &am= p;optional separators) " =C2=86 =A0=C3=86=C3=87=C3=88=C2=89 =A0 =A0=C3= =89
> =C2=83& =A0=C3=87=C2=94U=C2=83&
GW=C2=83& =A0T=C2=82' =A0#=C2=83Y =C3=87=C2=94
GW=C2=83Y =C3=8A =C3=87=C2=94=C3=87=3D=C2=84S =C3=87=C2=94=C3=87=C2=95=3D= =C2=83K =C3=87=C2=94 =3D=C2=84S
=A0=C3=87=C2=94O =A0B =C3=87=C2=95 =C2=82
G=3D=C2=84g
=A0=C3=88O =A0 =A0B =A0 =A0 =A0 =C2=9F,=C2=87" [separators list notfir= st start rexp string "[
>
=A0]+" 0 nil string-match t] 5 1390318] 3)
> =A0 split-string(#("| id | Actor =A0 =A0 =A0 =A0 | Character =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |\n|----+---------------+--------------= -----------------|\n| =A01 | Allan Alda =A0 =A0| ``Hawkeye'' Benjam= in Pierce =A0 |\n| =A02 | Gary Burghoff | ``Radar'' Walter O'Re= illy =A0 =A0 |\n| =A03 | Loretta Switt | ``Hotlips'' Margaret Hooli= han |\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-ca= ption nil fontified nil) 32 113 nil 113 114 (org-label nil org-attributes n= il org-caption nil fontified nil) 114 117 nil 117 127 (org-label nil org-at= tributes nil org-caption nil fontified nil) 127 133 nil 133 135 (org-protec= ted 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-att= ributes nil org-caption nil fontified nil) 160 168 nil 168 169 (org-label n= il org-attributes nil org-caption nil fontified nil) 169 172 nil 172 185 (o= rg-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-cap= tion 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 (or= g-label nil org-attributes nil org-caption nil fontified nil) 213 223 nil 2= 23 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 fontifie= d nil) 240 243 nil 243 245 (org-protected t) 245 251 (org-label nil org-att= ributes nil org-caption nil fontified nil) 251 252 (org-protected t fontifi= ed nil org-caption nil org-attributes nil org-label nil) 252 254 (org-prote= cted t) 254 272 (org-label nil org-attributes nil org-caption nil fontified= nil) 272 275 nil) "\n" t)
> =A0 (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 separ= ator,
and return a list of substrings. The argument to split-string is correct (t= he raw table
as a string), as is the separator ("\n"). So where does split-str= ing get the ungodly
mess shown above? Is it possible that you have redefined split-string someh= ow? 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 =A0 =A0 =A0 =A0 | Character =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 |\n|----+---------------+----------------------= ---------|\n| =A01 | Allan Alda =A0 =A0| ``Hawkeye'' Benjamin Pierc= e =A0 |\n| =A02 | Gary Burghoff | ``Radar'' Walter O'Reilly =A0= =A0 |\n| =A03 | Loretta Switt | ``Hotlips'' Margaret Hoolihan |\n&= quot; 0 2 nil 2 4 (org-label nil org-attributes nil org-caption nil fontifi= ed nil) 4 7 nil 7 12 (org-label nil org-attributes nil org-caption nil font= ified nil) 12 23 nil 23 32 (org-label nil org-attributes nil org-caption ni= l fontified nil) 32 113 nil 113 114 (org-label nil org-attributes nil org-c= aption 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) 1= 35 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-a= ttributes 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) 2= 40 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 o= rg-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) 27= 2 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. =A0However, the exported latex looks strange - the table
comes *before* the "MASH" section. Is this a bug or is it a pecul= iarity
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}
| =A0id =A0& =A0Actor =A0 =A0 =A0 =A0 =A0& =A0Character =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\\
| \hline
| =A0 1 =A0& =A0Allan Alda =A0 =A0 & =A0``Hawkeye= '' Benjamin Pierce =A0 =A0\\
| =A0 2 =A0& =A0Gary Burghoff =A0& =A0``Radar'' Walter O= 9;Reilly =A0 =A0 =A0\\
| =A0 3 =A0& =A0Loretta Switt =A0& =A0``Hotlips'' Mar= garet Hoolihan =A0\\
| \end{tabular}
| \end{center}
|
|
| \section{MASH}
| \label{sec-1}
|
|
|
| \end{document}
`----

--000e0cd308f26c991d0464b7ece3-- --000e0cd308f26c992a0464b7ece5 Content-Type: text/plain; charset=US-ASCII; name="split-string.txt" Content-Disposition: attachment; filename="split-string.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fs3s3pmu0 c3BsaXQtc3RyaW5nIGlzIGEgY29tcGlsZWQgTGlzcCBmdW5jdGlvbiBpbiBgc3VicicuCihzcGxp dC1zdHJpbmcgU1RSSU5HICZvcHRpb25hbCBTRVBBUkFUT1JTKQoKU3BsaXRzIFNUUklORyBpbnRv IHN1YnN0cmluZ3Mgd2hlcmUgdGhlcmUgYXJlIG1hdGNoZXMgZm9yIFNFUEFSQVRPUlMuCkVhY2gg bWF0Y2ggZm9yIFNFUEFSQVRPUlMgaXMgYSBzcGxpdHRpbmcgcG9pbnQuClRoZSBzdWJzdHJpbmdz IGJldHdlZW4gdGhlIHNwbGl0dGluZyBwb2ludHMgYXJlIG1hZGUgaW50byBhIGxpc3QKd2hpY2gg aXMgcmV0dXJuZWQuCklmIFNFUEFSQVRPUlMgaXMgYWJzZW50LCBpdCBkZWZhdWx0cyB0byAiWyBc Zlx0XG5cclx2XSsiLgoKSWYgdGhlcmUgaXMgbWF0Y2ggZm9yIFNFUEFSQVRPUlMgYXQgdGhlIGJl Z2lubmluZyBvZiBTVFJJTkcsIHdlIGRvIG5vdAppbmNsdWRlIGEgbnVsbCBzdWJzdHJpbmcgZm9y IHRoYXQuICBMaWtld2lzZSwgaWYgdGhlcmUgaXMgYSBtYXRjaAphdCB0aGUgZW5kIG9mIFNUUklO Rywgd2UgZG9uJ3QgaW5jbHVkZSBhIG51bGwgc3Vic3RyaW5nIGZvciB0aGF0LgoKTW9kaWZpZXMg dGhlIG1hdGNoIGRhdGE7IHVzZSBgc2F2ZS1tYXRjaC1kYXRhJyBpZiBuZWNlc3Nhcnku --000e0cd308f26c992a0464b7ece5 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --000e0cd308f26c992a0464b7ece5--