1

I'm trying to make this matrix looks nicer. Currently the horizontal line coincides with the $A^\top$. How can I make it so $A^\top$ doesn't intersect with the horizontal line? This is what I have:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
Original matrix:

\[
\left[\begin{array}{cccc}
            \multicolumn{1}{c|}{A^\top}\\ \cline{1-2}
            ~&\multicolumn{1}{|c|}{A^\top}\\ \cline{2-2}
            ~&~&\ddots\\ \cline{4-4}
            ~&~&~&\multicolumn{1}{|c}{A^\top} \\
        \end{array} \right]
\]

Matrix with .25cm space after each row

\[
\left[\begin{array}{cccc}
            \multicolumn{1}{c|}{A^\top}\\[.25cm] \cline{1-2}
            ~&\multicolumn{1}{|c|}{A^\top}\\[.25cm] \cline{2-2}
            ~&~&\ddots\\[.25cm] \cline{4-4}
            ~&~&~&\multicolumn{1}{|c}{A^\top} \\[.25cm]
        \end{array} \right]
\]
\end{document}

example

0

I wrapped the A^\top in an \addstackgap (stackengine package). The default vertical gap added is 3pt, which can be redefined (\setstackgap{S}{5pt}) or else overridden with an optional argument (\addstackgap[5pt]{...}).

\documentclass{article}
\usepackage{amsmath,stackengine}
\stackMath
\begin{document}
Original matrix:

\[
\left[\begin{array}{cccc}
            \multicolumn{1}{c|}{A^\top}\\ \cline{1-2}
            ~&\multicolumn{1}{|c|}{\addstackgap{A^\top}}\\ \cline{2-2}
            ~&~&\ddots\\ \cline{4-4}
            ~&~&~&\multicolumn{1}{|c}{\addstackgap{A^\top}} \\
        \end{array} \right]
\]

\end{document}

enter image description here

0

Another possibility with bigstrut cellspace and booktabs:

\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{bigstrut}
\usepackage{cellspace} %

\begin{document}

Original matrix:

\[
\left[\begin{array}{cccc}
            \multicolumn{1}{c|}{A^\top}\\ \cline{1-2}
            ~&\multicolumn{1}{|c|}{A^\top}\\ \cline{2-2}
            ~&~&\ddots\\ \cline{4-4}
            ~&~&~&\multicolumn{1}{|c}{A^\top} \\
        \end{array} \right]
\]
\vskip1cm
\[ \setlength{\aboverulesep}{0pt}\setlength{\belowrulesep}{0pt}
\setlength{\cmidrulewidth}{0.4pt}\bigstrutjot=4pt
\begin{bmatrix}
        \multicolumn{1}{c|}{A^{\top}\bigstrut[t]}\\ \cmidrule(l{0.35em}){1-2}
         &\multicolumn{1}{!{\kern-0.4pt\vrule}c|}{A^{\top}\bigstrut[t]}\\[-0.4pt] \cmidrule{2-2}
         & & \ddots\\ \cmidrule(r{0.35em}){4-4}
         & & &\multicolumn{1}{|c}{A^{\top}\bigstrut}
    \end{bmatrix} \]

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.