# Unable to make symbol similar to bowtie or lrtimes

I wish to write something like this in latex:

I tried using \lrtimes and also \bowtie, but none is able to give me the correct output. Also, i had problems getting that {task1} below the symbol. For this, i tried using $\bowtie_\{task_1\}$, but it didnt give me the required output. Any help would be appreciated.

-
The problem is that the two triangles should surmount each other? –  egreg Dec 1 '12 at 16:26
May be this works \underset{\{task 1\}}{\vartriangleright\hspace{-1.7mm}\vartriangleleft} –  Manuel Dec 1 '12 at 16:30
Yes, the lrtimes should do that job. But it is not doing the way it is described in specifications. –  Shafi Dec 1 '12 at 16:30
@Manuel: That worked like a charm! Thanks a lot! –  Shafi Dec 1 '12 at 16:33
Read the answer of @percusse, it's much better. –  Manuel Dec 1 '12 at 16:33

Here is a possibility:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand{\newbowtie}{\mathrel{\ooalign{$\triangleright$\,\cr\,$\triangleleft$}}}
\begin{document}
$(\text{Resource}_0 \mathbin{||} \text{Resource}_0) \underset{\{\text{task 1}\}}{\bowtie} (\text{Processor}_0 \mathbin{||} \text{Processor}_0)$

$(\text{Resource}_0 \mathbin{||} \text{Resource}_0) \underset{\{\text{task 1}\}}{\newbowtie} (\text{Processor}_0 \mathbin{||} \text{Processor}_0)$
\end{document}


The above symbol creation uses \ooalign which overlays elements on top of one another. For a quick course in \ooalign, see \subseteq + \circ as a single symbol (“open subset”).

-
\ooalign here? A sledgehammer indeed. :) –  egreg Dec 1 '12 at 16:38
What do \ooalign and \cr do? –  Brandon Kuczenski Dec 1 '12 at 20:11
@BrandonKuczenski: I've added a reference which gives a quick lesson on \ooalign. –  Werner Dec 1 '12 at 21:54

You could try defining a new command

\documentclass{article}
\usepackage{amsmath,amssymb}
\newcommand{\mytie}{\mathrel{\rhd\mspace{-10mu}\lhd}}
\begin{document}

$A \mytie B$

$A \underset{\text{task}}{\mytie} B$

\end{document}


I've changed the definition from what I first posted because when I tried stacking the relation, the arrows didn't match up as desired.

-
The \mbox serves no purpose: just {\rhd\mspace{-10mu}\lhd} (notice the additional braces) will do. But also \mathrel would be good: \newcommand{\mytie}{\mathrel{\rhd\mspace{-10mu}\lhd}} (the argument of \mathrel makes a subformula, so the additional braces are not needed any more). –  egreg Dec 1 '12 at 16:43
@egreg. (For a solution that omits the \mathrel) Why does that work? I tried your suggestion. If I don't use the parentheses the mspace doesn't work as desired. With the parentheses it does. What's happening there? –  A.Ellett Dec 1 '12 at 16:48
@A.Ellett -- not egreg, but ... \mspace is defined (in amsmath) to take an argument, hence requiring the braces. the tex primitive on which it relies is \mskip, which would need no braces. –  barbara beeton Dec 1 '12 at 16:56
@barbarabeeton I understand why it's \mspace{-10mu}. But what I don't understand is why {\rhd\mspace{-10mu}\lhd} and \rhd\mspace{-10mu}\lhd behave differently. Maybe that's what you were trying to explain to me. But I'm still not getting something. –  A.Ellett Dec 1 '12 at 16:59
@A.Ellett Without the braces, the nature of \rhd as binary operation shows up: in $a \rhd\mspace{-10mu}\lhd b$ you have the same situation as in $a++b$ (the kerning doesn't influence the automatic spacings), which gives an undesired result. With the braces, you are making a subformula consisting of two binary operations, which become ordinary atoms by rule. –  egreg Dec 1 '12 at 17:02

You can further scale up/down for your taste. But please consider making words not to be typeset with mathstyle. It's unnecessary difficulty for the reader.

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

\newcommand{\mytie}[1]{
\mathop{\vartriangleright\!\!\!\vartriangleleft}\limits_{#1}
}
\begin{document}
$(\text{Resource}_0 \| \text{Resource}_0) \mytie{\{\text{\emph{task }}1\} }(\text{Processor}_0 \| \text{Processor}_0 )$
\end{document}


-
I'd put the \mathop (necessary for the subscript) inside a \mathrel. Instead of \!\!\! why not a single \mkern-9mu? –  egreg Dec 1 '12 at 16:40
@egreg Because I forgot that again (and again....) :) For the kerning issue, I was just suggestive since it needs scaling up first in my opinion. –  percusse Dec 1 '12 at 16:56
And the \mathop isn't really necessary, for \underset is probably more practical, unless all instances of \mytie need to be subscripted. –  egreg Dec 1 '12 at 16:59