首先,代码如下:
\documentclass[11pt,a4paper]{report}
\usepackage{amsmath,amsfonts,amssymb,amsthm,blindtext,epsfig,epstopdf,titling,url,array,xspace}
\usepackage[nopar]{lipsum}
\usepackage{thmtools}
\usepackage[a4paper,bindingoffset=0.2in,left=1in,right=1in,top=1in,bottom=1in,footskip=.25in]{geometry}
\usepackage{enumerate}
\declaretheorem{theoremm}
\declaretheoremstyle[%
spaceabove=-7pt,%
spacebelow=9pt,%
headfont=\normalfont\itshape,%
postheadspace=1em,%
qed=\qedsymbol%
]{mystyle}
\declaretheorem[name={\textbf{Proof}},style=mystyle,unnumbered,
]{prf}
\begin{document}
\begin{prf}
\ \\
\textbf{(1)} - Hello, I am mine.
\end{prf}
\begin{prf}
\ \\
{\begin{enumerate}[\textbf{(1)}]
\item - Hello, I am mine.
\end{enumerate}}
\end{prf}
\end{document}
输出如下:
我必须使用enumerate
环境内的proof
。然后我注意到主体和证明标题之间以及主体和 qed 方块之间插入了很大的空间间隙。
上面是我在不使用enumerate
环境的情况下得到的结果,下面是我使用enumerate
环境得到的。
我该如何修改代码以便在使用enumerate
环境时获得上述样式?任何帮助或提示都将不胜感激。
答案1
您可以使用 来执行此操作enumitem
,而不必添加换行符(并且prf
如果愿意,可以为环境内的所有 ,lists 设置参数):
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb,amsthm,blindtext,epsfig,epstopdf,titling,url,array,xspace}
\usepackage[nopar]{lipsum}
\usepackage{thmtools}
\usepackage[a4paper, bindingoffset=0.2in, margin=1in, footskip=.25in]{geometry}
\usepackage[shortlabels]{enumitem}
\declaretheorem{theoremm}
\declaretheoremstyle[%
spaceabove=-7pt,%
spacebelow=9pt,%
headfont=\normalfont\itshape,%
postheadspace=1em,%
qed=\qedsymbol%
]{mystyle}
\declaretheorem[name={\textbf{Proof}},style=mystyle,unnumbered,
]{prf}
\begin{document}
\begin{prf}
\ \\
\textbf{(1)} - Hello, I am mine.
\end{prf}
\vspace{1cm}
\begin{prf}
\begin{enumerate}[(1), wide=0pt, topsep=0pt, font=\bfseries, leftmargin=*, before=\leavevmode, after=\vspace{-1\baselineskip}]
\item – Hello, I am mine. You are yours. He is his. she is hers. Yours is mine. Mine is absolutely not yours.
\end{enumerate}
\end{prf}
\end{document}
答案2
您可以设置合适的列表声明,但有时更简单只需删除多余的行。
\documentclass[11pt,a4paper]{report}
\usepackage{amsmath,amsfonts,amssymb,amsthm,blindtext,epsfig,epstopdf,titling,url,array,xspace}
\usepackage[nopar]{lipsum}
\usepackage{thmtools}
\usepackage[a4paper,bindingoffset=0.2in,left=1in,right=1in,top=1in,bottom=1in,footskip=.25in]{geometry}
\usepackage{enumerate}
\declaretheorem{theoremm}
\declaretheoremstyle[%
spaceabove=-7pt,%
spacebelow=9pt,%
headfont=\normalfont\itshape,%
postheadspace=1em,%
qed=\qedsymbol%
]{mystyle}
\declaretheorem[name={\textbf{Proof}},style=mystyle,unnumbered,
]{prf}
\begin{document}
\begin{prf}\mbox{}
\vspace{-\baselineskip}
\begin{enumerate}[\bfseries (1)]
\item - Hello, I am mine.
\end{enumerate}
\end{prf}
\end{document}