\cline 超出矩阵

\cline 超出矩阵

我正在尝试重现以下矩阵

在此处输入图片描述

我尝试过这个:

\begin{equation*}
\begin{bmatrix}[ccc:c]
a_{11} & \cdots & a_{1n} & b_1 \\
\vdots &  & \vdots & \vdots \\
a_{n1} & \cdots & a_{nn} & b_n
\end{bmatrix}\sim
\begin{bmatrix}[ccc|ccc:c]
a'_{11} & & 0 & & & & b'_1 \\
 & \ddots & & & \mbox{\Huge 0} & & \vdots \\
 0 & & a'_{kk} & & & & \vdots \\ \cline{1-6}
  & & & a'_{kn} & & & \vdots \\
  & \mbox{\Huge 0} & & & \ddots & & \vdots \\
  & & & & & & b'_k
\end{bmatrix}
\end{equation*}

但我明白这一点:

在此处输入图片描述

为什么左边会\cline“超出矩阵界限”?

我的序言如下:

\documentclass[a4paper,12pt,twoside]{article}


\usepackage{amsmath,amssymb,amsthm,amssymb}
\usepackage{mathtools}
\usepackage{bbm}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage{float}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[croatian]{babel}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enumerate}
\usepackage{fullpage}
\usepackage[dvipdfm,colorlinks=true,pdfstartview=FitB,bookmarks=false,urlcolor=blue,citecolor=LimeGreen,linkcolor=BrickRed,bookmarksnumbered]{hyperref}
\usepackage{url}
%\usepackage[all]{hypcap}
\usepackage{tgtermes}
\usepackage{newtxmath}
\usepackage[usenames,dvipsnames,svgnames]{xcolor}
\usepackage{titlesec}
\usepackage{wrapfig}
\usepackage{arydshln,leftidx}
\usepackage{multirow}
\usepackage{bigdelim}
%\usepackage{subcaption}
%\usepackage[labelformat=empty]{caption}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usetikzlibrary{decorations.shapes}

% Table float box with bottom caption, box width adjusted to content
\newfloatcommand{capbtabbox}{table}[][\FBwidth]

\makeatletter
  \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
    \hskip -\arraycolsep
    \let\@ifnextchar\new@ifnextchar
  \array{#1}}
\makeatother

\newtheorem{crteorem}{Teorem}
\newtheorem{podt}{Podteorem}
\newtheorem{definicija}{Definicija}
\newtheorem{korolar}{Korolar}
\newtheorem{lema}{Lema}

\titleformat*{\section}{\normalfont\Large\bfseries\color{RoyalBlue}}
\titleformat*{\subsection}{\normalfont\large\bfseries\color{PineGreen}}
\titleformat*{\subsubsection}{\normalfont\normalsize\bfseries\color{RedViolet}}


\renewcommand{\d}[2]{\frac{d #1}{d #2}} % derivacije
\newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} % druga derivacija
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} 
% parcijalna derivacija
\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} 
% druga parcijalna derivacija
\newcommand{\abs}[1]{\left| #1 \right|} % za apsolutnu vrijednost

\makeatletter
\def\Ddots{\mathinner{\mkern1mu\raise\p@
\vbox{\kern7\p@\hbox{.}}\mkern2mu
\raise4\p@\hbox{.}\mkern2mu\raise7\p@\hbox{.}\mkern1mu}}
\makeatother

\urlstyle{rm}

\numberwithin{equation}{section}
\thispagestyle{headings}
\pagenumbering{roman}

我尝试加载最少量的包(比如数学包),但在这种情况下,tex 无法识别 [ccc|ccc:c] 部分:此外,第二个矩阵的右上侧有点不均匀:S

答案1

bmatrix用数组替换。以下是 MWE:

\documentclass[a4paper,12pt,twoside]{article}

\usepackage{amsmath,amssymb,amsthm,amssymb}
\usepackage{arydshln}

\begin{document}

\begin{equation*}
\left[\begin{array}{ccc:c}
a_{11} & \cdots & a_{1n} & b_1 \\
\vdots &  & \vdots & \vdots \\
a_{n1} & \cdots & a_{nn} & b_n
\end{array}\right]
\sim
\left[\begin{array}{ccc|ccc:c}
a'_{11} & & 0 & & & & b'_1 \\
 & \ddots & & & \mbox{\Huge 0} & & \vdots \\
 0 & & a'_{kk} & & & & \vdots \\ \cline{1-6}
  & & & a'_{kn} & & & \vdots \\
  & \mbox{\Huge 0} & & & \ddots & & \vdots \\
  & & & & & & b'_k
\end{array}\right]
\end{equation*}

\end{document}

输出:
输出

如果需要更多空间,可以稍微调整一下数组格式。例如,尝试用 代替@{\hspace{1cm}|\hspace{3mm}}|你就会明白。

至于包,您需要在表格环境中arydshln使用:垂直虚线(即array上面的 s)。

相关内容