From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Joost Kremers" Subject: Re: very strange LaTeX error Date: Fri, 20 Dec 2019 13:33:43 +0100 Message-ID: References: <87immbp5ww.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53444) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiHTz-0008Rk-50 for emacs-orgmode@gnu.org; Fri, 20 Dec 2019 07:34:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiHTx-0002jf-9h for emacs-orgmode@gnu.org; Fri, 20 Dec 2019 07:34:14 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59763) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iiHTv-0002fe-AX for emacs-orgmode@gnu.org; Fri, 20 Dec 2019 07:34:11 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0DE4B2222E for ; Fri, 20 Dec 2019 07:34:05 -0500 (EST) In-Reply-To: <87immbp5ww.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org On Fri, Dec 20, 2019, at 12:56 PM, Fraga, Eric wrote: > #+begin_src latex > \documentclass{scrartcl} > \begin{document} > % packages deleted, none of which is used anyway in the following > \tableofcontents > > \section{some results} > \label{sec:org4f5891c} > \begin{table}[hbtp] > \label{atable} > \centering > \begin{tabular}{lrrr} > \hline > x & z1 & z2 & g\\ > \hline > [0.0005, 0.05, 0.5] & 90000.0 & 0.05 & 0.0\\ > [0.000787451, 0.0575948, 0.5] & 110000.0 & 0.05759476698672508 & 0.0\\ > \hline > \end{tabular} > \end{table} > \end{document} > #+end_src > > I get errors like this when compiling with pdflatex: > > #+begin_example > ! Illegal unit of measure (pt inserted). > > , > l.18 [0.000787451, 0.0575948, 0.5] > & 110000.0 & 0.05759476698672508 & 0.0\\ > ! Missing = inserted for \ifdim. > > #+end_example > > What am I doing wrong? You have `[...]` in the first cell of a table row that is not the first row. Few people seem to realise that the double backslash `\\` in LaTeX is a macro that can actually take an optional argument, a measure specifying the height of the newline. So when a table row ends in `\\` (which is the normal case) and the next row starts with an opening bracket, LaTeX assumes it is looking at an optional argument and expects a measure, i.e., a number followed by one of the supported units. The solution I usually opt for is to enclose the brackets in an additional set of braces: `{[...]}`. Whether Org export can and should automate that, I can't say. HTH -- Joost Kremers Life has its moments