2

I'm using \vrule in the matrix and pmatrix environments, and it works well. However, inside smallmatrix, \vrule doesn't fill all height of row. It looks that smallmatrix adds some vertical space after each row. Is it possible to get rid of it?

Here is minimal working example to compare \vrule in matrix (works well) and small matrix (doesn't work well):

\documentclass[12pt,sumlimits,a4paper,intlimits,namelimits,twoside]{article} \overfullrule5pt \usepackage[T2A]{fontenc} \usepackage[cp1251]{inputenc} \usepackage[russian,ukrainian]{babel} \usepackage{array} \usepackage{amsmath,amsthm,amsfonts,amssymb} \begin{document} $$ \begin{smallmatrix} 2 & \vline \\\ 2 & \vline \\\ 2 & \vline \\\ 2 & \vline \\\\[2pt]\hline & \vline \\\\[1pt] 2 & \vline \\\ 2 & \vline \\\ 2 & \vline \end{smallmatrix}\quad \begin{matrix} 2 & \vline \\\ 2 & \vline \\\ 2 & \vline \\\ 2 & \vline \\\\[2pt]\hline & \vline \\\\[1pt] 2 & \vline \\\ 2 & \vline \\\ 2 & \vline \end{matrix} $$ \end{document} 

The result of this example is below. Thanks in advance

enter image description here

4
  • 1
    You should add a MWE! Commented Aug 9, 2019 at 15:36
  • @Black Mild Thanks for reply. What is it MWE? Commented Aug 10, 2019 at 21:00
  • MWE= minimal working example. This is a rule of this site. Please read before asking for help! Commented Aug 10, 2019 at 21:06
  • @Black Mild MWE is done. Commented Aug 11, 2019 at 11:07

2 Answers 2

3

With new package tabularray:

\documentclass[12pt,sumlimits,a4paper,intlimits,namelimits,twoside]{article} \overfullrule5pt \usepackage[T2A]{fontenc} \usepackage[cp1251]{inputenc} \usepackage[russian,ukrainian]{babel} \usepackage{array} \usepackage{amsmath,amsthm,amsfonts,amssymb} \usepackage{tabularray} \begin{document} \[ \begin{tblr}{ colspec={c|c}, stretch=0, colsep=1.5pt, rowsep=1.5pt, row{4}={belowsep=2pt}, row{5}={abovesep=2pt}, column{1-2}={font=\scriptstyle}, column{2}={colsep=2.7pt}, } 2 & \\ 2 \\ 2 \\ 2 \\ \hline 2 \\ 2 \\ 2 \\ 2 \end{tblr} \quad \begin{tblr}{colspec={c|c}, column{2}={colsep=2.7pt}} 2 & \\ 2 \\ 2 \\ 2 \\ \hline 2 \\ 2 \\ 2 \\ 2 \end{tblr} \] \end{document} 

enter image description here

3

With {NiceArray} of nicematrix, you have the key small.

\documentclass{article} \usepackage{nicematrix} \begin{document} $\begin{NiceArray}{c|c}[small,cell-space-limits=1pt] 2 & \\ 2 \\ 2 \\ 2 \\ \hline 2 \\ 2 \\ 2 \\ 2 \\ \end{NiceArray}$ \qquad $\begin{NiceArray}{c|c} 2 & \\ 2 \\ 2 \\ 2 \\ \hline 2 \\ 2 \\ 2 \\ 2 \\ \end{NiceArray}$ \end{document} 

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.