长有色绝对值转化为行列式

长有色绝对值转化为行列式

我想通过将适当选择的表达式包裹在一对高彩色垂直线中来表示三角形的面积。这个想法与经常用于表示矩阵行列式的一对垂直线有些相似,但不完全相同。

我想我可以直接写$\text{area}(\triangle ABC)=\lvert \det(M) \rvert$。不过,我当然更愿意使用黑色以外的颜色来表示高垂直线。如下所示:

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\begin{document} 
\[
\text{area}(\triangle ABC)= 
%%  some code here ...
\frac{1}{2} \begin{vmatrix}
\ldots & \ldots & \ldots  \\ 
\ldots & \ldots & \ldots \\ 
\ldots & \ldots & \ldots  \\ 
\ldots & \ldots & \ldots  
\end{vmatrix}   
%%  some more code here ...
\]
\end{document}

答案1

我提出这三种解决方案,第二种解决方案的绝对值符号略长于行列式的垂直线,最后一种解决方案使用命令\det,以便您可以选择:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{mathtools}
\usepackage{array}
\usepackage[svgnames]{xcolor}

\begin{document}

\[\text{area}(\triangle ABC)=\begin{array}{@{\color{Coral}\vrule width 0.6pt\,}c@{\,\color{Coral}\vrule width 0.6pt}}\begin{vmatrix}
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots
\end{vmatrix} \end{array}\]

\[\text{area}(\triangle ABC)={\color{Coral}\begin{vmatrix}{\color{black}\begin{vmatrix}
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots
\end{vmatrix}^{\mathstrut}_{\vphantom{j}}} \end{vmatrix} } \]

\[\text{area}(\triangle ABC)=\begin{array}{@{\color{Coral}\vrule width 0.6pt\mkern 3mu}c@{\color{Coral}\vrule width 0.6pt}}{\det}\mkern-6mu\begin{pmatrix}
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots
\end{pmatrix} \end{array}\]

\end{document} 

在此处输入图片描述

答案2

像这样吗?

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage{mathtools}
\DeclareMathOperator{\area}{area}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[dvipsnames]{xcolor}
\newcommand\orangebars[1]{%
  \begingroup \colorlet{current}{.} \color{orange} \left\vert 
  \begingroup \color{current} #1^{\mathstrut} \kern-\scriptspace \endgroup 
  \right\vert \endgroup
}

\begin{document} 
\[
  \area(\triangle ABC) =
  \orangebars{%
     \begin{vmatrix}
     \dots & \dots & \dots \\ 
     \dots & \dots & \dots \\ 
     \dots & \dots & \dots 
  \end{vmatrix}}
\]
\end{document}

附录:更改orangeRedOrange#1^{\mathstrut}至将#1^{\strut}生成以下输出:

在此处输入图片描述

如果您发现很难决定橙色和红色之间的颜色,这里有三种中间色调:珊瑚色、番茄色和橙红(需要使用xcolor选项加载包svgnames)。:-)

在此处输入图片描述

\documentclass{article}
\usepackage[svgnames]{xcolor}
\newcommand\myrule{\rule{2em}{4em}}
\newcommand\manyhues{\color{orange}\myrule\color{Coral}\myrule%
  \color{Tomato}\myrule\color{OrangeRed}\myrule\color{red}\myrule}
\begin{document} 
\manyhues
\end{document}

答案3

一个办法:

\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyph

\usepackage{xparse}
\usepackage{color}

\ExplSyntaxOn
\NewDocumentCommand { \BigAbs }{ m }
  {  
    \hbox_set:Nn \l_tmpa_box { $ #1 $ }
    \dim_set:Nn \l_tmpa_dim { \box_ht:N \l_tmpa_box + 3 mm }
    \dim_set:Nn \l_tmpb_dim { \box_dp:N \l_tmpa_box + 3 mm }
    \mathopen{
    \color { red }
    \vrule height \l_tmpa_dim depth \l_tmpb_dim width 1 pt } 
    \; \box_use:N \l_tmpa_box \; 
    \mathclose{
    \color { red }
    \vrule height \l_tmpa_dim depth \l_tmpb_dim width 1 pt }
  }
\ExplSyntaxOff

\begin{document} 
\[\text{area}(\triangle ABC)=
\BigAbs{\begin{vmatrix}
\ldots & \ldots & \ldots  \\ 
\ldots & \ldots & \ldots \\ 
\ldots & \ldots & \ldots  \\ 
\ldots & \ldots & \ldots  
\end{vmatrix}}\]
\end{document}

在此处输入图片描述

相关内容