자동으로 괄호로 묶이지 않고 Overleaf가 불평하지 않도록 수학 표시 모드에서 `\tag`를 작성하세요.

자동으로 괄호로 묶이지 않고 Overleaf가 불평하지 않도록 수학 표시 모드에서 `\tag`를 작성하세요.

\tag자동으로 괄호로 묶이지 않고 Overleaf가 불평하지 않도록 수학 표시 모드에서 를 어떻게 작성할 수 있습니까 ? (Overleaf의 불만을 무시하는 것은 나쁜 습관이라고 생각합니다.)

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

\begin{document}

The following would be perfect if the automatic parentheses enclosing the tag were removed:

\[J(2^m + l) = 2l + 1 \tag{for $m \geqq 0$ and $0 \leqq l < 2^m$}\]

The following output is good

\[J(2^m + l) = 2l + 1 \tag*{for $m \geqq 0$ and $0 \leqq l < 2^m$}\]

yet Overleaf complains about it; in particular, it introduces a red warning dot in the margin of the Code Editor, whose drop-down text reads:

\begin{verbatim}
unclosed open display math \[ found at $
unclosed open group { found at $
unexpected $ after open group {
unexpected $ after open display math \[
unexpected $ after open display math \[
unexpected $ after open display math \[
unexpected $ after open display math \[
\end{verbatim}

\end{document}

답변1

Overleaf가 완벽하게 합법적인 LaTeX 구성을 거부하는 것은 좋지 않습니다. 반면, 조건은 방정식의 일부이지만 태그는 그렇지 않기 때문에 그러한 경우에 태그를 남용해서는 안 됩니다.

어쨌든 \ttag다음을 사용하여 Overleaf를 조용하게 유지할 수 있습니다.

\newcommand{\ttag}{\tag*}

표시하기 전에 빈 줄을 피하십시오. 이는 잘못된 것입니다. 다음 텍스트가 새 단락을 시작하는 경우 빈 줄이 표시 뒤에 올 수 있습니다.

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

\newcommand{\ttag}{\tag*}

\begin{document}

The following would be perfect if the automatic parentheses enclosing the tag were removed:
\[
J(2^m + l) = 2l + 1 
\tag{for $m \geqq 0$ and $0 \leqq l < 2^m$}
\]
The following output is good
\[
J(2^m + l) = 2l + 1 
\ttag{for $m \geqq 0$ and $0 \leqq l < 2^m$}
\]
But this output is much better
\[
J(2^m + l) = 2l + 1, 
\qquad\text{for $m \geqq 0$ and $0 \leqq l < 2^m$}
\]
as you can clearly see, because the conditions are part of the equation.

\end{document}

여기에 이미지 설명을 입력하세요

Overleaf 창에는 빨간색 점이 표시되지 않습니다.

여기에 이미지 설명을 입력하세요

관련 정보