4

This is what I want:

enter image description here

I know how to make a longer \mid, but I don’t know how to put a bar on it. Here’s my code of a longer \mid:


\documentclass{article}
\usepackage{amsmath}
\usepackage[frak=pxtx]{mathalfa}
\makeatletter
\def\localbig#1#2{%  
  \sbox\z@{$\m@th#1
    \sbox\tw@{$#1()$}%
    \dimen@=\ht\tw@\advance\dimen@\dp\tw@    
    \nulldelimiterspace\z@\left#2\vcenter to1.2\dimen@{}\right.  
  $}\box\z@}

\newcommand{\divides}{\mathrel{\mathpalette\dividesaux\relax}}
\newcommand{\ndivides}{\mathrel{\mathpalette\ndividesaux\relax}}

\newcommand{\dividesaux}[2]{\mbox{$\m@th#1\localbig{#1}|$}}
\newcommand{\ndividesaux}[2]{%  
\mkern.5mu
\ooalign{%    
  \hidewidth$\m@th#1\localbig{#1}|$\hidewidth\cr
  $\m@th#1\nmid$\cr%  }%}
\begin{document}
$p^{n_i}\divides|\mathfrak{G}_{i+1}/\mathfrak{G}_i|$
\end{document}
2
  • Could you provide a minimal working example?
    – Ivan
    Commented Feb 20, 2021 at 15:12
  • I added the negated symbol to my answer.
    – egreg
    Commented Feb 20, 2021 at 16:51

1 Answer 1

4

This superimposes \top to \mid; the former is a raised and the latter lowered.

It changes size in subscripts/superscripts.

UPDATE The negated relation has been added

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

\makeatletter
\newcommand{\topmid}{\mathrel{\mathpalette\topmid@\relax}}
\newcommand{\ntopmid}{\mathrel{\mathpalette\topmid@\nmid}}
\newcommand{\topmid@}[2]{%
  \begingroup
  \sbox\z@{$\m@th#1\mspace{1.5mu}\nonscript\mspace{1.5mu}$}%
  \ooalign{%
    \hfil\raisebox{\wd\z@}{$\m@th#1\top$}\hfil\cr
    \ifx#2\relax\else\hfil$\m@th#1#2$\hfil\cr\fi
    \hfil\raisebox{-0.3\wd\z@}{$\m@th#1|$}\hfil\cr
  }%
  \endgroup
}
\makeatother

\begin{document}

$p^{n_i}\topmid |\mathfrak{G}_{i+1}/\mathfrak{G}_{i}|$

$\scriptstyle a\topmid b\mid c$

$p^{n_i}\ntopmid |\mathfrak{G}_{i+1}/\mathfrak{G}_{i}|$

$\scriptstyle a\ntopmid b\mid c$

\end{document}

enter image description here

You must log in to answer this question.