TransWikia.com

Unwanted Space Between Vertical Bar and Math Operator

TeX - LaTeX Asked by user238832 on June 16, 2021

In my preamble, I have defined a math operator by writing DeclareMathOperator{Av}{Av}. When I use the command $Av$, there is a small amount of horizontal space on each side of the operator. Usually, this spacing looks good, but not when I put it inside absolute value symbols. For example, if I write $|Av(n)|$, then there is a little vertical space between the first vertical bar and the A. Is there a way to define my operator in my preamble so that this spacing does not appear?

One Answer

The comments already gave you a couple of good solutions, lvert Av(n) rvert and defining an abs command using DeclarePairedDelimiter from mathtools.

The reason you’re having this problem is the spacing between atoms of different math classes. A command you define with declaremathoperator has the same mathop spacing as log or sin, so if you try to bracket it with two mathord atoms, you’ll get spacing like 2 log x. You instead want your delimiters to have mathopen and mathclose spacing, like ( and ) or [ and ], and lvert and rvert do.

Answered by Davislor on June 16, 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