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.

I have found this symbol defined as:

    \def\ci{\perp\!\!\!\perp}

on the wikipedia page for Conditional Independence. There's this from the Comprehensive LaTex Symbol List page 106:

Donald Arseneau posted the following \mathpalette-based definition of a probabilistic-independence symbol ⊥⊥ to comp.text.tex in June 2000:

    \newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
    \def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}

The \independent macro uses \mathpalette to pass the \independenT helper 
macro both the current math style and the \perp symbol. \independenT 
typesets \perp in the current math style, moves two math units to the 
right, and finally typesets a second—overlapping—copy of \perp, again 
in the current math style. \rlap, which enables text overlap, is described 
later on this page.

Frankly, I like the first version better, even though it doesn't typeset properly on my machine.

Are there any better alternatives?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

The usual place at Comprehensive LaTeX Symbol List has the \upmodels symbol in the mnsymbol package, which looks more like the first symbol used in the Wikipedia article. The horizontal distance between the bars is be a bit smaller than the first version, though. See for yourself:

\documentclass{article}
\usepackage{MnSymbol}

\begin{document}

\def\ci{\perp\!\!\!\perp} % from Wikipedia
\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}} % symbols-a4, p.106
\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}} 

$\upmodels$ % mnsymbol
$\independent$
$\ci$
\end{document}
share|improve this answer
1  
One thing to note is that the definition of \independenT needs a \mathsurround0pt as in \def\independenT#1#2{\mathrel{\rlap{$#1#2\mathsurround0pt$}\mkern2mu{#1#2}}} Alternatively, \m@th will do the trick. Of course, the best way to do this is to just use the mathtools package and use \mathrlap which takes care of this for you. –  TH. Sep 30 '10 at 23:45

In Unicode this is:

⫫ U+2AEB DOUBLE UP TACK

If you have a working unicode-math installation, you can either use the symbol directly, or its alias \Vbar.

share|improve this answer

This answer amplifies on the accepted answer. As many have noted in other answers, using MnSymbol package changes many glyphs, which is usually not wanted. So the approach mentioned in a number of answers is to import just the desired glyphs from MnSymbol. leaving all the others intact.

The "value added" I perform here, since that approach seems to be used frequently, is to introduce three macros

\ImportFromMnSymbol{<family>}
\DeclareMnSymbol{<macro-name>}{<type>}{<family>}{<glyph-slot>}
\MnSymbolGlyphs{<family>}% EXECUTED IN THE PREAMBLE

The \DeclareMnSymbol macro is analogous to the \DeclareMathSymbol macro, except the 3rd argument is merely the MnSymbol family, such as A or B, etc. The Glyph slot can be given in decimal, 'octal, or "hexidecimal.

The \MnSymbolGlyphs macro, executed in the preamble, shows the font table for the desired MnSymbol family as the first thing in the document. This allows one to locate particular glyphs and their slot numbers.

So in this example, once the above macros are defined, the usage would be

\ImportFromMnSymbol{A}
\DeclareMnSymbol{\ConIndep}{\mathrel}{A}{225}

Multiple glyphs can be imported from a single family by repeated invocation of \DeclareMnSymbol. Of course, the \ImportFromMnSymbol macro must be invoked for the family, prior to declaring symbols from that family.

In the MWE below, I include the commented line employing \MnSymbolGlyphs, which can be uncommented/edited to explore the available glyphs of MnSymbol.

\documentclass{article}
\def\MnSymbolGlyphs#1{% IF ONE NEEDS TO LOCATE GLYPHS
  \usepackage{MnSymbol,fonttable}%
  \AtBeginDocument{\fonttable{MnSymbol#110}}%
}
\def\ImportFromMnSymbol#1{%
  \DeclareFontFamily{U} {MnSymbol#1}{}
  \DeclareFontShape{U}{MnSymbol#1}{m}{n}{
   <-6> MnSymbol#15
   <6-7> MnSymbol#16
   <7-8> MnSymbol#17
   <8-9> MnSymbol#18
   <9-10> MnSymbol#19
   <10-12> MnSymbol#110
   <12-> MnSymbol#112}{}
  \DeclareFontShape{U}{MnSymbol#1}{b}{n}{
   <-6> MnSymbol#1-Bold5
   <6-7> MnSymbol#1-Bold6
   <7-8> MnSymbol#1-Bold7
   <8-9> MnSymbol#1-Bold8
   <9-10> MnSymbol#1-Bold9
   <10-12> MnSymbol#1-Bold10
   <12-> MnSymbol#1-Bold12}{}
  \DeclareSymbolFont{MnSy#1} {U} {MnSymbol#1}{m}{n}
}
\newcommand\DeclareMnSymbol[4]{\DeclareMathSymbol{#1}{#2}{MnSy#3}{#4}}
\ImportFromMnSymbol{A}
\DeclareMnSymbol{\ConIndep}{\mathrel}{A}{225}
%\MnSymbolGlyphs{A}
\begin{document}
$A \ConIndep B$
\end{document}

enter image description here

share|improve this answer

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.