类似 \textcorner 的三角形

类似 \textcorner 的三角形

我希望用 $M_n^\textcorner(K)$ 表示所有上三角矩阵的代数,但 $\textcorner$ 为三角形。我该如何创建这个符号(添加额外的对角线)?

在此处输入图片描述

我目前的序言:

\documentclass[b4paper, twoside, final, openodd, 10pt]{book}
\usepackage{etex}
\usepackage[english]{babel}
\usepackage[cp1250]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{charter}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[framed, thmmarks]{ntheorem}
\usepackage{framed}
\usepackage{tikz}
    \usetikzlibrary{shadows,matrix,arrows}
\usepackage{hyperref}
    \hypersetup{bookmarksopen=false, pdfpagelayout=TwoPageLeft, pdflinkmargin=0pt}  %colorlinks=true, linkcolor={blue}, citecolor={green}, urlcolor={medium-blue}
\usepackage[numbered]{bookmark}
\usepackage[all]{xy}
\usepackage{mathtools}
\usepackage{animate}
\usepackage{subfigure}
\usepackage{caption}
    \captionsetup{labelformat=empty,labelsep=none}
\usepackage{verbatim}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{longtable}
    \setlength{\LTpre}{0pt}\setlength{\LTpost}{0pt}
\usepackage{wrapfig}
\usepackage{cancel}
\usepackage{enumitem}
\usepackage[subfigure]{tocloft}
\usepackage[top=2.1cm, bottom=2.9cm, left=2.1cm, right=2.1cm]{geometry}
\usepackage{stmaryrd}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%        new definition of SQUARE ROOT: it renames \sqrt as \oldsqrt ()            %%
%%======http://tex.stackexchange.com/questions/29834/closed-square-root-symbol======%%
\usepackage{letltxmacro}                                                            %%
\LetLtxMacro{\oldsqrt}{\sqrt}                                                       %%
\renewcommand{\sqrt}[1][\hphantom{3}]{ \def\DHLindex{#1}\mathpalette\DHLhksqrt }    %%
\def\DHLhksqrt#1#2{ \setbox0=\hbox{$#1\oldsqrt[\DHLindex]{#2\,}$}\dimen0=\ht0       %%
                    \advance\dimen0-0.2\ht0                                         %%
                    \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}                %%
                    {\box0\lower0.4pt\box2} }                                       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                      DASHED and DOTTED UNDERLINE (ulem)                      %%
%%==============================================================================%%
\usepackage[normalem]{ulem}                                                     %%
\def\dotuline{\bgroup                                                           %%
  \ifdim\ULdepth=\maxdimen  % Set depth based on font, if not set already       %%
  \settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi                                %%
  \markoverwith{\begingroup                                                     %%
  \advance\ULdepth0.08ex                                                        %%
  \lower\ULdepth\hbox{\kern.15em .\kern.1em}                                    %%
  \endgroup}\ULon}                                                              %%
%%------------------------------------------------------------------------------%%
\def\dashuline{\bgroup                                                          %%
  \ifdim\ULdepth=\maxdimen  % Set depth based on font, if not set already       %%
  \settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi                                %%
  \markoverwith{\kern.15em                                                      %%
  \vtop{\kern\ULdepth \hrule width .3em}                                        %%
  \kern.15em}\ULon}                                                             %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           CUSTOMIZED CHAPTER HEADINGS                            %%
%%==================================================================================%%
\usepackage{titlesec}   %za spreminjat chapter headinge v Article, Book, Report     %%
\usepackage{fix-cm}     %da popravi nesoglasja po redefiniranju dolžin              %%
%\titleformat{command}[shape]{format}{label}{sep}{before}[after]                    %%
\titleformat{\chapter}                                                              %%
            {\bfseries\fontsize{30pt}{25pt}\selectfont}                             %%
            {\thechapter}                                                           %%
            {8pt}                                                                   %%
            {}                                                                      %%
\titleformat{\section}                                                              %%
            {\bfseries\fontsize{22pt}{16pt}\selectfont}                             %%
            {\thesection}                                                           %%
            {5pt}                                                                   %%
            {}                                                                      %%
\titleformat{\subsection}                                                           %%
            {\fontsize{18pt}{10pt}\selectfont}                                      %%
            {\thesubsection}                                                        %%
            {4pt}                                                                   %%
            {}                                                                      %%
\titleformat{\subsubsection}                                                        %%
            {\fontsize{16pt}{10pt}\selectfont}                                      %%
            {\thesubsubsection}                                                     %%
            {4pt}                                                                   %%
            {}                                                                      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%              CUSTOMIZED THEOREMS (ntheorem + TikZ)               %%
%-------------------------------------------------------------------%%
\theoremheaderfont{\normalfont}                                     %%
\theoremseparator{\bfseries :}                                      %%
\theorembodyfont{\normalfont\it}                                    %%
\newtheorem{envThm}{{\large\bfseries Theorem}}[section]             %%
%-------------------------------------------------------------------%%
\theoremheaderfont{\normalfont}                                     %%
\theoremseparator{\bfseries :}                                      %%
\theorembodyfont{\normalfont\it}                                    %%
\newtheorem{envPrp}[envThm]{{\large\bfseries Proposition}}          %%
%-------------------------------------------------------------------%%
\theoremheaderfont{\large}                                          %%
\theoremseparator{\bfseries :}                                      %%
\theorembodyfont{\normalfont}                                       %%
\newtheorem{envExp}[envThm]{{\large\bfseries Examples}}             %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\labelenumi}{\alph{enumi})}

