我有一个嵌套在枚举中的证明。我已设置 \parindent 和 \listparindent,但证明环境中的段落仍然没有缩进。以下代码
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{amsmath, amsfonts, amsthm, amssymb, sgame, bbm, enumitem, verbatim}
\usepackage[all,cmtip]{xy}
\setlength{\parindent}{0.5 in}
\setlength{\listparindent}{0.5in}
\begin{document}
\begin{enumerate}
\item This is a question on hw
\begin{proof}
This is my answer. First paragraph. Words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words\par
Second paragraph should be indented. words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words words
\end{proof}
\end{enumerate}
\end{document}
答案1
这是默认行为;像 这样的列表环境enumerate
会清除 的值\parindent
。以下最小示例说明了这一点:
\documentclass{article}
\usepackage{lipsum}
\setlength{\parindent}{0.5in}
\setlength{\listparindent}{0.5in}
\begin{document}
\lipsum[1-2]% 0.5in paragraph indent
\begin{enumerate}
\item \lipsum[1-2]% No paragraph indent
\end{enumerate}
\end{document}
如果您希望\parindent
在列表内恢复,则必须在列表内更新它,如下例所示:
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\begin{enumerate}
\setlength{\parindent}{0.5in}
\item \lipsum[1-2]
\end{enumerate}
\end{document}
\parindent
对于将withinproof
作为 的一部分进行恢复也是如此enumerate
:
\documentclass{article}
\usepackage{amsthm,lipsum}
\begin{document}
\begin{enumerate}
\setlength{\parindent}{0.5in}
\item \lipsum[1-2]
\begin{proof}
\lipsum*[3]
\lipsum*[4]
\end{proof}
\end{enumerate}
\end{document}
如果你希望\parindent
在所有环境中都有效enumerate
,则可以使用以下命令轻松进行全局设置enumitem
:
\usepackage{enumitem}
\setlist[enumerate]{listparindent=0.5in}