0

I try to write absolute value symbols and norm symbols in section. The command \norm* and \abs* in package physics works not well. So I use the solution in Absolute Value Symbols. But when I put this command in section:

\documentclass{article}
\usepackage{mathtools}

\DeclarePairedDelimiter\abs{\lvert}{\rvert}% \DeclarePairedDelimiter\norm{\lVert}{\rVert}% \makeatletter \let\oldabs\abs \def\abs{@ifstar{\oldabs}{\oldabs}} % \let\oldnorm\norm \def\norm{@ifstar{\oldnorm}{\oldnorm}} \makeatother

\begin{document} \section{$\norm{T}$} \end{document}

it report error:

Argument of \@sect has an extra }.
<inserted text>

Paragraph ended before @sect was complete. <to be read again>

If there any method to modify the solution in Absolute Value Symbols such that I can use command \norm, \abs in section title?

  • Welcome to TeX.SE! Please show us a short compilable TeX code resulting in your issue. – Mensch Sep 09 '22 at 08:58
  • Remove the code from \makeatletter to \makeatother. You don't want to type $\norm{T}+\norm{\hat{T}}$ and get this output (click) – egreg Sep 09 '22 at 09:09
  • @egreg I need large norm and abs in my main body. So I want to preserve these code. – sakurajyan Sep 09 '22 at 13:45
  • @sakurajyan Just use \abs* or \norm* when you need automatic sizing, but bear in mind that such method may produce humongous delimiters like in the example I showed. – egreg Sep 09 '22 at 13:50
  • If there are some methods to reverse the command \abs and \abs*? I use physics package before, so I write a lot of Tex codes using \abs for automatic sizing. – sakurajyan Sep 10 '22 at 02:11

0 Answers0