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_2nbdjtc4u7n4w3hazba...@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.
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.