From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [bug][ox-latex] Captions in equations Date: Sun, 19 Jan 2014 15:14:56 +0100 Message-ID: <87zjms83dr.fsf@gmx.us> References: <87txd16q0s.fsf@gmx.us> <87iotg1ffu.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4t5b-0007ln-87 for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 09:11:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4t5V-00008f-58 for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 09:11:03 -0500 Received: from mout.gmx.net ([212.227.15.19]:61667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4t5U-000067-Rm for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 09:10:57 -0500 Received: from W530 ([109.201.154.152]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LwGDy-1VGdk039rS-0186kx for ; Sun, 19 Jan 2014 15:10:55 +0100 In-Reply-To: <87iotg1ffu.fsf@gmail.com> (Nicolas Goaziou's message of "Sun, 19 Jan 2014 10:36:21 +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: n.goaziou@gmail.com Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Nicolas Goaziou writes: > 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. OK. I can prepare a patch. > 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. Indeed this seems long-term. I have only rarely seen math-floats. It is, however, sometimes used in elsarticle.cls from the Elsevier publishing house. See this example: http://bayimg.com/aAHDfAAFE Here the caption can be seen as the text below the equation, ("Where =CE=9B(=C2=B7) is...") and (16) is the reference. The attached file play around with some preliminary LaTeX styles for this. In LaTeX the floating would be kind of odd, I think. At the very least math floats shouldn't be Figure or Tables (IMO); unfortunately the Internets seem to suggest that you usually create additional floats via packages such as newfloat of "caption". HTML should also be considered... =E2=80=93Rasmus -- This space is left intentionally blank --=-=-= Content-Type: text/x-tex Content-Disposition: attachment; filename=test.tex \documentclass[11pt]{article} \usepackage{amsmath} \begin{document} first equation \begin{equation} x=1 \end{equation} Second equation \par\noindent\fbox{\parbox{\textwidth}{ \begin{equation} x=2\Lambda(x) \end{equation} Here, $\Lambda(\cdot)$ is \dots}} \begin{figure} \fbox{\parbox{\textwidth}{\[g=3\]}}\caption{Third caption} \end{figure} \end{document} --=-=-=--