我该如何禁用由 tcbtheorem 制作的定理和示例框内的缩进?如能得到任何帮助我将不胜感激。
\documentclass{book}
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{geometry}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsfonts}
\RequirePackage{amsthm}
\RequirePackage[many]{tcolorbox}
\RequirePackage{letltxmacro}
\newtcbtheorem[number within=section, list inside = theoremlist, list type = thrm]{thrm}{Theorem}%
{enhanced, breakable,
colback=r!7, colbacktitle=r!17, coltitle=RedViolet,
frame hidden, parbox=false,
arc=1.85pt, titlerule=0pt, toptitle=2pt, bottomtitle=2pt,
fonttitle=\bfseries,separator sign= : \hspace{0.005cm},
segmentation style={solid, draw=r!55, line width=1pt},
before upper=\csname @nobreakfalse\endcsname
}{th}
\newtcbtheorem[use counter from=thrm]{exmp}{Example}%
{enhanced, breakable,
colback=gray!13, colbacktitle=gray!23, coltitle=black,
frame hidden, parbox=false,
arc=1.85pt, titlerule=0pt, toptitle=2pt, bottomtitle=2pt,
fonttitle=\bfseries,separator sign= : \hspace{0.005cm},
segmentation style={solid, draw=gray!50, line width=1pt},
before upper=\csname @nobreakfalse\endcsname,
before = \noindent
}{ex}
\begin{document}
\begin{exmp}{Birthday Paradox}{}
Let \( n \) people be in a room. What is the probability that no two people share a common birthday? For \( i = 1, \dots , n \) and \( j = 1, \dots , i - 1, \) let \( A_{i} = \left\{ \text{person } i \text{ does not share a birthday with any person } j \right\} \). Then
\[
\mathbb{P} ( \text{no people share a common birthday} ) = \mathbb{P} (\bigcap_{i=1}^{n} A_{i} ) = \prod_{i=1}^{n} \mathbb{P} (A_{i} \mid A_1 \cap \dots \cap A_{i - 1})
\]
We can easily find \( \mathbb{P} (A_{i} \mid A_1 \cap \dots \cap A_{i - 1} ) = \frac{365 - (i - 1)}{365} \), this is because for each person \( i \) we have \( i - 1 \) fewer choices of days for us to maintain the unique pattern of birthdays.
This means
\end{exmp}
\end{document}
答案1
拔出钥匙parbox=false
。
\documentclass{book}
\usepackage[dvipsnames]{xcolor}
\usepackage{geometry}
\usepackage{amssymb}
\usepackage[many]{tcolorbox}
\newtcbtheorem[number within=section, list inside = theoremlist, list type = thrm]{thrm}{Theorem}%
{enhanced, breakable,
colback=r!7, colbacktitle=r!17, coltitle=RedViolet,
frame hidden, parbox=false,
arc=1.85pt, titlerule=0pt, toptitle=2pt, bottomtitle=2pt,
fonttitle=\bfseries,separator sign= : \hspace{0.005cm},
segmentation style={solid, draw=r!55, line width=1pt},
before upper=\csname @nobreakfalse\endcsname
}{th}
\newtcbtheorem[use counter from=thrm]{exmp}{Example}%
{enhanced, breakable,
colback=gray!13, colbacktitle=gray!23, coltitle=black,
frame hidden,
arc=1.85pt, titlerule=0pt, toptitle=2pt, bottomtitle=2pt,
fonttitle=\bfseries,separator sign= : \hspace{0.005cm},
segmentation style={solid, draw=gray!50, line width=1pt},
before upper=\csname @nobreakfalse\endcsname,
before = \noindent
}{ex}
\begin{document}
\begin{exmp}{Birthday Paradox}{}
Let \( n \) people be in a room. What is the probability that no two people share a common birthday? For \( i = 1, \dots , n \) and \( j = 1, \dots , i - 1, \) let \( A_{i} = \) \{person $i$ does not share a birthday with any person $j$\}. Then
\[
\mathbb{P} ( \text{no people share a common birthday} ) = \mathbb{P} (\bigcap_{i=1}^{n} A_{i} ) = \prod_{i=1}^{n} \mathbb{P} (A_{i} \mid A_1 \cap \dots \cap A_{i - 1})
\]
We can easily find \( \mathbb{P} (A_{i} \mid A_1 \cap \dots \cap A_{i - 1} ) = \frac{365 - (i - 1)}{365} \), this is because for each person \( i \) we have \( i - 1 \) fewer choices of days for us to maintain the unique pattern of birthdays.
This means
\end{exmp}
\end{document}