From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug][ox-latex] Captions in equations Date: Sun, 19 Jan 2014 10:36:21 +0100 Message-ID: <87iotg1ffu.fsf@gmail.com> References: <87txd16q0s.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4onV-0001hz-50 for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 04:36:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4onP-0006D3-B2 for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 04:36:05 -0500 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:36471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4onP-0006BB-4M for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 04:35:59 -0500 Received: by mail-wi0-f181.google.com with SMTP id hi8so2199464wib.8 for ; Sun, 19 Jan 2014 01:35:58 -0800 (PST) In-Reply-To: <87txd16q0s.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 18 Jan 2014 20:36:35 +0100") 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: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > This example produces invalid LaTeX code: > > #+CAPTION: test > #+ATTR_LATEX: :mode math :environment pmatrix > | \alpha | \beta | \gamma | > > Namely, > > \begin{equation} > \caption{test text} > \mathbf{H}=3D\begin{pmatrix} > \vdots & 0 & \vdots \\ > \vdots & H & \vdots \\ > \vdots & 0 & \vdots \\ > \end{pmatrix}. > \end{equation} > > But an equation cannot have a caption. > > I'm not sure what the desired behavior is. (i) To silently drop the > caption, (ii) to wrap the equation in some sort of float and give it a > caption; or (iii) to print the text sans the \caption{=C2=B7}. > > (iii) can be archived with math-prefix. (ii) is a bit weird, but > could be archived relatively easy, but it's not really what one would > expect; it's consistent with how captions work for tables (turned into > a float when a caption is present). (i) is also a bit weird, but > seems the most reasonable to me. > > Since I don't know what the correct behavior is, I don't have a patch > right now. As a short term solution, I think the (i) is the best. That's exactly what happens to LaTeX environments: in `org-latex-latex-environment', the caption is dropped and only the label, if any, is inserted in the environment. As a long term solution, it would be interesting to be able to do (ii), for both tables in math mode (but not in inline-math) and LaTeX environments: captioning an equation is a reasonable request. Regards, --=20 Nicolas Goaziou