5

I have previously used some code from here to produce a symbol to represent the conditionally independence of some variables. Does anyone know a method for generating a symbol for not conditionally independent. That is, the symbol below but with a forward slash through the symbol netween a and c. Thank you.

some code

\documentclass{article}

\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}

% function for conditional independence - from link above    
\newcommand{\bigCI}{\mathrel{\text{\scalebox{1.07}{$\perp\mkern-10mu\perp$}}}}

a $\bigCI$ c $\mid$ b

\end{document}

which produces

enter image description here

user20650
  • 339
  • Use the cancel package? – cfr Dec 18 '14 at 23:30
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. *Please correct your code so that it compiles.* – cfr Dec 18 '14 at 23:31
  • You should use the code that utilizes \mathpalette, which allows you to just use \not\independent without problem. – Werner Dec 18 '14 at 23:35
  • @Werner No, \not works only for symbols as wide as =. – egreg Dec 18 '14 at 23:38
  • @cfr - thanks for the recommendation, updated. Werner, thank youalso, i shall look at this as well. – user20650 Dec 18 '14 at 23:38
  • @egreg: I did consider \centernot. Using \not seemed better in the output when compared to \centernot. The stroke cut the vertical \perps higher, which seemed better (in my opinion). – Werner Dec 18 '14 at 23:40

3 Answers3

9

I'm not sure about the advantage of scaling the symbol by 7%. I propose the definitions for both the scaled and unscaled symbol.

\documentclass{article}
\usepackage{amsmath,graphicx,centernot}

% function for conditional independence - from link above
\newcommand{\bigCI}{\mathrel{\text{\scalebox{1.07}{$\perp\mkern-10mu\perp$}}}}
\newcommand{\nbigCI}{\centernot{\bigCI}}

\newcommand{\CI}{\mathrel{\perp\mspace{-10mu}\perp}}
\newcommand{\nCI}{\centernot{\CI}}

\begin{document}

$a \bigCI c \mid b$ and $a \nbigCI c \mid b$

$a \CI c \mid b$ and $a \nCI c \mid b$

\end{document}

enter image description here

egreg
  • 1,121,712
5

Rather than use built up symbols you can use a font with ⫫ (U+2aeb) such as stix

You can just use \not for the negation.

enter image description here

\documentclass{article}

\usepackage{stix}

\begin{document}

$a \Vbar b \mid c $


$a \not\Vbar b \mid c $

\end{document}
David Carlisle
  • 757,742
3

Say:

\documentclass{article}
\usepackage{mathtools,cancel}
\begin{document}

% function for conditional independence - from link above
\newcommand{\bigCI}{\mathrel{\text{\scalebox{1.07}{$\perp\mkern-10mu\perp$}}}}
\newcommand{\nbigCI}{\cancel{\mathrel{\text{\scalebox{1.07}{$\perp\mkern-10mu\perp$}}}}}
a $\bigCI$ c $\mid$ b

a $\nbigCI$ c $\cancel{\mid}$ b

\end{document}

cancelled relations

cfr
  • 198,882
  • 1
    For negating \mid, amssymb provides \nmid. – egreg Dec 18 '14 at 23:41
  • @egreg I only did that to show that you could use \cancel directly. But I don't think this is a good way of doing it anyway. – cfr Dec 18 '14 at 23:43