答案1

我对库进行了一些实验tikz,发现有一种方法可以提供这样的符号,它可以随着字体大小而缩放。

\documentclass{scrbook}
\usepackage{tikz}
\usepackage{xkeyval}
\usepackage{xcolor}
\usepackage{amsmath} % Not needed actually, but include if \boldmath is used
\boldmath % Not needed actually

\makeatletter
\define@key{TriSymFamily}{LineWidth}[0.05em]{%
\def\KVTriSymLineWidth{#1}}%

\define@key{TriSymFamily}{Scale}[0.01\baselineskip]{%
\def\KVTriSymScale{#1}}%


\presetkeys{TriSymFamily}{Scale=0.01\baselineskip,%    Please change at will
                           LineWidth=0.05em}{}%


\makeatother

\newcommand{\upperrighttriangle}[1][]{%
\setkeys{TriSymFamily}{#1}%
\begin{tikzpicture}[line width=\KVTriSymLineWidth,scale=\KVTriSymScale]%
%\draw (0,0) -- (1,0) -- (1,-1) -- (0,0); % 
  \draw (0,0) -- (1,0) -- (1,-1) -- cycle; %
\end{tikzpicture}%
}%

\begin{document}
% Now  your symbol in three sizes

\large
\[
{M^{\upperrighttriangle}_{n}  \left({ K} \right)} \]


\LARGE
\[
{M^{\upperrighttriangle}_{n}  \left({ K} \right)} \]

\Huge
\[
{M^{\upperrighttriangle}_{n}  \left({ K} \right)} \]

\normalsize

And now in blue colour
\textcolor{blue}{%
\[
{M^{\upperrighttriangle}_{n}  \left({ K} \right)} \]
} % End of \textcolor



\end{document}

在此处输入图片描述

在此处输入图片描述

我没有将您的矩阵符号等包装在特殊命令中,但如果您在许多位置都需要该符号,那么这样做会很有用。

版本xkeyval不是必需的,它只是简化了命令以适应新的缩放比例和线宽。另一种可能性是使用pgfkeys

编辑我按照 Paul Gessler 在下面的评论中的建议更改了绘图,但在这种情况下,必须稍微减小线宽。

以下是新版本的印象:

在此处输入图片描述

这是“最小”版本

\documentclass{minimal}
\usepackage{tikz}

\newcommand{\upperrighttriangle}{%
\begin{tikzpicture}[line width={0.05em},scale=0.01\baselineskip]
  \draw (0,0) -- (1,0) -- (1,-1) -- cycle;%
\end{tikzpicture}%
}%


\begin{document}
\[
{M^{\upperrighttriangle}_{n}  \left({ K} \right)} \]


\end{document}

答案2

这是包裹里的三角形pict2e

\documentclass{article}
\usepackage{pict2e,amsmath}

\newcommand{\utriangle}{\text{\doutriangle}}

\newcommand{\doutriangle}{%
  \linethickness{.1ex}%
  \setlength{\unitlength}{.8ex}%
  \begin{picture}(1,1)(0,-1)
  \polygon(0,1)(1,0)(1,1)
  \end{picture}%
}

\begin{document}
$M_n^{\utriangle}\quad X_{M_n^{\utriangle}}$

\bigskip

{\Large $M_n^{\utriangle}$}
\end{document}

在此处输入图片描述

答案3

这是 egreg 解决方案的变体,使用 LuaLaTeX、MetaPost 和luamplib包。

TeX 尺寸通过命令传递给 MetaPost \mpdim,直接来自gmp包(顺便说一下,由 egreg 编写 ;-))。这是 MetaPost 绘图如何紧密集成到 LuaLaTeX 程序的一个例子。使用除 LuaTeX 之外的其他引擎,代码可以快速从 改编为luamplibgmp但缺点是需要shell-escape一次性编译的功能。

编辑:我把\raise三角形的尺寸缩小了(.33\trianglesize而不是.66\trianglesize)。对我来说这样看起来更美观。(也许我错了。)

\documentclass{article}
\usepackage{amsmath,luamplib}

\newlength{\trianglesize}
\newlength{\pensize}

\newcommand{\utriangle}{%
   \text{%
      \setlength{\trianglesize}{1ex}% adapt at will
      \setlength{\pensize}{0.1ex}% adapt at will
      \begin{mplibcode}
         verbatimtex \raise .33\trianglesize etex; %box height adjustment
         beginfig(1);
         draw ((0, 1) -- (1, 0) -- (1, 1) -- cycle) scaled \mpdim{\trianglesize} 
            withpen pencircle scaled \mpdim{\pensize}; 
         endfig;
      \end{mplibcode}%
   }%
}

\begin{document}
$M_n^{\utriangle}\quad X_{M_n^{\utriangle}}$

\bigskip
{\Large $M^{\utriangle}_n$}
\end{document}

在此处输入图片描述

相关内容