Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

We can use symbols of

$\otimes$ and $\boxtimes$, $\oplus$ and $\boxplus$, $\ominus$ and $\boxminus$ in Latex.

However, do we have $\owedge$ and $\boxwedge$, which combines $\wedge$ in the mid of a $O$ and a box? If yes how, if not, how could we define it?

Thank you so much for the experts here!!! (I received great comments from many of you.)

share|improve this question
1  
The package stmaryrd contains \owedge command which is probably what you need, but I don't know of \boxwedge so far. –  Christian Hupfer Apr 21 at 4:16
    
Indeed, I found the \owedge I wish: homes.esat.kuleuven.be/~texmf/installed/texmf-var/doc/latex/…. Thanks so much. –  Idear Apr 21 at 4:50

1 Answer 1

up vote 3 down vote accepted

The following example defines \boxwedge and \owedge using TikZ:

  • The symbols adapt in size and line width according to the current math style.
  • They are defined as binary operators like \boxplus and \oplus.
  • The height, width/side bearings are derived from \boxplus and \oplus.
\documentclass{article}

\usepackage{amsmath,amssymb}
\usepackage{tikz}

\makeatletter
\newcommand*{\boxwedge}{%
  \mathbin{%
    \mathpalette\@boxwedge{}%
  }%
}
\newcommand*{\@boxwedge}[2]{%
  % #1: math style
  % #2: unused
  \sbox0{$#1\boxplus\m@th$}%
  \dimen2=.5\dimexpr\wd0-\ht0-\dp0\relax % side bearing
  \dimen@=\dimexpr\ht0+\dp0\relax
  \def\lw{.06}% linw width as factor for height of \boxplus
  \kern\dimen2 % side bearing
  \tikz[
    line width=\lw\dimen@,
    line join=round,
    x=\dimen@,
    y=\dimen@,
  ]
  \draw
    (\lw/2,0) rectangle (1-\lw,1-\lw)
    (\lw,0) -- (.5,1-\lw-\lw/2) -- (1-\lw-\lw/2 ,0)
  ;%
  \kern\dimen2 % side bearing
}
\makeatletter

\makeatletter
\newcommand*{\owedge}{%
  \mathbin{%
    \mathpalette\@owedge{}%
  }%
}
\newcommand*{\@owedge}[2]{%
  % #1: math style
  % #2: unused
  \sbox0{$#1\oplus\m@th$}%
  \dimen2=.5\dimexpr\wd0-\ht0-\dp0\relax % side bearing
  \dimen@=\dimexpr\ht0+\dp0\relax
  \def\lw{.04}% line width as factor for height of \oplus
  \def\radius{.5-\lw/2}%
  \kern\dimen2 % side bearing
  \tikz[
    line width=\lw\dimen@,
    line join=round,
    x=\dimen@,
    y=\dimen@,
    baseline=\dimexpr-.5\dimen@+\dp0\relax,
  ]
  \draw
    (0,0) circle[radius=\radius]
    % -36.87 = -90 + 2 atan(1/2)
    % 216.87 = 180 + 36.87
    (225:\radius) -- (0,.5-\lw) -- (-45:\radius)
  ;%
  \kern\dimen2 % side bearing  
}
\makeatother

\begin{document}
\[
  \boxplus\boxwedge_{\boxplus\boxwedge_{\boxplus\boxwedge}}
\]
\[
  \oplus\owedge_{\oplus\owedge_{\oplus\owedge}}
\]
% Check bounding box
\[
  \setlength{\fboxsep}{0pt}
  \setlength{\fboxrule}{.1pt}
  \fbox{$\boxplus$}\fbox{$\boxwedge$}
  \fbox{$\owedge$}
  \fbox{$\oplus$}
\]
\end{document}

Result

share|improve this answer
    
This is amazing. It looks really nice!!! +1. (Yours will be the answer if nothing comes out better.) –  Idear Apr 21 at 7:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.