From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id FU83KR3dZ18BJgAA0tVLHw (envelope-from ) for ; Sun, 20 Sep 2020 22:52:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kL26JB3dZ1+6NAAAB5/wlQ (envelope-from ) for ; Sun, 20 Sep 2020 22:52:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1FA589402AA for ; Sun, 20 Sep 2020 22:52:13 +0000 (UTC) Received: from localhost ([::1]:50786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK8Bm-0002Ix-La for larch@yhetil.org; Sun, 20 Sep 2020 18:52:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK8BQ-0002Ii-N1 for emacs-orgmode@gnu.org; Sun, 20 Sep 2020 18:51:48 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:26651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK8BO-0003Y4-79 for emacs-orgmode@gnu.org; Sun, 20 Sep 2020 18:51:48 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 08718240003; Sun, 20 Sep 2020 22:51:40 +0000 (UTC) From: Nicolas Goaziou To: =?utf-8?B?0KHQtdGA0LPQtdC5INCe0LvQtdCz0L7QstC40Yc=?= Subject: Re: Bug: latex nested environments are failed on preview and export [9.3.8 (9.3.8-1-g13dfab-elpaplus @ /home/sd/.emacs.d/elpa/26.3/develop/org-plus-contrib-20200914/)] References: Mail-Followup-To: =?utf-8?B?0KHQtdGA0LPQtdC5INCe0LvQtdCz0L7QstC40Yc=?= , emacs-orgmode@gnu.org Date: Mon, 21 Sep 2020 00:51:34 +0200 In-Reply-To: (=?utf-8?B?ItCh0LXRgNCz0LXQuSDQntC70LXQs9C+0LLQuNGHIidz?= message of "Sun, 20 Sep 2020 23:32:03 +0300") Message-ID: <87v9g8awp5.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=217.70.183.193; envelope-from=mail@nicolasgoaziou.fr; helo=relay1-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/20 18:51:41 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.49 X-TUID: ptBdRtjOPLh4 Hello, =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=9E=D0=BB=D0=B5=D0=B3=D0=BE=D0=B2= =D0=B8=D1=87 writes: > I want to use a matrix environment that is included in an outer > environment, so: > > ``` > Environment: > \begin{equation*} > \left| > \begin{matrix} > a_1 & b_1\\ > a_2 & b_2 > \end{matrix} > \right| > \end{equation*} > > Display--math: > \[ > \left| > \begin{matrix} > a_1 & b_1\\ > a_2 & b_2 > \end{matrix} > \right| > \] > > Inline--math: > \( > \left| > \begin{matrix} > a_1 & b_1\\ > a_2 & b_2 > \end{matrix} > \right| > \) > ``` > > But for the second and third cases (display-math and inline-math) the > preview and export to latex are failed: This is not a bug. \[...\] and \(...\) are inline elements within a paragraph. However, \begin{...}...\end{...} environments are blocks, and they break paragraphs. IOW, you cannot nest them. The following should work however \( \left|\begin{matrix} a_1 & b_1\\ a_2 & b_2 \end{matrix}\right| \) because \begin{matrix} doesn't start the line, and therefore is not seen as starting a new LaTeX block. As a rule of thumb, Org has limited support for raw LaTeX in a document. This is not AucTeX. For specific needs, you may want to use LaTeX blocks, i.e., #+begin_export latex... Regards, --=20 Nicolas Goaziou