如上图所示,“解决方案”定理的顶部和底部边距不同。我该如何实现相同的效果?LaTeX
下面给出代码。
\documentclass[oneside,12pt]{article}
\usepackage[left=3em,right=3em,top=3em]{geometry}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{parskip}
\usepackage{amssymb}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem*{sol}{Solution}
\usepackage{enumitem}
\setlist[enumerate,2]{label=\arabic*.}
\begin{document}
\textbf{Beta reduce}\quad Evaluate (that is, beta reduce) each of the following
expressions to normal form. We strongly recommend writing out the steps on
paper with a pencil or pen.
\begin{enumerate}
\item $(\lambda abc.cba)zz(\lambda wv.w)$
\begin{sol}
\leavevmode
\begin{enumerate}
\item $(\lambda bc.cbz)z(\lambda wv.w)$
\item $(\lambda c.czz)(\lambda wv.w)$
\item $(\lambda wv.w)zz$
\item $(\lambda v.z)z$
\item $z$
\end{enumerate}
\end{sol}
\item $(\lambda x.\lambda y.xyy)(\lambda a.a)b$
\begin{sol}
\leavevmode
\begin{enumerate}
\item $(\lambda y.(\lambda a.a)yy)b$
\item $(\lambda a.a)bb$
\item $bb$
\end{enumerate}
\end{sol}
\item $(\lambda y.y)(\lambda x.xx)(\lambda z.zq)$
\begin{sol}
\leavevmode
\begin{enumerate}
\item $(\lambda x.xx)(\lambda z.zq)$
\item $(\lambda z.zq)q$
\item $qq$
\end{enumerate}
\end{sol}
\end{enumerate}
\end{document}
答案1
显然parskip
和enumitem
彼此都不喜欢。最好把parskip
包裹放在这里。(我会试着找出 问题的真正根源parskip
)
\documentclass[oneside,12pt]{article}
\usepackage[left=3em,right=3em,top=3em]{geometry}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
%\usepackage{parskip}
\usepackage{amssymb}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem*{sol}{Solution}
\usepackage{enumitem}
\setlist[enumerate,2]{label=\arabic*}
\begin{document}
\textbf{Beta reduce}\quad Evaluate (that is, beta reduce) each of the following
expressions to normal form. We strongly recommend writing out the steps on
paper with a pencil or pen.
\begin{enumerate}
\item $(\lambda abc.cba)zz(\lambda wv.w)$
\begin{sol}
\leavevmode
\begin{enumerate}
\item $(\lambda bc.cbz)z(\lambda wv.w)$
\item $(\lambda c.czz)(\lambda wv.w)$
\item $(\lambda wv.w)zz$
\item $(\lambda v.z)z$
\item $z$
\end{enumerate}
\end{sol}%\mbox{}%
\item $(\lambda x.\lambda y.xyy)(\lambda a.a)b$
\begin{sol}
\leavevmode
\begin{enumerate}
\item $(\lambda y.(\lambda a.a)yy)b$
\item $(\lambda a.a)bb$
\item $bb$
\end{enumerate}
\end{sol}
\item $(\lambda y.y)(\lambda x.xx)(\lambda z.zq)$
\begin{sol}
\leavevmode
\begin{enumerate}
\item $(\lambda x.xx)(\lambda z.zq)$
\item $(\lambda z.zq)q$
\item $qq$
\end{enumerate}
\end{sol}
\end{enumerate}
\end{document}