我正在尝试使用用 制作的框来制作文档tcolorbox
,但在第二个框定义结束时,我不断收到此错误。这尤其奇怪,因为此代码实际上是从我的另一个项目中复制粘贴的,我想使用相同的框设置。
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\usepackage[most, many, breakable]{tcolorbox}
\usepackage{amsfonts, amsmath, amssymb, amsthm, mathtools}
\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usetikzlibrary{arrows.meta, angles}
\usepackage{pgfplots}
\usepackage{titlesec}
\definecolor{theorembg}{RGB}{252, 242, 245}
\definecolor{shadowcol}{RGB}{128, 128, 128}
\definecolor{bluegrad}{RGB}{0, 16, 190}
\definecolor{redgrad}{RGB}{143, 0, 48}
\definecolor{titlecol}{RGB}{220, 43, 27}
\definecolor{greengrad}{RGB}{3, 191, 0}
\definecolor{yellowgrad}{RGB}{191, 191, 0}
\definecolor{defbg}{RGB}{255, 254, 249}
\definecolor{seccol}{RGB}{33, 18, 59}
\definecolor{mybluecolor}{RGB}{1,14,122}
\setlength{\parindent}{1cm}
\tcbuselibrary{theorems, skins, hooks}
\newtcbtheorem[number within=chapter]{theorem}{Theorem}
{%
enhanced,
breakable,
colback = theorembg,
drop shadow = shadowcol,
frame style = {left color=bluegrad, right color=redgrad},
rounded corners,
detach title,
coltitle = titlecol,
before upper = \tcbtitle\par\smallskip,
fonttitle = \scshape,
description font = \bfseries,
description delimiters parenthesis,
separator sign none}
{th}
\tcbuselibrary{theorems, skins, hooks}
\newtcbtheorem[number within=chapter]{definition}{Definition}
{%
enhanced,
breakable,
colback = defbg,
frame style = {left color=greengrad, right color=yellowgrad},
rounded corners,
detach title,
coltitle = titlecol,
before upper = \tcbtitle\par\smallskip,
fonttitle = \scshape,
separator sign none,
}{th}
\tcbuselibrary{theorems, skins, hooks}
\newtcbtheorem[number within=chapter]{proposition}{Proposition}
{%
enhanced,
breakable,
colback = theorembg,
drop shadow = shadowcol,
frame style = {left color=bluegrad, right color=redgrad},
rounded corners,
detach title,
coltitle = titlecol,
before upper = \tcbtitle\par\smallskip,
fonttitle = \scshape,
description font = \bfseries,
description delimiters parenthesis,
separator sign none,
}{th}
\tcbuselibrary{theorems, skins, hooks}
\newtcbtheorem[number within=chapter]{propanddef}{Proposition and Definition}
{%
enhanced,
breakable,
colback = defbg,
frame style = {left color=greengrad, right color=yellowgrad},
rounded corners,
detach title,
coltitle = titlecol,
before upper = \tcbtitle\par\smallskip,
fonttitle = \scshape,
separator sign none,
}{th}
\newcommand{\thm}[2]{\begin{theorem}{#1}{} \itshape#2 \end{theorem}}
\newcommand{\dfn}[2]{\begin{definition}{#1}{} \itshape#2 \end{definition}}
\newcommand{\prop}[2]{\begin{proposition}{#1}{} \itshape#2 \end{proposition}}
\newcommand{\propdef}[2]{\begin{propanddef}{#1}{} \itshape#2 \end{propanddef}}
下面是我如何应用代码的一个例子:
\documentclass[12pt]{article}
\input{preamble}
\title{\Huge\textbf{Testing Testing \\ Testing}}
\date{\large \today}
\begin{document}
\maketitle
\end{document}
如果有帮助的话,我会使用 Overleaf。提前谢谢您!