在下面的代码中,我想i=0,\ldots,n.
在输出中将定义第一部分的情况排成一行。理想情况下,句号应与分号和逗号对齐。
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
d_i(g_n,\ldots,g_0) &=
\begin{cases}
(d_0g_ng_{n-1},g_{n-2},\ldots,g_0),& \text{if $i=0$;}\\
(d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), \\
& \phantom{\text{if $i=0$;}}\llap{\text{if $i=1,\ldots,n-1$;}} \\
(d_ng_n,\ldots,d_1g_1),& \text{if $i=0$,}
\end{cases}
\intertext{and}
s_i(g_n,\ldots,g_0) &= (s_ig_n,\ldots,s_0g_{n-i},id_{G_{n-i}},g_{n-i-1},\ldots,g_0),\quad i=0,\ldots,n.
\end{align*}
\end{document}
答案1
沃纳比我快了 56 秒,但还有一个替代方案
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
d_i(g_n,\ldots,g_0) &=
\begin{cases}
(d_0g_ng_{n-1},g_{n-2},\ldots,g_0),& \text{if $i=0$;}\\
(d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), \\
& \phantom{\text{if $i=0$;}}\llap{\text{if $i=1,\ldots,n-1$;}} \\
(d_ng_n,\ldots,d_1g_1),& \text{if $i=0$,}
\end{cases}
\intertext{and}
s_i(g_n,\ldots,g_0) &= (s_ig_n,\ldots,s_0g_{n-i},id_{G_{n-i}},g_{n-i-1},\ldots,g_0),&\llap{$i=0,\ldots,n$.\kern\minalignsep}
\end{align*}
\noindent X\dotfill X
\end{document}
答案2
以下内容提供了您所需要的内容:
\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\begin{document}
\newsavebox{\mathbox}
\savebox{\mathbox}{$\left\{\begin{array}{@{}ll@{}}
(d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), & \text{if $i=0$;} \\
(d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), & \text{if $i=0$;} \\
(d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), & \text{if $i=0$;}
\end{array}\right.\kern-\nulldelimiterspace$}
\begin{align*}
d_i(g_n,\ldots,g_0) &=
\begin{cases}
(d_0g_ng_{n-1},g_{n-2},\ldots,g_0),& \text{if $i=0$;}\\
(d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), \\
& \phantom{\text{if $i=0$;}}\llap{\text{if $i=1,\ldots,n-1$;}} \\
(d_ng_n,\ldots,d_1g_1),& \text{if $i=0$,}
\end{cases}
\intertext{and}
s_i(g_n,\ldots,g_0) &= \makebox[\wd\mathbox][l]{$
(s_ig_n,\ldots,s_0g_{n-i},id_{G_{n-i}},g_{n-i-1},\ldots,g_0),\hfill i=0,\ldots,n.
$}
\end{align*}
\end{document}
解决方案将一堆数学内容存储在名为 的框中\mathbox
。此框包含一个array
带有列规范的框@{}ll@{}
- 类似于cases
。此外,它还包括一个可扩展的左括号(使用 删除\left\{
空右分隔符)。 中的内容由实际环境中最长的条目构成。我使用了 3 行相同的内容,尽管一行具有足够长度的零宽度垂直规则也足够了。目的是提供一个可扩展的左括号,其宽度(水平)与原始 一样宽,因为将仅使用的宽度。\right.
\kern-\nulldelimiterspace
array
cases
cases
\mathbox
一旦建立了框,\makebox[\wd\mathbox][l]{$...$}
就会使用常规来设置剩余数学内容的内容。