Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow braces in column specification for array env #2122

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

psvenk
Copy link
Contributor

@psvenk psvenk commented Jul 30, 2021

The array environment supports (most of) the same column specifications as the tabular environment does; update the syntax highlighting to reflect this fact and avoid a texGroupError when using braces in the column specification.

Screenshots from a file that I threw together (with :colo default):

Before After
screenshot-2021-07-29-20-19-36 screenshot-2021-07-29-20-24-18

I also updated test/test-syntax/test-array.tex and test/test-syntax/test-array.vim with a test case for this, along with an analogous test case for tabular to the .vim file because that was not already tested.

The array environment supports (most of) the same column specifications
as the tabular environment does; update the syntax highlighting to
reflect this fact and avoid a texGroupError when using braces in the
column specification.
@lervag
Copy link
Owner

lervag commented Jul 30, 2021

Are you sure about this? I've never found any documentation that supports this, and your example does not compile on my end...

image

@krypt-n
Copy link

krypt-n commented Jul 30, 2021

The m{10} seems to require the array package. Replace it with e.g. l to make the example compile without it.

\documentclass{article}

\begin{document}
\[
    \begin{array}{*{4}{l}}
        5
    \end{array}
\]
\end{document}

@psvenk
Copy link
Contributor Author

psvenk commented Jul 30, 2021

Sorry for the confusion. As @krypt-n observed, the examples in the test file do indeed require the array package. I had tested primarily with this file, which does compile on my end without any packages.

image

lervag added a commit that referenced this pull request Jul 30, 2021
@lervag lervag merged commit 8c16d1e into lervag:master Jul 30, 2021
@lervag
Copy link
Owner

lervag commented Jul 30, 2021

Ok, thanks! I've merged and applied some minor adjustments to make the test file compileable.

@psvenk psvenk deleted the array branch July 30, 2021 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants