我和一位朋友正在写一本分析书。我们ntheorem
在各种自定义定理风格环境中使用枚举,并多次使用枚举。每次我将枚举放入我们的任何定理环境中时,我都会在标题和枚举列表的开头之间得到额外的不必要的垂直空间。
这是我的 MWE:
\documentclass[a4paper,12pt,twoside]{book}
\usepackage[left=1.65cm,right=1.65cm,top=2.45cm,bottom=2.60cm]
{geometry}
\usepackage{amsmath,amssymb,amscd,amsbsy,mathabx,array,color}
\usepackage{mathtools}
\usepackage{fancyhdr,framed,latexsym,multicol,pstricks,slashed,xcolor,multicol}
\usepackage{picture}
\usepackage{indentfirst}
\usepackage{enumitem}
\usepackage[amsmath,framed,thmmarks]{ntheorem}
\newtheorem{Theorem}{Theorem}
\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=cyan,linecolor=black]}
\newshadedtheorem{them}{Theorem}[section]
\begin{document}
\begin{them}
Let $X$ and $Y$ be sets. Then:
\begin{enumerate}
\item If $X$ and $Y$ are finite disjoint sets, then $X \bigcup$ is finite and $\overline{\overline{X \bigcup Y}} = \overline{\overline{X}} + \overline{\overline{Y}}$.
\item If $X$ and $Y$ are finite sets, then $X \bigcup Y$ is finite and $\overline{\overline{X \bigcup Y}} = \overline{\overline{X}} + \overline{\overline{Y}} \setminus (\overline{\overline{X \bigcap Y}})$.
\item If $X_1,X_2, \ldots, X_n$ are finite sets, then
$\displaystyle{\bigcup_{i=1}^n X_i}$ is finite.
\end{enumerate}
\end{them}
\end{document}
任何帮助都将受到赞赏。
答案1
这是 的解决方案enumitem
。我借此机会改进了你的定理布局,主要是制作模糊阴影,并 upshpae 枚举数字。另外,我从答案中借用了一个代码双线上划线定义一个定义\widedblbar
命令的小包,更适合斜体字母。我删除了 package mathabx
,因为它也定义了一个\widebar
命令,而且无论如何,它会覆盖数学符号。
\documentclass[a4paper, 12pt, twoside]{book}
\usepackage[hmargin=1.65cm, top=2.45cm, bottom=2.60cm]{geometry}
\usepackage{mathtools}
\usepackage{amssymb,amscd,amsbsy, array,color}%mathabx,
\usepackage{widedblbar}
\usepackage{fancyhdr, framed, latexsym, multicol,slashed, xcolor}
\usepackage{pstricks, pst-blur}
\usepackage{picture}
\usepackage{indentfirst}
\usepackage{enumitem}
\usepackage[amsmath, framed, thmmarks]{ntheorem}
\newtheorem{Theorem}{Theorem}
\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=cyan,linecolor=black, blur=true]}
\newshadedtheorem{them}{Theorem}[section]
\begin{document}
\begin{them}
Let $X$ and $Y$ be sets. Then:
\begin{enumerate}[wide=0pt, font=\upshape, topsep=0pt, itemsep=0pt]
\item If $X$ and $Y$ are finite disjoint sets, then $X \bigcup Y$ is finite and $\widedblbar{X \bigcup Y} = \widedblbar{X} + \widedblbar{Y}$.
\item If $X$ and $Y$ are finite sets, then $X \bigcup Y$ is finite and $\widedblbar{X \bigcup Y} = \widedblbar{X} + \widedblbar{Y} \setminus (\widedblbar{X \bigcap Y})$.
\item If $X_1,X_2, \ldots, X_n$ are finite sets, then
$\displaystyle \bigcup_{i=1}^n X_i $ is finite.
\end{enumerate}
\end{them}
\end{document}
小包内代码:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This code is a slight modification of Hendrik Vogt's \widebar %%
%% See: https://tex.stackexchange.com/questions/16337 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
% IDENTIFICATION
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{widedblbar}
\let\save@mathaccent\mathaccent
\newcommand*\if@single[3]{%
\setbox0\hbox{${\mathaccent"0362{#1}}^H$}%
\setbox2\hbox{${\mathaccent"0362{\kern0pt#1}}^H$}%
\ifdim\ht0=\ht2 #3\else #2\fi
}
%The bar will be moved to the right by a half of \macc@kerna, which is computed by amsmath:
\newcommand*\rel@kern[1]{\kern#1\dimexpr\macc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
\newcommand*\wideaccent[2]{\@ifnextchar^{{\wide@accent{#1}{#2}{0}}}{\wide@accent{#1}{#2}{1}}}
%Use a separate algorithm for single symbols:
\newcommand*\wide@accent[3]{\if@single{#2}{\wide@accent@{#1}{#2}{#3}{1}}{\wide@accent@{#1}{#2}{#3}{2}}}
\newcommand*\wide@accent@[4]{%
\begingroup
\def\mathaccent##1##2{%
%Enable nesting of accents:
\let\mathaccent\save@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
\if#42 \let\macc@nucleus\first@char \fi
%Determine the italic correction:
\setbox\z@\hbox{$\macc@style{\macc@nucleus}_{}$}%
\setbox\tw@\hbox{$\macc@style{\macc@nucleus}{}_{}$}%
\dimen@\wd\tw@
\advance\dimen@-\wd\z@
%Now \dimen@ is the italic correction of the symbol.
\divide\dimen@ 3
\@tempdima\wd\tw@
\advance\@tempdima-\scriptspace
%Now \@tempdima is the width of the symbol.
\divide\@tempdima 10
\advance\dimen@-\@tempdima
%Now \dimen@ = (italic correction / 3) - (Breite / 10)
\ifdim\dimen@>\z@ \dimen@0pt\fi
%The bar will be shortened in the case \dimen@<0 !
\rel@kern{0.6}\kern-\dimen@
\if#41
#1{\rel@kern{-0.6}\kern\dimen@\macc@nucleus\rel@kern{0.4}\kern\dimen@}%
\advance\[email protected]\dimexpr\macc@kerna
%Place the combined final kern (-\dimen@) if it is >0 or if a superscript follows:
\let\final@kern#3%
\ifdim\dimen@<\z@ \let\final@kern1\fi
\if\final@kern1 \kern-\dimen@\fi
\else
#1{\rel@kern{-0.6}\kern\dimen@#2}%
\fi
}%
\macc@depth\@ne
\let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar
\mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}%
\macc@set@skewchar\relax
\let\mathaccentV\macc@nested@a
%The following initialises \macc@kerna and calls \mathaccent:
\if#41
\macc@nested@a\relax111{#2}%
\else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
\def\gobble@till@marker##1\endmarker{}%
\futurelet\first@char\gobble@till@marker#2\endmarker
\ifcat\noexpand\first@char A\else
\def\first@char{}%
\fi
\macc@nested@a\relax111{\first@char}%
\fi
\endgroup
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\widebar{\wideaccent\overline}
\newcommand\widedblbar{\wideaccent\doubleoverline}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%