From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Huszagh Subject: Issues with nested begin..end blocks in inline math environments Date: Fri, 6 Dec 2019 11:42:40 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004c9e1b05990e4000" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54550) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idJV9-00033S-VB for emacs-orgmode@gnu.org; Fri, 06 Dec 2019 14:42:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idJV8-0006Jj-MQ for emacs-orgmode@gnu.org; Fri, 06 Dec 2019 14:42:55 -0500 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:46963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idJV8-00067a-B5 for emacs-orgmode@gnu.org; Fri, 06 Dec 2019 14:42:54 -0500 Received: by mail-lj1-x229.google.com with SMTP id z17so8820590ljk.13 for ; Fri, 06 Dec 2019 11:42:52 -0800 (PST) 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 --0000000000004c9e1b05990e4000 Content-Type: text/plain; charset="UTF-8" I'm experiencing incorrect and seemingly inconsistent behavior when nesting `\begin` `\end` environments inside `\(\)` or `$$`. For example, the following is valid latex code: ``` \(\begin{aligned} b_n &= \frac{1}{\pi} \int_{0}^{\pi} x \sin{\left(nx\right)}dx \\ b_0 &= 0 \\ \int_{0}^{\pi} udv &= \left[uv\right]_{0}^{\pi} - \int_{0}^{\pi} vdu \\ dv &= \sin{\left(nx\right)}dx \\ v(x) &= \int \sin{\left(nx\right)}dx \\ &= -\frac{\cos{\left(nx\right)}}{n} \\ \left[uv\right]_{0}^{\pi} &= -\left[\frac{x\cos{\left(nx\right)}}{n}\right]_{0}^{\pi} \\ &= \left\{\begin{alignedat}{2} \frac{\pi}{n}&, && \quad \text{$n$ odd} \\ -\frac{\pi}{n}&, && \quad \text{$n$ positive even} \\ \end{alignedat}\right. \\ \int_{0}^{\pi} vdu &= \int_{0}^{\pi} -\frac{\cos{\left(nx\right)}}{n} dx \\ &= -\frac{1}{n^2} \left.\sin{\left(nx\right)}\right|_{0}^{\pi} \\ &= 0 \\ b_{n\in \mathbb{Z}^+} &= \left\{\begin{alignedat}{2} \frac{1}{n}&, && \quad \text{$n$ odd} \\ -\frac{1}{n}&, && \quad \text{$n$ positive even} \\ \end{alignedat}\right. \\ \end{aligned}\) ``` But this confuses org which is generating images for the `\begin{aligned}` at the top and the `\text` macros, but nothing else. Iterations on this sometimes work fine, however. For example, ``` \(\begin{aligned} b_{n\in \mathbb{Z}^+} &= \left\{\begin{alignedat}{2} \frac{1}{n}&, && \quad \text{$n$ odd} \\ -\frac{1}{n}&, && \quad \text{$n$ positive even} \\ \end{alignedat}\right. \\ \end{aligned}\) ``` typesets correctly. Has anyone else had trouble with the latex fragment regex's? --0000000000004c9e1b05990e4000 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm experiencing incorrect and seemingly inconsis= tent behavior when nesting `\begin` `\end` environments inside `\(\)` or `$= $`. For example, the following is valid latex code:
```
\(\begin{aligned}
b_n &=3D \frac{1}{\pi} \int_{0}^{\pi} x \sin{\lef= t(nx\right)}dx \\
b_0 &=3D 0 \\
\int_{0}^{\pi} udv &=3D \left= [uv\right]_{0}^{\pi}
=C2=A0 - \int_{0}^{\pi} vdu \\
dv &=3D \sin{= \left(nx\right)}dx \\
v(x) &=3D \int \sin{\left(nx\right)}dx \\
&= amp;=3D -\frac{\cos{\left(nx\right)}}{n} \\
\left[uv\right]_{0}^{\pi} &a= mp;=3D
=C2=A0 -\left[\frac{x\cos{\left(nx\right)}}{n}\right]_{0}^{\pi} \= \
&=3D \left\{\begin{alignedat}{2}
=C2=A0 \frac{\pi}{n}&, &am= p;& \quad \text{$n$ odd} \\
=C2=A0 -\frac{\pi}{n}&, && \= quad \text{$n$ positive even} \\
\end{alignedat}\right. \\
\int_{0}^{= \pi} vdu &=3D
=C2=A0 \int_{0}^{\pi} -\frac{\cos{\left(nx\right)}}{n}= dx \\
&=3D -\frac{1}{n^2} \left.\sin{\left(nx\right)}\right|_{0}^{\= pi} \\
&=3D 0 \\
b_{n\in \mathbb{Z}^+} &=3D \left\{\begin{ali= gnedat}{2}
=C2=A0 \frac{1}{n}&, && \quad \text{$n$ odd} \\=C2=A0 -\frac{1}{n}&, && \quad \text{$n$ positive even} \\\end{alignedat}\right. \\
\end{aligned}\)
```
But t= his confuses org which is generating images for the `\begin{aligned}` at th= e top and the `\text` macros, but nothing else. Iterations on this sometime= s work fine, however. For example,
```
\(\begin{al= igned}
b_{n\in \mathbb{Z}^+} &=3D \left\{\begin{alignedat}{2}
=C2= =A0 \frac{1}{n}&, && \quad \text{$n$ odd} \\
=C2=A0 -\frac{1= }{n}&, && \quad \text{$n$ positive even} \\
\end{alignedat}\= right. \\
\end{aligned}\)
```
typesets correctly. Ha= s anyone else had trouble with the latex fragment regex's?
--0000000000004c9e1b05990e4000--