lvjr / tabularray

Typeset tabulars and arrays with LaTeX3
https://ctan.org/pkg/tabularray
254 stars 22 forks source link

Unexpected behavior when setting baseline in a +bmatrix #300

Closed lvjr closed 2 years ago

lvjr commented 2 years ago

Discussed in https://github.com/lvjr/tabularray/discussions/299

Originally posted by **swarn** August 26, 2022 I have a `+bmatrix` inside a `tblr`. As expected, the default baseline is in the middle: ![ex1](https://user-images.githubusercontent.com/926528/186761004-5a4232d1-a449-4458-a15c-a7c1fb52817e.png) When I set the baseline of the matrix, the text aligns, but the brackets do not: ![ex2](https://user-images.githubusercontent.com/926528/186761152-20c6e119-5c38-4dd3-a748-8133efc899db.png) The `nicematrix` package shows my expected behavior: ![ex3](https://user-images.githubusercontent.com/926528/186761709-871176f5-01e6-410a-8ff9-749e70425dfe.png) That works, but I enjoy `tabularray` and would be happier not to add another package. Code for all examples is below. Am I missing something?
Minimum working example ```tex \documentclass{article} \usepackage{amsmath,tabularray} \usepackage{nicematrix} \UseTblrLibrary{amsmath} \begin{document} \begin{tblr} { colspec={l c X[l]} } a & $\begin{+bmatrix} x \\ y \\ z \end{+bmatrix}$ & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \\ b & $t$ \\ c & $i$ & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt. \\ \end{tblr} \vspace{1in} \begin{tblr} { colspec={l c X[l]} } a & $\begin{+bmatrix}[baseline=t] x \\ y \\ z \end{+bmatrix}$ & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \\ b & $t$ \\ c & $i$ & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt. \\ \end{tblr} \vspace{1in} % Nicematrix version \begin{tblr} { colspec={l c X[l]} } a & $\begin{bNiceMatrix}[baseline=t] x \\ y \\ z \end{bNiceMatrix}$ & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \\ b & $t$ \\ c & $i$ & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt. \\ \end{tblr} \end{document} ```
lvjr commented 2 years ago

This bug should has been fixed. You may download the latest package file https://github.com/lvjr/tabularray/raw/main/tabularray.sty and test whether there are other problems.