乳胶中彩色运动环境的问题

乳胶中彩色运动环境的问题

我创建了一个带有解决方案的练习表,我想使用我在此博客上找到的以下彩色练习环境:

\documentclass[a4paper,10pt,oneside]{article}
\usepackage[paper=a4paper,left=35mm,right=20mm,top=25mm,bottom=20mm]{geometry}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{nth}
\usepackage{xspace}
\usepackage{amsmath}
\usepackage{pdfpages}
\usepackage{amssymb}
\usepackage{amstext}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{paralist}
\usepackage{acronym}
\usepackage{xcolor}
\usepackage{enumitem}  
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{tikz-cd}
\usepackage{mathrsfs}
\usepackage{float}
\usepackage{subfigure}
\usepackage{leftidx}
\usepackage{lipsum}
\usepackage[many]{tcolorbox}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\xp}{x^{\prime}}
\let \ra \rangle
\let \l \langle
\newcommand{\oco}{\otimes \cdots \otimes}
\newcommand{\dos}{, \ldots ,}
\newcommand{\tis}{ \t \cdots \t}
\newcommand{\bt}[1]{\left| #1 \right|}
\newcommand{\pr}[1]{#1^{\prime}}
\newcommand{\fk}[1]{\textit{\textbf{#1}}}
\newcommand{\h}{^} % I use this command instead of ^ since my notebook has a different keyboard on which it is cumbersome to find the sign ^ 
\newcommand{\tr}[1]{\textit{\textcolor{red}{#1}}}
\let\t\times
\let\r\rightarrow
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\theoremstyle{definition}
\newtheorem{prop}{Proposition}
\theoremstyle{definition}
\newtheorem*{exmps}{Examples}
\theoremstyle{definition}
\newtheorem*{exmpn}{Example}
\theoremstyle{remark}
\newtheorem{remark}{Remark}[section]
\theoremstyle{definition}
\newtheorem{rems}{Remarks}[section]
\theoremstyle{definition}
\newtheorem{exmp}{Example}[section]
\definecolor{greentitle}{rgb}{0.0, 0.0, 0.5}
\definecolor{greentitleback}{rgb}{0.8, 0.8, 1.0}
\newtcolorbox[
  auto counter,
  number within=section
]{exo}[2][]{%
  breakable,
  enhanced,
  colback=white,
  colbacktitle=white,
  arc=0pt,
  leftrule=1pt,
  rightrule=0pt,
  toprule=0pt,
  bottomrule=1pt,
  titlerule=0pt,
  colframe=greentitleback,
  fonttitle=\normalcolor,
  overlay={
    \node[
      outer sep=0pt,
      anchor=east,
      text width=2.5cm,
      minimum height=4ex,
      fill=greentitleback,
      font=\color{greentitle}\sffamily\scshape
    ] at (title.west) {exercise~\thetcbcounter};
  },
  title=#2,
  #1
}
\newcommand\Solution{\par\textbf{\textit{\textcolor{greentitle}{Solution :}}}\par\medskip}
\begin{document}
\section{Exercises on categories, functors and natural transformations}
\ \\  
\begin{exo}{Let $\mathcal{C}$ and $\mathcal{D}$ be two categories.}
\begin{enumerate}
\item[a)] Prove that $\mathcal{C}\h{op}$ is a category, called the \tr{opposite category}.
\item[b)] Show that $\mathcal{C} \t \mathcal{D}$ is a category, termed the \tr{product category}. 
\end{enumerate}
\Solution
\begin{enumerate}
\item[a)] Let us remind that the opposite category  $\mathcal{C}\h{op}$ of a given category $\mathcal{C}$ is obtained by reversing the morphisms. Clearly, we have $(\mathcal{C}\h{op})\h{op} = \mathcal{C}$, since reversing the arrows twice yields the original category. It is easily comprehensible that $\mathcal{C}\h{op}$ is formed as follows : 
\begin{enumerate}
\item[\textcolor{greentitle}{•}] The objects of $\mathcal{C}\h{op}$ coincide with the objects of $\mathcal{C}$, i.e. $Ob(\mathcal{C}\h{op}) = Ob(\mathcal{C})$. 
\item[\textcolor{greentitle}{•}] Let $A, B \in Ob(\mathcal{C})$. To every morphism $f : A \r B$ in $C$, there corresponds a morphism $f\h{op} : B \r A$ in $C\h{op}$. In other words, $Hom_{\mathcal{C}}(A, B) = Hom_{\mathcal{C}\h{op}}(B, A)$. 
\item[\textcolor{greentitle}{•}] If $f: A \r B$ and $g: B \r C$ are morphisms in $\mathcal{C}$, then the composite 
\ \\ $(g \circ f)\h{op} = f\h{op} \circ g\h{op}$  in $\mathcal{C}\h{op}$ is defined to be the composite $g \circ f$ in $\mathcal{C}$, as illustrated in the diagram below. 
\begin{figure}[H] 
\centerline{\includegraphics[width=7cm]{d1col.png}}
\end{figure}
\ \\ Since $\mathcal{C}$ is a category, it is evident that the composition in $\mathcal{C}\h{op}$ is associative.  
\item[\textcolor{greentitle}{•}] The identity of $\mathcal{C}\h{op}$ is the equivalent to the identity of $\mathcal{C}$. 
\end{enumerate}
\ \\ We conclude that $\mathcal{C}\h{op}$ is a category. 
\item[b)] The product category $\mathcal{C} \t \mathcal{D}$ is composed of the following : 
\begin{enumerate}
\item[\textcolor{greentitle}{•}] The objects of $\mathcal{C} \t \mathcal{D}$ are pairs of objects $(A, B)$, where $A \in Ob(\mathcal{C})$ and $B \in Ob(\mathcal{D})$.  
\item[\textcolor{greentitle}{•}] The morphisms from $(A, B)$ to $(\pr{A}, \pr{B})$ are pairs of morphisms $(f, g)$, 
\ \\ where $f : A \r \pr{A}$ is a morphism of $\mathcal{C}$ and $g : B \r \pr{B}$ is a morphism of $\mathcal{D}$. 
\item[\textcolor{greentitle}{•}] The composition of two morphisms $(f, g) : (A, B) \r (\pr{A}, \pr{B})$ and 
\ \\ $(\pr{f}, \pr{g}) : (\pr{A}, \pr{C}) \r (A\h{\prime \prime}, B\h{\prime \prime})$ in $\mathcal{C} \t \mathcal{D}$ is defined componentwise by means of the composites in $\mathcal{C}$ and $\mathcal{D}$, i.e. $(\pr{f}, \pr{g}) \circ (f, g) = (\pr{f} \circ f, \pr{g} \circ g)$. Moreover, associativity of the composition of morphisms in $\mathcal{C} \t \mathcal{D}$ follows from the fact that the composition of morphisms in the categories $\mathcal{C}$ and $\mathcal{D}$ are associative. 
\item[\textcolor{greentitle}{•}] The identity of $\mathcal{C} \t \mathcal{D}$ is the pair $1_{(A, B)} = (1_A, 1_B)$ of identities of the categories $\mathcal{C}$ and $\mathcal{D}$ respectively. 
\end{enumerate} 
\end{enumerate}
\end{exo}
\ \\
\begin{exo}{Recall the definition of a cochain complex of vector spaces from the lecture. Show that $cCh(Vect)$ and $gVect$ are categories.} Subsequently, prove that $H : cCh(Vect) \r gVect$ is a functor, called the \tr{cohomology functor}. 
\ \\ 
\Solution
\ \\ (The solution is not complete.)It is straightforward to show that $gVect$ is a category : Let $K$ be a field. The objects of $gVect$ are $K$-vector spaces $V$ equipped with a direct sum decomposition $V = \bigoplus\limits_{k \in \Z} V_k$. 
\ \\ Let $U, V \in Ob(gVect)$. Morphisms of $\Z$-graded vector spaces are $K$-linear maps $f: U \r V$ of degree $0$, i.e. $f(U_i) \subseteq V_i$ for all $i \in \Z$. For every $U, V$ and $W \in Ob(gVect)$, the composition of morphisms $f: U \r V$ and $g : V \r W$ is defined as $g \circ f : U \r W$. The identity of $gVect$ is given by the morphism $id_V : V \r V$.
\end{exo}
\begin{exo}{Verify that the map $T : Manifold \r VectBd$ sending a smooth manifold $M$ to its tangent bundle $TM$ and a smooth map $f: M \r N$ to its derivative $Tf : TM \r TN$ is a covariant functor from the category of smooth manifolds to the category of vector bundles. }
\Solution
\end{exo}
\begin{exo}{Show that functors preserve isomorphisms.}
\ \\ 
\Solution
\end{exo}
\end{document}

但是,我有两个问题。每次开始新的练习时,其编号都会在左侧用彩色框表示。第一个问题是,如果带有解决方案的练习持续几页,则指示练习编号的彩色框也会出现几次,但它应该只在新练习开始时出现一次。

第二个问题是,我不能在练习的标题中写逗号,否则pgfkeys会出现错误消息。

如果有人能帮我解决我的问题,我会非常高兴。不幸的是,我对使用 latex 不是很有经验。

感谢您的帮助。

答案1

overlay unbroken and first如果盒子未破损(即对于短盒子)或者仅对于破损盒子的第一部分,该选项将使用覆盖规范。

问题,在于,它应该是title={#2},而不是title=#2

这里还有许多其他关于风格等的问题,但这些是不是问题的一部分,而不应成为问题的一部分。

\documentclass[a4paper,10pt,oneside,demo]{article}
\usepackage[paper=a4paper,left=35mm,right=20mm,top=25mm,bottom=20mm]{geometry}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{nth}
\usepackage{xspace}
\usepackage{amsmath}
\usepackage{pdfpages}
\usepackage{amssymb}
\usepackage{amstext}
\usepackage{amsthm}
\usepackage{amsfonts}
%\PassOptionsToPackage{demo}{graphicx}
\usepackage{graphicx}
\usepackage{paralist}
\usepackage{acronym}
\usepackage{xcolor}
\usepackage{enumitem}  
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{tikz-cd}
\usepackage{mathrsfs}
\usepackage{float}
\usepackage{subfigure}
\usepackage{leftidx}
\usepackage{lipsum}
\usepackage[many]{tcolorbox}

\usepackage{blindtext}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\xp}{x^{\prime}}
\let \ra \rangle
\let \l \langle
\newcommand{\oco}{\otimes \cdots \otimes}
\newcommand{\dos}{, \ldots ,}
\newcommand{\tis}{ \t \cdots \t}
\newcommand{\bt}[1]{\left| #1 \right|}
\newcommand{\pr}[1]{#1^{\prime}}
\newcommand{\fk}[1]{\textit{\textbf{#1}}}
\newcommand{\h}{^} % I use this command instead of ^ since my notebook has a different keyboard on which it is cumbersome to find the sign ^ 
\newcommand{\tr}[1]{\textit{\textcolor{red}{#1}}}
\let\t\times
\let\r\rightarrow
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\theoremstyle{definition}
\newtheorem{prop}{Proposition}
\theoremstyle{definition}
\newtheorem*{exmps}{Examples}
\theoremstyle{definition}
\newtheorem*{exmpn}{Example}
\theoremstyle{remark}
\newtheorem{remark}{Remark}[section]
\theoremstyle{definition}
\newtheorem{rems}{Remarks}[section]
\theoremstyle{definition}
\newtheorem{exmp}{Example}[section]
\definecolor{greentitle}{rgb}{0.0, 0.0, 0.5}
\definecolor{greentitleback}{rgb}{0.8, 0.8, 1.0}
\newtcolorbox[
  auto counter,
  number within=section
]{exo}[2][]{%
  breakable,
  enhanced,
  colback=white,
  colbacktitle=white,
  arc=0pt,
  leftrule=1pt,
  rightrule=0pt,
  toprule=0pt,
  bottomrule=1pt,
  titlerule=0pt,
  colframe=greentitleback,
  fonttitle=\normalcolor,
  overlay unbroken and first={
    \node[
      outer sep=0pt,
      anchor=east,
      text width=2.5cm,
      minimum height=4ex,
      fill=greentitleback,
      font=\color{greentitle}\sffamily\scshape
    ] at (title.west) {exercise~\thetcbcounter};
  },
  title={#2},
  #1
}
\newcommand\Solution{\par\textbf{\textit{\textcolor{greentitle}{Solution :}}}\par\medskip}
\begin{document}
\section{Exercises on categories, functors and natural transformations}
\ \\  
\begin{exo}{Let $\mathcal{C}$, and $\mathcal{D}$ be two categories.}% comma explicitly there
\begin{enumerate}[label={\alph*)}]
\item Prove that $\mathcal{C}\h{op}$ is a category, called the \tr{opposite category}.
\item Show that $\mathcal{C} \t \mathcal{D}$ is a category, termed the \tr{product category}. 
\end{enumerate}
\Solution
\begin{enumerate}
\item[a)] Let us remind that the opposite category  $\mathcal{C}\h{op}$ of a given category $\mathcal{C}$ is obtained by reversing the morphisms. Clearly, we have $(\mathcal{C}\h{op})\h{op} = \mathcal{C}$, since reversing the arrows twice yields the original category. It is easily comprehensible that $\mathcal{C}\h{op}$ is formed as follows : 
\begin{enumerate}
\item[\textcolor{greentitle}{•}] The objects of $\mathcal{C}\h{op}$ coincide with the objects of $\mathcal{C}$, i.e. $Ob(\mathcal{C}\h{op}) = Ob(\mathcal{C})$. 
\item[\textcolor{greentitle}{•}] Let $A, B \in Ob(\mathcal{C})$. To every morphism $f : A \r B$ in $C$, there corresponds a morphism $f\h{op} : B \r A$ in $C\h{op}$. In other words, $Hom_{\mathcal{C}}(A, B) = Hom_{\mathcal{C}\h{op}}(B, A)$. 
\item[\textcolor{greentitle}{•}] If $f: A \r B$ and $g: B \r C$ are morphisms in $\mathcal{C}$, then the composite 
\ \\ $(g \circ f)\h{op} = f\h{op} \circ g\h{op}$  in $\mathcal{C}\h{op}$ is defined to be the composite $g \circ f$ in $\mathcal{C}$, as illustrated in the diagram below. 
\begin{figure}[H] 
\centering 
\includegraphics[width=7cm]{d1col.png}
\end{figure}
\ \\ Since $\mathcal{C}$ is a category, it is evident that the composition in $\mathcal{C}\h{op}$ is associative.  
\item[\textcolor{greentitle}{•}] The identity of $\mathcal{C}\h{op}$ is the equivalent to the identity of $\mathcal{C}$. 
\end{enumerate}
\ \\ We conclude that $\mathcal{C}\h{op}$ is a category. 
\item[b)] The product category $\mathcal{C} \t \mathcal{D}$ is composed of the following : 
\begin{enumerate}
\item[\textcolor{greentitle}{•}] The objects of $\mathcal{C} \t \mathcal{D}$ are pairs of objects $(A, B)$, where $A \in Ob(\mathcal{C})$ and $B \in Ob(\mathcal{D})$.  
\item[\textcolor{greentitle}{•}] The morphisms from $(A, B)$ to $(\pr{A}, \pr{B})$ are pairs of morphisms $(f, g)$, 
\ \\ where $f : A \r \pr{A}$ is a morphism of $\mathcal{C}$ and $g : B \r \pr{B}$ is a morphism of $\mathcal{D}$. 
\item[\textcolor{greentitle}{•}] The composition of two morphisms $(f, g) : (A, B) \r (\pr{A}, \pr{B})$ and 
\ \\ $(\pr{f}, \pr{g}) : (\pr{A}, \pr{C}) \r (A\h{\prime \prime}, B\h{\prime \prime})$ in $\mathcal{C} \t \mathcal{D}$ is defined componentwise by means of the composites in $\mathcal{C}$ and $\mathcal{D}$, i.e. $(\pr{f}, \pr{g}) \circ (f, g) = (\pr{f} \circ f, \pr{g} \circ g)$. Moreover, associativity of the composition of morphisms in $\mathcal{C} \t \mathcal{D}$ follows from the fact that the composition of morphisms in the categories $\mathcal{C}$ and $\mathcal{D}$ are associative. 
\item[\textcolor{greentitle}{•}] The identity of $\mathcal{C} \t \mathcal{D}$ is the pair $1_{(A, B)} = (1_A, 1_B)$ of identities of the categories $\mathcal{C}$ and $\mathcal{D}$ respectively. 
\end{enumerate} 
\end{enumerate}
\end{exo}
\ \\
\begin{exo}{Recall the definition of a cochain complex of vector spaces from the lecture. Show that $cCh(Vect)$ and $gVect$ are categories.} Subsequently, prove that $H : cCh(Vect) \r gVect$ is a functor, called the \tr{cohomology functor}. 
\ \\ 
\Solution
\ \\ (The solution is not complete.)It is straightforward to show that $gVect$ is a category : Let $K$ be a field. The objects of $gVect$ are $K$-vector spaces $V$ equipped with a direct sum decomposition $V = \bigoplus\limits_{k \in \Z} V_k$. 
\ \\ Let $U, V \in Ob(gVect)$. Morphisms of $\Z$-graded vector spaces are $K$-linear maps $f: U \r V$ of degree $0$, i.e. $f(U_i) \subseteq V_i$ for all $i \in \Z$. For every $U, V$ and $W \in Ob(gVect)$, the composition of morphisms $f: U \r V$ and $g : V \r W$ is defined as $g \circ f : U \r W$. The identity of $gVect$ is given by the morphism $id_V : V \r V$.
\end{exo}
\begin{exo}{Verify that the map $T : Manifold \r VectBd$ sending a smooth manifold $M$ to its tangent bundle $TM$ and a smooth map $f: M \r N$ to its derivative $Tf : TM \r TN$ is a covariant functor from the category of smooth manifolds to the category of vector bundles. }
\Solution
\end{exo}
\begin{exo}{Show that functors preserve isomorphisms.}
\blindtext[20]
\Solution
\end{exo}
\end{document}

在此处输入图片描述

相关内容