Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Latex 如何在定理、定义和练习中使用tcolorbox_Latex - Fatal编程技术网

Latex 如何在定理、定义和练习中使用tcolorbox

Latex 如何在定理、定义和练习中使用tcolorbox,latex,Latex,我正在写一个数学模块,里面有定理和定义。使用tcolorbox包中的文档tcolorbox,我能够写出定理和定义,但我在练习中遇到了问题。文档不清楚如何设置练习环境。下面是我的mwe,第1部分适用于定理和定义,第3部分不适用于练习。 我希望您能在序言中为演习环境的工作做好准备 \documentclass[11pt,twoside,fleqn]{report} \usepackage[listings]{tcolorbox} \tcbuselibrary{listings,theorems}

我正在写一个数学模块,里面有定理和定义。使用tcolorbox包中的文档tcolorbox,我能够写出定理和定义,但我在练习中遇到了问题。文档不清楚如何设置练习环境。下面是我的mwe,第1部分适用于定理和定义,第3部分不适用于练习。 我希望您能在序言中为演习环境的工作做好准备

\documentclass[11pt,twoside,fleqn]{report}
\usepackage[listings]{tcolorbox}

\tcbuselibrary{listings,theorems}
\newtcbtheorem[number within=section]{mytheo}{Theorem}%
{colback=green!5,colframe=green!35!black,fonttitle=\bfseries}{th}

\usepackage{cleveref}
\tcbset{
defstyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape,
arc=0mm, colback=blue!5!white,colframe=blue!75!black},
theostyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape,
colback=red!10!white,colframe=red!75!black},
}
\newtcbtheorem[number within=subsection,crefname={definition}
{definitions}]%
\newtcbtheorem[number within=subsection,crefname={definition}
{definitions}]%

{Definition}{Definition}{defstyle}{def}
\newtcbtheorem[use counter from=Definition,crefname={theorem}{theorems}]%
{Theorem}{Theorem}{theostyle}{theo}
\newtcbtheorem[use counter from=Definition,crefname={corollary}
{corollaries}]%
{Corollary}{Corollary}{theostyle}{cor}
序言在此不起作用(未定义控制序列)

下面的部分不起作用

\begin{exercise}
Find the inverse of $A=\begin{pmatrix*}[r]
2 & 5\\
1 & 3
 \end{pmatrix*}$
\tcblower
We seek a matrix $B=\begin{pmatrix*}[r]
a & b\\
c & d
\end{pmatrix*}$ such that $AB=\begin{pmatrix*}[r]
2 & 5\\
1 & 3\\
\end{pmatrix*}\begin{pmatrix*}[r]
a & b\\
c & d
\end{pmatrix*} =\begin{pmatrix*}[r]
1 & 0\\
0 & 1
\end{pmatrix*}$\par
 $AB=\begin{pmatrix*}[r]
2a+5c & 2b+5d\\
a+3c & b+3d
\end{pmatrix*}$=$\begin{pmatrix*}[r]
1 & 0\\
0 & 1
\end{pmatrix*}$\hspace{10pt} i.e
\systeme{2a+5c=1,a+3c=0}\hspace{1ex}\systeme{2b+5d=0,b+3d=1}\\
Solving for a, b, c, d gives $B=A^{-1}=\begin{pmatrix*}[r]
3 & -5\\
-1 & 1\\
\end{pmatrix*}$
 \end{exercise}
\end{document}
同样,如果有人能在Tclorbox中提供一个我可以修改的练习示例,我将不胜感激

\begin{exercise}
Find the inverse of $A=\begin{pmatrix*}[r]
2 & 5\\
1 & 3
 \end{pmatrix*}$
\tcblower
We seek a matrix $B=\begin{pmatrix*}[r]
a & b\\
c & d
\end{pmatrix*}$ such that $AB=\begin{pmatrix*}[r]
2 & 5\\
1 & 3\\
\end{pmatrix*}\begin{pmatrix*}[r]
a & b\\
c & d
\end{pmatrix*} =\begin{pmatrix*}[r]
1 & 0\\
0 & 1
\end{pmatrix*}$\par
 $AB=\begin{pmatrix*}[r]
2a+5c & 2b+5d\\
a+3c & b+3d
\end{pmatrix*}$=$\begin{pmatrix*}[r]
1 & 0\\
0 & 1
\end{pmatrix*}$\hspace{10pt} i.e
\systeme{2a+5c=1,a+3c=0}\hspace{1ex}\systeme{2b+5d=0,b+3d=1}\\
Solving for a, b, c, d gives $B=A^{-1}=\begin{pmatrix*}[r]
3 & -5\\
-1 & 1\\
\end{pmatrix*}$
 \end{exercise}
\end{document}