TransWikia.com

Custom sqcap operators

TeX - LaTeX Asked by FR09 on April 10, 2021

I want to ask for something similar to Horizontal lines in sqcup and sqcap

But instead of the alignment asked in that question, I want the horizontal line to align vertically to a minus sign and the new symbol’s spacing equal to a regular sqcap‘s spacing, like this

enter image description here.

And if possible, I would also like to ask for a big version of this operator whose dimensions are the same as the dimensions of bigsqcup.

2 Answers

You can overlap the sqcap and minus with ooalign. The mismatch in width can be cured by shrinking the minus sign only in the horizontal direction. For the “big” version, the same idea is used, but the minus sign is also stretched vertically to match the thickness (it maybe requires a different factor in scriptstyle, though).

documentclass{article}
usepackage{amsmath,stmaryrd,graphicx}

makeatletter
newcommand{semisqcap}{mathbin{mathpalettesemisqcap@relax}}
newcommand{semisqcap@}[2]{%
  begingroupm@th
  sboxz@{$#1sqcap$}%
  ooalign{hidewidthresizebox{wdz@}{height}{$#1-$}hidewidthcr$#1sqcap$cr}%
  endgroup
}

newcommand{bigsemisqcap}{DOTSBmathop{mathpalettebigsemisqcap@relax}slimits@}
newcommand{bigsemisqcap@}[2]{%
  begingroupm@th
  sboxz@{$#1bigsqcap$}%
  ooalign{hidewidthsemisqbar@{#1}hidewidthcr$#1bigsqcap$cr}%
  vphantom{boxz@}%
  endgroup
}
newcommand{semisqbar@}[1]{%
  raisebox{-0.25height}{resizebox{wdz@}{2height}{$#1-$}}%
}
makeatother

begin{document}

begin{gather*}
asemisqcap b
quadscriptstyle asemisqcap b

asqcap b
quadscriptstyle asqcap b

bigsemisqcap_{i=1}^n a_i bigsqcap_{i=1}^n a_i

bigsemisqcap_{i=1}^n a_i bigsqcap_{i=1}^n a_i

textstylebigsemisqcap_{i=1}^n a_i bigsqcap_{i=1}^n a_i

scriptstylebigsemisqcap_{i=1}^n a_i bigsqcap_{i=1}^n a_i
end{gather*}

end{document}

enter image description here

Correct answer by egreg on April 10, 2021

You can literally take the answer you link to, and change a few values.

documentclass{article}
usepackage{amsmath}
usepackage{scalerel}
defwiden{mathrel{ThisStyle{stretchrel*{ooalign{%
  raise0.45LMexhbox{$SavedStylesqcup$}cr%
  raise-0.45LMexhbox{$SavedStylesqcup$}}}{sqcup}}}}
defnarrow{mathrel{ThisStyle{stretchrel*{ooalign{%
  raise0.75LMexhbox{$SavedStylesqcap$}cr%
  raise-0.75LMexhbox{$SavedStylesqcap$}}}{sqcap}}}}
defWiden{mathrel{ThisStyle{stretchrel*{ooalign{%
  raise0.6LMexhbox{$SavedStylesqcup$}cr%
  raise-0.6LMexhbox{$SavedStylesqcup$}}}{bigsqcup}}}}

begin{document}
$a -widen b quadscriptstyle a -widen b quadscriptscriptstyle a -widen b$ 

$a -narrow b quadscriptstyle a -narrow b quadscriptscriptstyle a -narrow b$

$a -Widen b quadscriptstyle a -Widen b quadscriptscriptstyle a -Widen b$ 

end{document}

enter image description here

Answered by user232027 on April 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP