如何避免 \newenvironment 文本放在一个页面上

如何避免 \newenvironment 文本放在一个页面上

\newenvironment我第一次使用该命令,它带来了麻烦。我用它来创建一个新theorem环境


\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage{amsthm , amsfonts, latexsym}
\usepackage{tikz}
\usepackage{shadethm}
\usepackage[mathscr]{euscript}
\usepackage{graphics,graphicx}
\usepackage{enumerate}
\usepackage{color}

\theoremstyle{definition} \newshadetheorem{lems}{Lemma}[section]

\newenvironment{lem}[1][]{ \definecolor{shadethmcolor}{HTML}{00FFFF} \begin{lems}[#1]\hspace*{1mm} }{\end{lems}}

使用这个新theorem环境,我正在证明一个需要几页空间的引理。


\begin{document}
\begin{lem}
Let $H$ be a connected S-thin hypergraph, and $A \boxtimes B$ and $C \boxtimes D$ be two
decompositions of $H$ with respect to the strong product. Then there exists a decomposition
$$ A_C \boxtimes A_D \boxtimes B_C \boxtimes B_D $$
of $H$ such that $A =  A_C \boxtimes A_D, B= B_C \boxtimes B_D , C= A_C \boxtimes B_C, 
D=A_D \boxtimes B_D$.
\begin{proof}
The idea of the proof is by using the PFD of the cartesian skeleton $H^{\Box}$ of $H$  to define four proper factors, such that
each factor has as vertex set the set of one of our desired factors, e.g. $A_C$. Then we define the desired factors of $H$ by defining projections on $H$ where the vertex set is given by the composed factors of the cartesian skeleton and such that the
edges obey the definition of the strong product. Finally via those projections it is shown that $A=A_C \boxtimes A_D$.\

Let $ H_1 \Box H_2 \Box ... \Box H_n $ be the unique PFD of a cartesian skeleton $H^{\Box}$ of $H$ . Let $I_A$ be the subset of the index set $ {1,2,...,n}$ with $V(A)=V(\Box_{i \in I_A} H_i)$ and $I_B, I_C$ and $I_D$ be defined analogously. Furthermore set $$ H_{A,C} = \Box_{i \in I_A \cap I_C} H_i$$ and define $H_{A,D}, H_{B,C}$ and $H_{B,D}$ similarly. Then $$ H^{\Box} = H_{A,C} \Box H_{A,D} \Box H_{B,C} \Box H_{B,D} . $$ It will be convenient to use only four coordinates $(x_1,x_2,x_3,x_4)$ for every vertex $x \in V(G)$ henceforth. Of course it is possible that not all of the intersections $I_A \cap I_C, I_A \cap I_D, I_D \cap I_C$ and $I_B \cap I_D$ are nonempty. Suppose that $I_B \cap I_C = \emptyset$ then $I_A \cap I_D \neq \emptyset$. If in addition $I_A \cap I_C$ were empty, then $I_A = I_D$ and thus $I_B=I_C$, but then would be nothing to prove. \ We can thus assume that all but possibly $I_B \cap I_D$ are nonempty and at least three of the four coordinates are nontrivial, that is to say, there are at least two vertices that differ in the first, second and third coordinates, but it is possible that all vertices have the same fourth coordinate. \ Clearly, for $y=(y_1,y_2,y_3,y_4),$ $$V(A^y) = { (x_1,x_2,y_3,y_4) | x_1 \in V(H_{A,C}), x_2 \in V(H_{A,D}) } $$ $$V(B^y) = { (y_1,y_2,x_3,x_4) | x_3 \in V(H_{B,C}), x_4 \in V(H_{B,D}) } $$ $$V(C^y) = { (x_1,y_2,x_3,y_4) | x_1 \in V(H_{A,C}), x_3 \in V(H_{B,C}) } $$ $$V(D^y) = { (y_1,x_2,y_3,x_4) | x_2 \in V(H_{A,D}), x_4 \in V(H_{B,D}) } $$ are the vertex sets of the $A-,B-,C-$ and $D-$ layers of $H$. \

We now define $A_C$ as $p_1(H)$, namely $V(A_C) = V(H_{A,C})$ and $${x_1^1,...,x_k^1 } \in E(A_C)$$ if and only if there are vertices $ \tilde x_1=(x_1^1,x_1^2,x_1^3,x_1^4),..., \tilde x_k =(x_k^1,x_k^2,x_k^3,x_k^4) \in H \text { such that} $ $$ \exists e \in E(H) : \exists S \subseteq I={2,3,4} : p_1(e) = { x_1^1,...,x_k^1} $$ \begin{itemize}

\item[(i)] $ p_s(e) \subseteq e_s \in E_s , \forall s \in S$ \item[(ii)]$ |e| = |p_s(e)|, \forall s \in S$ \item[(iii)] $|p_i(e)|=1, \forall i \in I \setminus S$ \end{itemize}

It is clear what is meant by $A_D, B_C$ and $B_D$. For the proof of the lemma it suffices to show that $A = A_C \boxtimes A_D$. Recall that $A$ is obtained by projection of $H$ onto the vertex set of $A$. We call this projection $p_A$ and define $p_B,p_C,p_D$ analogously. With our present coordinatization we thus have $$p_A(x_1,x_2,x_3,x_4) = (x_1,x_2,-,-), $$ $$p_B(x_1,x_2,x_3,x_4) = (-,-,x_3,x_4), $$ $$p_C(x_1,x_2,x_3,x_4) = (x_1,-,x_3,-), $$ $$p_D(x_1,x_2,x_3,x_4) = (-,x_2,-,x_4). $$ In order to show that $A=A_C \boxtimes A_D$, it suffices to prove that for $e={\tilde x_1,..., \tilde x_k } \in H$ holds $$ p_A(e) \in A $$ if and only if $$ p_1(e) \in A_C \text{ and either is } e \text{ an edge in }A_D \text{, hence } p_2(e) \subseteq e \in A_D, |e|=|p_2(e)| $$ $$\text{ or not and thus } |p_2(e)|=1 $$ (wlog. we assume that the edge of $A_C$ is of minimal rank, otherwise we could easily add a case to the above definition where the edge of $A_D$ was the minimal one. But for the sake of clarity we omit this case).

Suppose that $ {p_A \tilde x_1,..., p_A \tilde x_k } \subseteq e \in A$. We can assume, wlog., that $\tilde x_1, ... , \tilde x_k $ are chosen such that ${ \tilde x_1 ,... , \tilde x_k } \in E(H).$ But then $ {p_1 \tilde x_1, ... , p_1 \tilde x_k } \in A_C $ and ${p_2 \tilde x_1, ... , p_2 \tilde x_k } \in A_D$ by the definition of $A_C$ and $A_D$. \ On the other hand, suppose that the edge ${ (x_1^1,-,-,-),(x_2^1,-,-,-),...,(x_k^1,-,-,-}$ is in $A_C$ and ${(_,x_1^2,-,-),...,(-,x_t^2,-,-)} $ is in $A_D , t \leq t $. \ Then there are vertices $\tilde x_1, \tilde x_2, ... , \tilde x_k, ... , \tilde x_t$ of the form $$ \tilde x_i = ( x_i^1, x_i^2, x_i^3, x_i^4) $$ with ${ \tilde x_1 , ... , \tilde x_k } \in E(H)$ and ${ \tilde x_1 , ... ,\tilde x_t } \in E(H)$. \ From this we infer that there are edges $$ { (x_1^1,-,x_1^3,-),...,(x_s^1,-,x_s^3,-) } \in E(C) , k \leq s \leq t $$ $$ {(-,x_1^2,-,x_1^4),...,(-,x_r^2,-,x_r^4) } \in E(D), k \leq r \leq t $$ Since $H = C \boxtimes D$ this implies that $$ {(x_1^1,x_1^2,x_1^3,x_1^4),...,(x_s^1,x_s^2,x_s^3,x_s^4) } \in E(H) \text{ where wlog. } s \leq r$$ and hence ${(x_1^1,x_1^2,-,-),...,(x_s^1,x_s^2,-,-) } \subseteq e \in E(A)$. \end{proof} \end{lem} \end{document}

让我困扰的不是证明,所以没人帮我检查 ;)。问题在于证明需要好几页,但 LaTeX 却把它们都放在一页上,这显然有点不利。

因此,如果有人能告诉我如何调整环境以使内容跨页面流动,我会很高兴。

答案1

您看到的行为是由于该shadethm包承认它无法处理分页符

截屏

这个shadethm软件包相当老旧了,好消息是,从那时起,这个功能极其强大且用户友好的mdframed该包由 Marco Daniel 创建。

您可以使用它创建真正漂亮的框架环境,并且它可以处理分页符。接下来是完整的 MWE,您可以根据需要进行调整 - 请参阅文档了解更多详细信息。

截屏

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}

\newmdtheoremenv[outerlinewidth=3,
        innerlinewidth=2,linecolor=gray,
        backgroundcolor=blue!20,%
        innerlinecolor=blue!50,outerlinecolor=red!50,innertopmargin=0pt,%
        splittopskip=\topskip,skipbelow=0pt,%
        ]{lem}{Lemma}[section]


\begin{document}
\begin{lem}
Let $H$ be a connected S-thin hypergraph, and $A \boxtimes B$ and $C \boxtimes D$ be two
decompositions of $H$ with respect to the strong product. Then there exists a decomposition
$$ A_C \boxtimes A_D \boxtimes B_C \boxtimes B_D $$
of $H$ such that $A =  A_C \boxtimes A_D, B= B_C \boxtimes B_D , C= A_C \boxtimes B_C, 
D=A_D \boxtimes B_D$.
\mbox{} % needed because you end your lemma with mathematical content
\begin{proof}
 \lipsum
\end{proof}
\end{lem}
\end{document}

其他一些注意事项:

  • 我注意到你正在使用$$...$$显示数学内容。这已经过时了,你应该使用\[...\],请参阅为什么 \[ ... \] 比 $$ ... $$ 更可取?进行良好的讨论。
  • 我还注意到您有相当多的连续显示数学环境。这也应该避免,您应该使用包中的一个环境amsmath,例如gatherperhaps。

相关内容