What you describe seems similar to the nonmonotonic inference relation symbol used in this paper. The main difference being that this a small space between the two characters, which I think actually looks better than having them touch.
\documentclass{article}
\newcommand*{\nc}[2]{#1\mathbin{\left| \sim \vphantom{#1#2} \right.}#2}%
\begin{document}
$\nc{A}{B} \qquad \nc{\frac{A}{C}}{B}$
\end{document}
Update: Here is a version where both the straight and wavy line are re-sized and the two symbols touch:
I have used \scalebox
from the \graphicx
package to resize the symbols (resize horizontally for the wavy line and vertically for the vertical bar) based on the height of the operands on either side. The \mathrlap
is obtained from a TUGboat 22 article entitled a complement to \smash, \llap, and \rlap. I am not an expert in the use of the rlap
type command, so perhaps some of the resize code could be simplified. I also used pgf
to do the math, and this is probably overkill but I am more familiar with that then doing math in plain TeX.
\documentclass[border=2pt]{standalone}
\usepackage{amsmath}% only needed for \dfrac
\usepackage{graphicx}% needed for \scalebox
\usepackage{pgf}% needed for the math calculations
% http://math.arizona.edu/~aprl/publications/mathclap/
\def\mathrlap{\mathpalette\mathrlapinternal}%
\def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}}%
\makeatletter
\newdimen\@mydimen%
\newdimen\@myHeightOfBar%
\settoheight{\@myHeightOfBar}{$|$}%
\newcommand{\SetScaleFactor}[1]{%
\settoheight{\@mydimen}{#1}%
\pgfmathsetmacro{\scaleFactor}{\@mydimen/\@myHeightOfBar}%
}%
\newcommand*{\Scale}[2][3]{\scalebox{#1}{\ensuremath{#2}}}%
\newcommand*{\nct}[2]{%
\SetScaleFactor{\vphantom{\ensuremath{#1#2}}}% Compute scale to be applied
#1%
\mathrel{\Scale[\scaleFactor]{|\mathrlap{\kern-0.48ex\sim}\hphantom{\kern-0.41ex\sim}}}%
#2%
}%
\begin{document}
$\nct{a}{b} \qquad \nct{\frac{A}{C}}{B} \qquad \nct{\dfrac{A}{C}}{B}$
\end{document}
An enhanced version of this solution that allows you to specify a character to be placed above and below the wavy line is available at the follow-up question: Symbol for skeptical consequence that matches the turnstile package
Given that you don't like the existing shapes in the available fonts, my other suggestion would be to use tikz
to draw the symbol; you can then adjust all parameters and coordinates as you wish.
\documentclass{article}
\usepackage{amssymb,tikz}
\newcommand{\mysetminusD}{\hbox{\tikz{\draw[line width=0.6pt,line cap=round] (3pt,0) -- (0,6pt);}}}
\newcommand{\mysetminusT}{\mysetminusD}
\newcommand{\mysetminusS}{\hbox{\tikz{\draw[line width=0.45pt,line cap=round] (2pt,0) -- (0,4pt);}}}
\newcommand{\mysetminusSS}{\hbox{\tikz{\draw[line width=0.4pt,line cap=round] (1.5pt,0) -- (0,3pt);}}}
\newcommand{\mysetminus}{\mathbin{\mathchoice{\mysetminusD}{\mysetminusT}{\mysetminusS}{\mysetminusSS}}}
\begin{document}
\thispagestyle{empty}
\verb+\setminus,\mysetminus,\smallsetminus+:
\begin{displaymath}
A\setminus B \qquad A \mysetminus B \qquad
A\smallsetminus B
\end{displaymath}
\verb+\mysetminus+ in display, script and scriptscript styles
\begin{displaymath}
A\mysetminus B\quad \scriptstyle A\mysetminus B \quad
\scriptscriptstyle A\mysetminus B
\end{displaymath}
\end{document}
The code provides separate commands for displaystyle, textstyle, scriptstyle and scriptscriptstyle and uses \mathchoice
to select the correct one. I have put the textstyle version equal to the displaystyle one. In the \tikz
command you can now specify exactly which line to use and what width it should have. I have made the ends of the lines round, instead of square, with the line cap
option. Finally, if neccessary you can specify a different bounding box for these characters by addingg the tikz construction
\useasboundingbox (-0.5pt,-0.5pt) rectangle (5pt,8pt);
with appropriate choices of coordinates. (This will avoid the \vcenter
type juggling you have in your code.)
Addition If you are worried about the overhead of using a tikz command each time, which I don't think is high in this case, then you can instead of using newcommands use boxes as follows with \newsavebox
, \sbox
and \usebox
:
\newsavebox{\mysetminusD}
\sbox{\mysetminusD}{\hbox{\tikz{\draw[line width=0.6pt,line cap=round]
(3pt,0) -- (0,6pt);}}}
\newsavebox{\mysetminusT}
\sbox{\mysetminusT}{\mysetminusD}
\newsavebox{\mysetminusS}
\sbox{\mysetminusS}{\hbox{\tikz{\draw[line width=0.45pt,line
cap=round] (2pt,0) -- (0,4pt);}}}
\newsavebox{\mysetminusSS}
\sbox{\mysetminusSS}{\hbox{\tikz{\draw[line width=0.4pt,line cap=round] (1.5pt,0) -- (0,3pt);}}}
\newcommand{\mysetminus}{\mathbin{\mathchoice{\usebox{\mysetminusD}}{\usebox{\mysetminusT}}{\usebox{\mysetminusS}}{\usebox{\mysetminusSS}}}}
Best Answer
Like this?