如何处理条件语句中带有长文本的案例环境

如何处理条件语句中带有长文本的案例环境

我有以下代码

\begin{align*}
H_k(\mathbb{RP}^n \times \mathbb{RP}^m) &\cong \left(\bigoplus _{i+j = 
k}\begin{cases*}
\mathbb{Z} & if $\mathcal{P}_1$ \\
\mathbb{Z}/2\mathbb{Z} & if $\mathcal{P}_2 \cup \mathcal{P}_3$\\
0 & otherwise \\
\end{cases*}\right) \\ 
&\oplus \left(\bigoplus_{p+q = k-1} \begin{cases*}
\mathbb{Z}/2\mathbb{Z} & if $q$ is odd and $0 <q < m$ and $p$ is odd and $0 < p < n$\\
0 & otherwise \\
\end{cases*}\right)
\end{align*}

产生以下输出(框代码不在上面)

在此处输入图片描述

现在的问题是,我希望案例环境中的长条件能够适合该框并且仍然以自然的方式出现在 Z/2Z 旁边。

我能得到的最好的结果是在对上面的代码进行微小更改后得到以下内容,这看起来不太自然,因为看起来我们在案例环境中有两个单独的条件,而且其中一个条件位于空白块旁边。

在这种情况下,处理这种情况的最佳方法是什么?

在此处输入图片描述

答案1

我更喜欢第一张图片,我插入了geometry包,我已经完成了你最初不完整的代码。

在此处输入图片描述

\documentclass[a4paper,11pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{mathtools,amssymb}
\begin{document}

\begin{align*}
H_k(\mathbb{RP}^n \times \mathbb{RP}^m) &\cong \left(\bigoplus _{i+j = 
k}\begin{cases*}
\mathbb{Z} & if $\mathcal{P}_1$ \\
\mathbb{Z}/2\mathbb{Z} & if $\mathcal{P}_2 \cup \mathcal{P}_3$\\
0 & otherwise \\
\end{cases*}\right) \\ 
&\oplus \left(\bigoplus_{p+q = k-1} \begin{cases*}
\mathbb{Z}/2\mathbb{Z} & if $q$ is odd and $0 <q < m$ and $p$ is odd and $0 < p < n$\\
0 & otherwise \\
\end{cases*}\right)
\end{align*}

\end{document}

相关内容