3

I need to use the package unicode-math in my document, but this makes the height of the brackets in the matrix look too short. (The matrices of order 2 seem to be normal, though.) I have tried various fonts like

  • Latin Modern Math,
  • NewCM Math,
  • TeX Gyre Math,
  • Asana Math,
  • Libertinus Math, and
  • Fira Math.

They all have the same problem. Here is an MWE and the output for both pdfLaTeX and LuaLaTeX.

\documentclass{article}
\usepackage{amsmath} % for 'bmatrix' environment

\usepackage{iftex}
\ifpdftex
  \usepackage{lmodern}
\else
  \usepackage{unicode-math}
  \setmathfont{Latin Modern Math}
\fi

\begin{document}
\[
    \begin{bmatrix}
        \hline
        a & b & c \\
        d & e & f \\
        g & h & i 
    \end{bmatrix}
\]
\end{document}

With pdfLaTeX, I get the following output:

enter image description here

whereas with LuaLaTeX, I get this output:

enter image description here

The problem arises with pmatrix environments as well. Any insights or solutions would be greatly appreciated.

7
  • I've taken the liberty of streamlining your already-nice MWE to focus on the 3x3 matrix case. Feel free to revert.
    – Mico
    Commented May 29 at 2:00
  • What, exactly, is wrong? You can try to change \delimitershortfall, for example to set it to 0pt. But that will typically change other delimiters as well. (I would be more worried about the clash one gets if one changes the lower case c to an upper case, or to a lower case f.)
    – mickep
    Commented May 29 at 6:23
  • @mickep I don't want to force a change in the height calculation for delimiters. Moreover, have a try with ` \makeatletter \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{% \hskip -\arraycolsep \let\@ifnextchar\new@ifnextchar \array{#1} } \makeatother \begin{bmatrix}[cc|c] 0 & 0 & 7 \\ 0 & 6 & 0 \\ 5 & 0 & 0 \end{bmatrix} `. You'll notice that the brackets deserve to be as high as the vertical line. Commented May 29 at 8:22
  • I do not understand. You want to use delimiters. You want them to be bigger. But you do not want to force a change.
    – mickep
    Commented May 29 at 13:56
  • @mickep Apologies for the unclear narrative. I don't want the delimiters to get taller, just that in a few cases they are unreasonably shorter than they were. This problem is not universal, it only appears in matrices. And the case of matrix of order 2 is sufficient to show that the issue should not be caused by \delimitershortfall. Commented May 29 at 15:35

0

You must log in to answer this question.

Browse other questions tagged .