0

Originally, I intended to use the command $\not\mathcal{R}$ as the negation of a binary relation, but there is a problem with that concatenation of commands. So I did what anyone would do in a situation like this, which is create my own symbol.Searching for information on this page, I came across the following code:

\newcommand{\TCNegacion}[1]{%
    \mathrel{\fbox{\ooalign{$#1$\cr\hidewidth\raisebox{0.5ex}{\rotatebox[origin]{80}{\rule{0.5cm}{0.5pt}}}\hidewidth\cr}}}
}

This code solves the initial problem, but it generates another one, namely the concatenation of commands $y\TCNegation{\mathcal{T}} g$ is not to my liking. I'd like to rotate it a bit more to better visualize the negation, but I lose the alignment of the characters involved.

Is there a better way to fix the initial problem?

Is it possible to improve the code?

2
  • use the slanted \not character rather than a rule? Jul 31, 2023 at 19:40
  • From a design point of view, I would use the bar notation like in probability.
    – projetmbc
    Dec 29, 2023 at 9:52

1 Answer 1

2

You could tweak this some more but I'd use the slanted \not not a rule, with optional per-character offset

enter image description here

\documentclass{article}

\def\mfudge{4mu}
\def\fooA{\def\mfudge{7mu}}
\def\fooI{\def\mfudge{1mu}}
\def\fooM{\def\mfudge{8mu}}


\newcommand\foo[1]{\mathrel{%
  \csname foo#1\endcsname
  \mkern\mfudge
  \not{\mkern-\mfudge\mathcal{#1}}}}


\begin{document}


$\foo{A}$
 
$\foo{I}$
 
$\foo{M}$
 
$\foo{R}$
 
$\foo{Z}$
 

\end{document}

Two packages offering similar functionality are slashed and centernot.

8
  • 1
    Since almost no \mathcal capitals have a descender ("Q" is the only exception), I'd be inclined to raise the \not just a bit, to appear more symmetrical. The horizontal placement looks good as you have it, but would have to be adjusted a bit to the left if the overlay is shifted up. Jul 31, 2023 at 20:17
  • @barbarabeeton I did wonder about that Jul 31, 2023 at 20:18
  • Good thing that this and more is already available as a package ctan.org/pkg/slashed :-) Jul 31, 2023 at 22:07
  • 1
    @WillieWong Oh wow! Brilliant package, who wrote that! Jul 31, 2023 at 22:13
  • Too bad it lacks documentation. Aug 1, 2023 at 1:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .