下面的代码
\documentclass{memoir}
%\usepackage{fontspec}
\usepackage{kantlipsum}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage[many]{tcolorbox}
\setlength{\textwidth}{0.8\paperwidth}
\setlength{\textheight}{0.8\paperheight}
\setlength{\uppermargin}{3cm}
\setlrmargins{*}{*}{1}
\checkandfixthelayout
%\usepackage{lettrine}
%\newfontfamily\zallman[Scale=3]{ZallmanCaps}
%\renewcommand*{\LettrineFont}{\zallman}
%\setlength{\DefaultNindent}{0pt}
\theoremstyle{definition}
\newtheorem{thm}{Theorem}[chapter]
\tcolorboxenvironment{thm}{
breakable,
colback=red!10,
boxrule=0pt,
left=3pt,right=3pt,top=3pt,bottom=3pt,
oversize=0pt,
sharp corners
}
\begin{document}
%\lettrine[lines = 2, lraise=-0.05]{S}{ome}
Some text is here which is extremely long such that it spans two lines of this page solely for the purpose of filling two lines.
\begin{thm}
If $f$ is integrable on $[a,b]$, then it holds that
\[
\lim_{n\to\infty}\frac{b-a}{n}\sum_{k=1}^n f\Bigl(a+k\cdot\frac{b-a}{n}\Bigr)
=\int_a^b f(x)\,dx
\]
\end{thm}
\kant[1]
\end{document}
但是添加字母字符会扰乱包含该字符的段落后的段落形成:
\documentclass{memoir}
\usepackage{fontspec}
\usepackage{kantlipsum}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage[many]{tcolorbox}
\setlength{\textwidth}{0.8\paperwidth}
\setlength{\textheight}{0.8\paperheight}
\setlength{\uppermargin}{3cm}
\setlrmargins{*}{*}{1}
\checkandfixthelayout
\usepackage{lettrine}
\newfontfamily\zallman[Scale=3]{ZallmanCaps}
\renewcommand*{\LettrineFont}{\zallman}
\setlength{\DefaultNindent}{0pt}
\theoremstyle{definition}
\newtheorem{thm}{Theorem}[chapter]
\tcolorboxenvironment{thm}{
breakable,
colback=red!10,
boxrule=0pt,
left=3pt,right=3pt,top=3pt,bottom=3pt,
oversize=0pt,
sharp corners
}
\begin{document}
\lettrine[lines = 2, lraise=-0.05]{S}{ome} text is here which is extremely long such that it spans two lines of this page solely for the purpose of filling two lines.
\begin{thm}
If $f$ is integrable on $[a,b]$, then it holds that
\[
\lim_{n\to\infty}\frac{b-a}{n}\sum_{k=1}^n f\Bigl(a+k\cdot\frac{b-a}{n}\Bigr)
=\int_a^b f(x)\,dx
\]
\end{thm}
\kant[1]
\end{document}
该问题从何而来以及如何解决?
编辑:
Ulrike Fischer 建议在\parshape=0
后面添加end{thm}
,但是,如下面的屏幕截图所示,颜色框和下一段仍然被错误地缩进。
答案1
你的例子可以简化为
\documentclass{memoir}
\usepackage{lettrine}
\setlength{\DefaultNindent}{0pt}
\begin{document}
\lettrine[lines = 2, lraise=-0.05]{S}{ome} text is here which
is extremely long such that it spans two lines of this page
solely for the purpose of filling two lines.{
some text some text some text some text some text some text
some text some text
}
some text some text some text some text some text some text
some text some text some text some text some text some text
some text some text some text some text some text some text
some text some text some text some text some text some text
some text some text some text some text some text some text
\end{document}
Lettrine 设置了一种特殊的段落形状,该形状在段落末尾恢复,但如果该形状位于一个组中,则重置将丢失,因此该形状会泄漏到后面的段落。
先结束段落,再开始小组讨论。({
此处,\begin{thm}
原文如此)
\documentclass{memoir}
\usepackage{lettrine}
\setlength{\DefaultNindent}{0pt}
\begin{document}
\lettrine[lines = 2, lraise=-0.05]{S}{ome} text is here which
is extremely long such that it spans two lines of this page
solely for the purpose of filling two lines.
{
some text some text some text some text some text some text
some text some text
}
some text some text some text some text some text some text
some text some text some text some text some text some text
some text some text some text some text some text some text
some text some text some text some text some text some text
some text some text some text some text some text some text
\end{document}