[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: latex nested environments are failed on preview and export [9.3
From: |
Nicolas Goaziou |
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/)] |
Date: |
Mon, 21 Sep 2020 00:51:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hello,
Сергей Олегович <sdorof1@gmail.com> 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,
--
Nicolas Goaziou