emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Export of this table fails LuaLaTeX compilation


From: Max Nikulin
Subject: Re: Export of this table fails LuaLaTeX compilation
Date: Wed, 12 Oct 2022 23:21:54 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 12/10/2022 16:17, gerard.vermeulen@posteo.net wrote:


On 12.10.2022 07:55, Max Nikulin wrote:
On 12/10/2022 12:15, gerard.vermeulen wrote:
On 12.10.2022 06:45, Max Nikulin wrote:

LuaLaTeX is irrelevant. It seems \hline is allowed only immediately
after \\. Minimal LaTeX example:

\begin{tabular}{l}
b\\\relax
\hline
\end{tabular}

Your example fails on my Mac texlive-2020 with:

! Misplaced \noalign.
\hline ->\noalign
                   {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...

l.40 \hline

It compiles when I remove \hline

Gerard, we forgot to post the reason why \relax has been added after
\\. The intention was to  prevent errors in the case of

| a   |
| [b] |

or

- item \\
  [2022-10-12]

Stewart Thomas. [BUG] Tables with square brackets do not compile in
PDF (latex) export. Wed, 10 Nov 2021 11:16:10 -0500.
https://list.orgmode.org/CAO12V+wB18nAN0FuDPAeN94GHdt_2nbdJtc4u7n4W3HAZbaZsA@mail.gmail.com

I can not figure out an easy way to separate \\ from [b] text but to
prevent the problem you have discovered. I am unsure if

    \\[0pt]

has no negative consequences and safe enough. I expect that LaTeX
sources are not easy to read when fragile sequences of tokens are
involved.

I just have realized that some users might take advantage of earlier
behavior as a feature:

- item \\
  [1cm]
- item

I think that [1cm] should be treated as text, however I have no idea
how to allow users to specify amount of vertical space and to not
limit line break to LaTeX only. @@latex:\\[1cm]@@ is not suitable when
the same text should be exported to ascii, html, etc.

Max, thanks for the background information.

For your info:
1. I also need to remove \relax in the LaTeX export using Gentoo texlive-2022 to compile.

Adding \relax is my fault, I did not expect that it may break \hline. Such behavior should be stable over decades. The question is how to allow users to have square brackets in the beginning of the line following \\ and not break some use case.

2. On my systems ws-butler removes the trailing whitespace.
3. I edited your example with nano to add the trailing space after \relax, but it still does not compile.

Sorry, I did not get your point with trailing space. LaTeX ignores spaces after commands (e.g. "a\relax b" becomes "ab") and in the beginning of the line. What I am afraid of is unintentionally introduce white space at the beginning of the line, e.g. if
| a |
| b |
|---|
is exported as
{} a \\
{} b \\
\hline
then cell contents will be " a" and " b", not "a" and "b".
\relax a \\
\relax b \\
\hline
has no such problem.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]