texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.85k stars 346 forks source link

Accepting newlines in tabular preambles #3804

Closed muzimuzhi closed 2 months ago

muzimuzhi commented 2 months ago

Describe the feature and the current behavior/state

It seems in texstudio v4.8.3, the tabular content is not properly recognized (e.g., &s are not highlighted) when the tabular preamble contains (non-consecutive) newlines.

\documentclass{article}
\usepackage{siunitx}

\begin{document}
\begin{tabular}{ll}
  a & b
\end{tabular}

\begin{tabular}{
ll}
  a & b
\end{tabular}

\begin{tabular}{
  |S[table-alignment-mode=format,table-number-alignment=right]
  |S[table-alignment-mode=format,table-number-alignment=center]
  |S[table-alignment-mode=format,table-number-alignment=left]
  |
}
  1.1 & 2.2 & 3.3
\end{tabular}
\end{document}

image

Who will benefit with this feature?

Especially users of S column type from siunitx package, see https://github.com/lvjr/tabularray/issues/512 and examples in the siunitx package manual, sec. 4.12 Tabular material.

Any Other info

sunderme commented 2 months ago

implemented with b16af3e