How can I make this equation look more aesthetic and balanced?

I have a mathematical equation

$$K = \sum_{i \in \mathcal{V}} \left\lvert i^p - \mathbbm{1}_{\{i \in \mathcal{J}\}} \cdot k^p \right\rvert$$

that when compiled, looks like: Is there a way I could lengthen the absolute value verticals and to somehow not make the p power exponentials crunch the i and the k, as well as a better indicator function. Any suggestions what I could do will be greatly appreciated. Thanks!

• please always provide MWE, not just code fragment
• use  for switch to math mode is not LaTeX command, instead it use $...$ or \begin{equation*} ... \end{equation*}
• for absolute value is sensible to define new delimiters as enable mathtools package (see MWE below)
\documentclass[border=3.141592, varwidth]{standalone}
\usepackage{bbm, mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}

\begin{document}
$K = \sum_{i \in \mathcal{V}} \abs*{i^p - \mathbbm{1}_{i \in \mathcal{J}}^{}{\cdot}k^p}$
\end{document} • \lvert and \rvert are versions of | that receive opening and closing delimiter spacing. Mathtools isn’t necessary for this. Jul 31 '21 at 22:39
• @DonHosek, are you sure? Well, it is needed for \DeclarePairedDelimiter macro. Jul 31 '21 at 23:03
• It’s from amsmath. Amsldoc.PDF provides a suggested definition for \abs using it. Although with \left And \right even | will give the correct spacing. Jul 31 '21 at 23:14
• @DonHosek -- I haven't actually tested it, but I think that just | may not give optimal spacing. (It wouldn't if anything followed the right-hand vert.) Using \lvert ... \rvert is much better semantically. And although it's not really needed here, \DeclarePairedDelimiter does make things easier when sizing is required. Aug 1 '21 at 0:22
• I'll have to try, but I believe that \left|\right| works on a similar mechanism to \left<\right>. I'll have to check later. Aug 1 '21 at 0:42