From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Lomov Subject: Re: Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)] Date: Tue, 14 Jan 2014 08:56:37 +0900 Message-ID: <20140113235637.GB912@smoon> References: <1389475109.23348.YahooMailNeo@web184706.mail.ne1.yahoo.com> <87sisrkepy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2rND-0004dX-8G for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 18:56:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2rN4-00076I-Re for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 18:56:51 -0500 Received: from mail-lb0-x22b.google.com ([2a00:1450:4010:c04::22b]:48679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2rN4-000763-JR for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 18:56:42 -0500 Received: by mail-lb0-f171.google.com with SMTP id c11so463934lbj.30 for ; Mon, 13 Jan 2014 15:56:41 -0800 (PST) Received: from smoon ([164.215.91.25]) by mx.google.com with ESMTPSA id ko6sm6081296lac.1.2014.01.13.15.56.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jan 2014 15:56:40 -0800 (PST) Content-Disposition: inline In-Reply-To: <87sisrkepy.fsf@gmail.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello, ** Nicolas Goaziou [2014-01-13 17:51:05 +0100]: > Hello, > Jon Degenhardt writes: >> Export to Latex (org-latex-export-to-pdf) generates incorrect latex when >> list items start with a left square bracket. This occurs because the >> \item command interprets the left square bracket as the start of an >> argument list. An example: >>    An item list: >>    - abc def >>    - [def] ghi >>    - [jkl m n o] >>    - pqr >> This produces the latex fragment: >>    An item list: >>    \begin{itemize} >>    \item abc def >>    \item [def] ghi >>    \item [jkl m n o] >>    \item pqr >>    \end{itemize} >> The pdf output renders the second and third items incorrectly. If there >> is no right bracket to terminate the argument, then pdf generation may >> fail with message: >>   >>    org-latex-compile: PDF file ./example.pdf wasn't produced: Runaway >> argument > Thank you for the report. Would the following patch solves the problem? I didn't test this patch, and could interpret it wrong, but, IMHO, when exporting lists to LaTeX into itemize or enumerate environments the most suitable approach would be to insert '\item's as \item{} or \item\relax Both prevents LaTeX engine to read next character and interpret it in some special way (simple \item read next character and if it is [], then it assumes that this is an optional argument to the command). > Regards, --- WBR, Vladimir Lomov -- I had the rare misfortune of being one of the first people to try and implement a PL/1 compiler. -- T. Cheatham