From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Tables and Latex "Wrong-number-of-arguments" error Date: Mon, 09 Mar 2009 18:22:32 -0400 Message-ID: <11073.1236637352@alphaville.usa.hp.com> References: <8aca08a00903041048g7318ec54v904b984a50daf4c7@mail.gmail.com> <30B609E1-98D5-4A78-9A20-FCB803263DC7@uva.nl> <8aca08a00903091315r12623c88r3c50f2ef6c7aa8bf@mail.gmail.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lgnse-0002Df-Fo for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 18:23:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lgnsa-0002Bg-2P for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 18:23:27 -0400 Received: from [199.232.76.173] (port=49155 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgnsZ-0002BZ-UN for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 18:23:23 -0400 Received: from g1t0026.austin.hp.com ([15.216.28.33]:23647) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LgnsY-0002vk-Eu for emacs-orgmode@gnu.org; Mon, 09 Mar 2009 18:23:23 -0400 In-Reply-To: Your message of "Mon\, 09 Mar 2009 16\:15\:26 EDT." <8aca08a00903091315r12623c88r3c50f2ef6c7aa8bf@mail.gmail.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: andrew dasys Cc: emacs-orgmode@gnu.org andrew dasys wrote: >=20 > * MASH=20 > | id | Actor | Character | > |----+---------------+---------------------------| > | 1 | Allan Alda | "Hawkeye" Benjamin Pierce | > | 2 | Gary Burghoff | "Radar" Walter O'Reilly | > | 3 | Loretta Switt | "Hotlips" Margaret Hoolihan | >=20 > ....[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 >=20 > Debugger entered--Lisp error: (wrong-number-of-arguments #[(string &optio= nal separators) "=C2=86=05=00=C3=86=C3=87=C3=88=C2=89=19=1A=1B=1C=C3=89 > =C2=83&=00=0B=C3=87=C2=94U=C2=83&=00=0B=0DGW=C2=83&=00=0BT=C2=82'=00=0B#= =C2=83Y=00=C3=87=C2=94=0DGW=C2=83Y=00=C3=8A=12=C3=87=C2=94=C3=87=3D=C2=84S= =00=C3=87=C2=94=C3=87=C2=95=3D=C2=83K=00=C3=87=C2=94=0B=3D=C2=84S=00=0D=0B= =C3=87=C2=94O B=11=C3=87=C2=95=13=C2=82 =00=0B=0DG=3D=C2=84g=00=0D=0B=C3=88= O B=11 =C2=9F,=C2=87" [separators list notfirst start rexp string "[ =09 > =0D=0B]+" 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'' Walt= er 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 n= il) 4 7 nil 7 12 (org-label nil org-attributes nil org-caption nil fontifie= d nil) 12 23 nil 23 32 (org-label nil org-attributes nil org-caption nil fo= ntified nil) 32 113 nil 113 114 (org-label nil org-attributes nil org-capti= on 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 1= 41 (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-labe= l 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-attri= butes 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 fon= tified nil) 194 195 (org-protected t fontified nil org-caption nil org-attr= ibutes 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 2= 43 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-c= aption 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 27= 5 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 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-string get th= e 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 | 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 n= il) 12 23 nil 23 32 (org-label nil org-attributes nil org-caption nil fonti= fied 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 or= g-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 (o= rg-protected t fontified nil org-caption nil org-attributes nil org-label n= il) 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-attribut= es nil org-caption nil fontified nil) 169 172 nil 172 185 (org-label nil or= g-attributes nil org-caption nil fontified nil) 185 188 nil 188 190 (org-pr= otected t) 190 194 (org-label nil org-attributes nil org-caption nil fontif= ied nil) 194 195 (org-protected t fontified nil org-caption nil org-attribu= tes 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-lab= el nil org-attributes nil org-caption nil fontified nil) 224 227 nil 227 24= 0 (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-capt= ion 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 n= il) "\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} |=20 |=20 | \title{andrew-dasys} | \author{Nick Dokos} | \date{09 March 2009} |=20 | \begin{document} |=20 | \maketitle |=20 | \setcounter{tocdepth}{3} | \tableofcontents | \vspace*{1cm} |=20 | \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} |=20 |=20 | \section{MASH} | \label{sec-1} |=20 |=20 |=20 | \end{document} `----