我怎样才能让整个代码显示出来?

我怎样才能让整个代码显示出来?

没有编译错误,但以下代码未显示在 PDF 中。PDF 中只有一个空白处。

\begin{aligned}
a_i + a_{i+1} + a_{i+2} + \dots + a_{i + 99} &= 100\\ \\
\text{But, for any }j, \\
a_{j} +a_{j+1} + \dots + a_{j+5} &\leq 6 \\ \\
\therefore (a_i + a_{i+1} + \dots + a_{i+5}) + (a_{i+6} + \dots + a_{i+11}) + \\ \dots + (a_{i+96}+ \dots + a_{i+100} + a_{i+101}) &\leq 17\times6\\ \\
\implies (a_i + a_{i+1} + \dots + a_{i+5}) + (a_{i+6} + \dots + a_{i+11}) + \\ \dots + (a_{i+96}+ \dots + a_{i} + a_{i+1}) &\leq 102\\
\implies (a_i + a_{i+1} + \dots +a_{98} + a_{99}) + a_{i} + a_{i+1}) &\leq 102\\
\implies 100 + a_i + a_{i+1} &\leq 2\\
\implies a_i + a_{i+1} &\leq 2\\ \\
\text{If any one pair has a sum less than 2, it means that some other pair has a sum greater than 2. Since, this is not possible, it implies that all pairs have a sum divisible by 2.} \\
\text{Similarly,}\\
\end{aligned}
$$

答案1

您可以使用附加的 & 符号以及可能的 ,将 \therefore 和 \implies 进一步向左移动flalign。请注意,每个第二个 & 符号都会产生很大的间隙。

\documentclass{book}
\usepackage{mathtools}
\usepackage{amssymb}

\begin{document}
\begin{align}
a_i + a_{i+1} + a_{i+2} + \dots + a_{i + 99} &= 100\\
\shortintertext{But, for any $j$,}
a_{j} +a_{j+1} + \dots + a_{j+5} &\leq 6\\
\therefore
(a_i + a_{i+1} + \dots + a_{i+5}) + (a_{i+6} + \dots + a_{i+11}) +  \notag\\
  \dots + (a_{i+96}+ \dots + a_{i+100} + a_{i+101}) &\leq 17\times6\\
\implies (a_i + a_{i+1} + \dots + a_{i+5}) + (a_{i+6} + \dots + a_{i+11}) +  \notag\\
 \dots + (a_{i+96}+ \dots + a_{i} + a_{i+1}) &\leq 102\\
\implies (a_i + a_{i+1} + \dots +a_{98} + a_{99}) + a_{i} + a_{i+1}) &\leq 102\\
\implies 100 + a_i + a_{i+1} &\leq 2\\
\implies a_i + a_{i+1} &\leq 2
\end{align}
If any one pair has a sum less than 2, it means that some other pair has a sum greater than 2. Since, this is not possible, it implies that all pairs have a sum divisible by 2.

Similarly,
\end{document}

演示

相关内容