如何在 `\begin{prop}[\cdots]` 内使用 `\sqrt[n]{a}`?

如何在 `\begin{prop}[\cdots]` 内使用 `\sqrt[n]{a}`?

我正在写一小段文字,但由于某种原因,它无法编译:

\begin{prop}[Existência de $\sqrt[n]{a}$, $a > 0$, $n \in \mathbb{Z}_{>0}$]
Sejam $a >0$ e $n \in \mathbb{Z}_{>0}$. Existe $b \in \R_{>0}$ tal que $b^n = a$.
\end{prop}

因为\sqrt[n]{a}。我很肯定这就是问题所在,因为当我把它拿掉时,一切都正常编译。我不知道它想让我做什么来解决这个问题。警告是:

\@sqrt 的参数有一个额外的 } \begin{prop}[Existência de $\sqrt[n],

段落在 \@sqrt 完成之前结束 \begin{prop}[Existência de $\sqrt[n]

出了点问题——可能缺少 \item。\end{prop}

缺失 } 插入 \end{prop}

它们毫无意义。如何修复?


如果需要的话,之前的一段代码:

A ideia para verificarmos as desigualdades acima se resumiu a eliminar os termos positivos, e usar que: \[n > 1 \implies n^m > n \implies \frac{1}{n^m} < \frac{1}{n} \implies -\frac{1}{n^m} > -\frac{1}{n},\quad \forall\,m \in \mathbb{Z}_{z>0}.\]

Por fim, agrupando termos pares e ímpares temos: \[ \sum_{i=0}^n {n \choose i}b^{n-i} = b^n + \sum_{i=1}^{n}{n \choose i}b^{n-i} = b^n + \sum_{i=1}^{\lfloor n/2\rfloor} {n \choose 2i}b^{n-2i} + \sum_{i=1}^{\lfloor (n+1)/2 \rfloor} {n \choose 2i-1}b^{n-(2i-1)},  \]onde $\lfloor \cdot \rfloor$ é a \emph{função piso}.

\newpage

\begin{prop}[Existência de $\sqrt[n]{a}$, $a > 0$, $n \in \mathbb{Z}_{>0}$]
Sejam $a >0$ e $n \in \mathbb{Z}_{>0}$. Existe $b \in \R_{>0}$ tal que $b^n = a$.
\end{prop}

我的序言如下:

\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath, amssymb, amsfonts, amsthm}
\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}
\usepackage{multicol}
\usepackage{gfsartemisia-euler}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage{stackrel}
\usepackage{cancel}
\usepackage{caption}
\usepackage{enumerate}
\usepackage{mathrsfs}
\usepackage[bottom=3cm,top=3cm,left=3cm,right=2cm]{geometry}

\headheight 20mm      %
\oddsidemargin 2.0mm  %
\evensidemargin 2.0mm %
\topmargin -40mm      %
\textheight 250mm     %
\textwidth 160mm      %


\newcommand\pair[1]{\langle{#1}\rangle}
\newcommand{\R}{\mathbb{R}}
\newcommand{\V}{\mathcal{V}}
\newcommand{\diag}{\mathrm{diag}}
\renewcommand{\d}{\mathrm{d}}
\DeclareMathOperator{\senh}{senh}
\DeclareMathOperator{\sen}{sen}
\DeclareMathOperator{\tg}{tg}
\DeclareMathOperator{\cotg}{cotg}

\newtheorem{teo}{Teorema}[section]
\newtheorem{cor}{Corolário}[section]
\newtheorem{lem}{Lema}[section]
\newtheorem{prop}{Proposição}
\newtheorem{defn}{Definição}[section]
\newtheorem{Ex}{Exemplo}[section]
\newtheorem{obs}{Observação}
\newtheorem{ex}{Exercício}

\newenvironment{dem}{\smallskip \noindent{\bf Demonstração}: }
{\begin{flushright} $\qedsymbol$\end{flushright}\smallskip}

答案1

可选参数中不能有](因为解析器认为这是可选参数的结束位置),但也有解决方法。在本例中,我将 I放在环境\def\tmp{\sqrt[n]}之前prop,然后\tmp在可选参数中使用 而不是\sqrt[n]

或者,将所有的可选参数\tmp,例如

\def\tmp{Existência de $\sqrt[n]{a}$, $a > 0$, $n \in \mathbb{Z}_{>0}$}
\begin{prop}[\tmp]
Sejam $a >0$ e $n \in \mathbb{Z}_{>0}$. Existe $b \in \R_{>0}$ tal que $b^n = a$.
\end{prop}

这是 MWE。

\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath, amssymb, amsfonts, amsthm}
\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}
\usepackage{multicol}
\usepackage{gfsartemisia-euler}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage{stackrel}
\usepackage{cancel}
\usepackage{caption}
\usepackage{enumerate}
\usepackage{mathrsfs}
\usepackage[bottom=3cm,top=3cm,left=3cm,right=2cm]{geometry}

\headheight 20mm      %
\oddsidemargin 2.0mm  %
\evensidemargin 2.0mm %
\topmargin -40mm      %
\textheight 250mm     %
\textwidth 160mm      %


\newcommand\pair[1]{\langle{#1}\rangle}
\newcommand{\R}{\mathbb{R}}
\newcommand{\V}{\mathcal{V}}
\newcommand{\diag}{\mathrm{diag}}
\renewcommand{\d}{\mathrm{d}}
\DeclareMathOperator{\senh}{senh}
\DeclareMathOperator{\sen}{sen}
\DeclareMathOperator{\tg}{tg}
\DeclareMathOperator{\cotg}{cotg}

\newtheorem{teo}{Teorema}[section]
\newtheorem{cor}{Corolário}[section]
\newtheorem{lem}{Lema}[section]
\newtheorem{prop}{Proposição}
\newtheorem{defn}{Definição}[section]
\newtheorem{Ex}{Exemplo}[section]
\newtheorem{obs}{Observação}
\newtheorem{ex}{Exercício}

\newenvironment{dem}{\smallskip \noindent{\bf Demonstração}: }
{\begin{flushright} $\qedsymbol$\end{flushright}\smallskip}
\begin{document}
\def\tmp{\sqrt[n]}
\begin{prop}[Existência de $\tmp{a}$, $a > 0$, $n \in \mathbb{Z}_{>0}$]
Sejam $a >0$ e $n \in \mathbb{Z}_{>0}$. Existe $b \in \R_{>0}$ tal que $b^n = a$.
\end{prop}
\end{document}

在此处输入图片描述

答案2

只需支撑令人反感的部分:

\begin{prop}[Existência de {$\sqrt[n]{a}$}, $a > 0$, $n \in \mathbb{Z}_{>0}$]
Sejam $a >0$ e $n \in \mathbb{Z}_{>0}$. Existe $b \in \R_{>0}$ tal que $b^n = a$.
\end{prop}

问题在于,]aftern否则将被视为可选参数的结束分隔符。当带有可选参数的命令位于可选参数中时,这是一个常见问题。

相关内容