![如何将楔形物和 V 形物放入盒子内?](https://linux22.com/image/367766/%E5%A6%82%E4%BD%95%E5%B0%86%E6%A5%94%E5%BD%A2%E7%89%A9%E5%92%8C%20V%20%E5%BD%A2%E7%89%A9%E6%94%BE%E5%85%A5%E7%9B%92%E5%AD%90%E5%86%85%EF%BC%9F.png)
答案1
您可以将符号\vee
和框起来\wedge
。
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\boxedsymbol}[2]{%
\begingroup
\setlength{\fboxsep}{0pt}%
\fbox{%
$\m@th#1\mspace{-1.25mu}#2\mspace{-1.25mu}$%
}%
\endgroup
}
\makeatother
\newcommand{\boxvee}{\mathbin{\mathpalette\boxedsymbol\vee}}
\newcommand{\boxwedge}{\mathbin{\mathpalette\boxedsymbol\wedge}}
\begin{document}
$\varepsilon_{A}(\mathbf{x})=A^{t}\boxwedge\mathbf{x}$
$\delta_{A}(\mathbf{x})=A^{t}\boxvee\mathbf{x}$
$
{\boxvee}\ {\boxwedge}\
\scriptstyle
{\boxvee}\ {\boxwedge}\
\scriptscriptstyle
{\boxvee}\ {\boxwedge}
$
\end{document}
根据数学字体,您可能需要调整 1.25mu 的长度。
精致版本,具有不同的规则厚度和一些其他调整。
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\boxedsymbol}[2]{%
\begingroup
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{\variable@rule{#1}}%
\fbox{%
$\m@th#1\variable@space{#1}#2\variable@space{#1}$%
}%
\endgroup
}
\newcommand{\variable@rule}[1]{%
\fontdimen8
\ifx#1\displaystyle\textfont3\else
\ifx#1\textstyle\textfont3\else
\ifx#1\scriptstyle\scriptfont3\else
\scriptscriptfont3\relax
\fi\fi\fi
}
\newcommand{\variable@space}[1]{%
\mspace{-
\ifx#1\displaystyle 1.25\else
\ifx#1\textstyle 1.25\else
\ifx#1\scriptstyle 1.4\else
1.6%
\fi\fi\fi
mu}%
}
\makeatother
\newcommand{\boxvee}{\mathbin{\mathpalette\boxedsymbol\vee}}
\newcommand{\boxwedge}{\mathbin{\mathpalette\boxedsymbol\wedge}}
\begin{document}
$\varepsilon_{A}(\mathbf{x})=A^{t}\boxwedge\mathbf{x}$
$\delta_{A}(\mathbf{x})=A^{t}\boxvee\mathbf{x}$
$
{\boxvee}\ {\boxwedge}\
\scriptstyle
{\boxvee}\ {\boxwedge}\
\scriptscriptstyle
{\boxvee}\ {\boxwedge}
$
{\large$\boxvee\ \scriptstyle\boxvee$}
{\footnotesize$\boxvee\ \scriptstyle\boxvee$}
\end{document}
答案2
带有 TikZ 和黄色背景的“脏”版本 ;-)
\documentclass{article}
\usepackage{mathtools}
\usepackage{tikz}
\newcommand{\tightbox}[1]{%
\tikz{\node[rectangle,fill=yellow,draw,inner sep=0.25pt,line width=0.25pt] (A) {$#1$};}%
}
\begin{document}
$\vee$ \tightbox{\vee} \tightbox{\wedge}
\end{document}