4

I want to put \wedge and \vee in a box like in the image.

enter image description here

I have tried \framebox, but didnt work.

2
  • 3
    Try \fbox with \fboxsep=0pt
    – user31729
    Dec 27, 2017 at 13:12
  • nobody has mentioned that these symbols should be available in the stix fonts. Dec 27, 2017 at 15:15

2 Answers 2

4

You 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}

enter image description here

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}

enter image description here

4
  • why isn't the \fboxsep=0pt less susceptible to variations in font dimensions? Dec 27, 2017 at 14:25
  • @barbarabeeton Do you mean the \fboxrule? One can try and set it based on the font size, but it's always a hack.
    – egreg
    Dec 27, 2017 at 14:29
  • going by memory (out of my element for a while), there is a defined gap between the rule and the content of the \fbox. that is what i was aiming at. Dec 27, 2017 at 14:34
  • @barbarabeeton The symbols have different sidebearings at different sizes. I provided a refined version.
    – egreg
    Dec 27, 2017 at 14:49
5

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}
2
  • Yellow background? Duck, duck! ;-) Dec 27, 2017 at 13:28
  • 1
    @PrzemysławScherwentke: It's GroundDuck day ;-)
    – user31729
    Dec 27, 2017 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .