问题陈述
我收到了一条错误消息
! Argument of \begin has an extra }.
关于\begin{exref}
MWE 的第 28 行(即)。这是一个可选环境,用于说明练习的来源。
平均能量损失
\documentclass[12pt,a4paper]{scrbook}
\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}
\usepackage{answers}
\Newassociation{sol}{Solution}{TDsolution}
\definecolor{color00}{HTML}{9B9B9B}
\newcommand\chapterbackcolor{color00}
\renewcommand\chapterbackcolor{color00}
\usepackage[listings,theorems,skins,breakable]{tcolorbox}
% THEOREM STYLE ======================================
\tcbuselibrary{theorems}
\tcbuselibrary{hooks}
\usepackage[amsmath,hyperref]{ntheorem}
\newtcbtheorem{ex}{Exercise}{%
before lower app={\noindent\ignorespaces Solution: \\},
fonttitle=\bfseries\upshape,fontupper=\sffamily,
colframe=\chapterbackcolor!75!black!50!,colback=\chapterbackcolor!15!white,
colbacktitle=\chapterbackcolor!75!black!50!,coltitle=white}{ex}
\newenvironment{exref}{\noindent\ignorespaces This question is sourced from}{\par\noindent%
\ignorespacesafterend\\}
\begin{document}
\chapter{Dummy Chapter}
\begin{ex}{Dummy Variables}
\begin{exref}
the...
\end{exref}
\begin{sol}
Let...
\tcblower
Let...
\end{sol}
\end{ex}
\end{document}
答案1
您的ex
环境需要二强制参数(参见第 328 页,tcolorbox 手册)。