I want to put \wedge and \vee in a box like in the image.
I have tried \framebox, but didnt work.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityYou can box the symbols \vee
and \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}
Depending on the math font you may need to adjust the 1.25mu length.
A refined version with different rule thickness and some more adjustments.
\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}
\fboxsep=0pt
less susceptible to variations in font dimensions?
Dec 27, 2017 at 14:25
\fboxrule
? One can try and set it based on the font size, but it's always a hack.
\fbox
. that is what i was aiming at.
Dec 27, 2017 at 14:34
A 'dirty' version with TikZ and yellow background ;-)
\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}
\fbox
with\fboxsep=0pt