我正在尝试适应这一点模板作为我的讲稿。
你能解释一下为什么在中有冒号
Definition 0.1: Markov chain
而在中没有吗Theorem 0.1 Ohlala
?
为了简单起见,我更喜欢不带冒号,即Definition 0.1 Markov chain
。我无法发现定理和定义框的 LaTex 命令之间的差异来源。
\documentclass{report}
\usepackage[tmargin=2cm,rmargin=1in,lmargin=1in,margin=0.85in,bmargin=2cm,footskip=.2in]{geometry}
\usepackage[varbb]{newpxmath}
\usepackage{varwidth, hyperref,theoremref}
\usepackage[noabbrev,capitalize,nameinlink]{cleveref}
\hypersetup{
pdftitle={Assignment},
colorlinks=true, linkcolor=doc!90,
bookmarksnumbered=true,
bookmarksopen=true
}
\usepackage[most,many,breakable]{tcolorbox}
\definecolor{mytheorembg}{HTML}{F2F2F9}
\definecolor{mytheoremfr}{HTML}{00007B}
\definecolor{mydefinitbg}{HTML}{E5E5FF}
\definecolor{mydefinitfr}{HTML}{3F3FA3}
\definecolor{doc}{RGB}{0,60,110}
%================================
% THEOREM BOX
%================================
\tcbuselibrary{theorems,skins,hooks}
\newtcbtheorem[number within=chapter, crefname={theorem}{Theorem}]{theorem}{Theorem}
{%
enhanced,
breakable,
colback = mytheorembg,
frame hidden,
boxrule = 0sp,
borderline west = {2pt}{0pt}{mytheoremfr},
sharp corners,
detach title,
before upper = \tcbtitle\par\smallskip,
coltitle = mytheoremfr,
fonttitle = \bfseries\sffamily,
description font = \mdseries,
separator sign none,
segmentation style={solid, mytheoremfr},
}{}
%================================
% DEFINITION BOX
%================================
\newtcbtheorem[number within=chapter, crefname={definition}{Definition}]{definition}{Definition}{enhanced,
before skip=2mm,after skip=2mm, colback=red!5,colframe=red!80!black,boxrule=0.5mm,
attach boxed title to top left={xshift=1cm,yshift*=1mm-\tcboxedtitleheight}, varwidth boxed title*=-3cm,
boxed title style={frame code={
\path[fill=tcbcolback]
([yshift=-1mm,xshift=-1mm]frame.north west)
arc[start angle=0,end angle=180,radius=1mm]
([yshift=-1mm,xshift=1mm]frame.north east)
arc[start angle=180,end angle=0,radius=1mm];
\path[left color=tcbcolback!60!black,right color=tcbcolback!60!black,
middle color=tcbcolback!80!black]
([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east)
[rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east)
-- (frame.south east) -- (frame.south west)
-- ([xshift=-1mm,yshift=-1mm]frame.north west)
[sharp corners]-- cycle;
},interior engine=empty,
},
fonttitle=\bfseries,
title={#2},#1}{}
\begin{document}
\begin{theorem}[label={abc}]{Ohlala}{}
xyz
\end{theorem}
\begin{definition}[label={xyz}]{Markov chain}{}
abc
\end{definition}
\end{document}
答案1
框theorem
定义包含一个separator sign none
不包含在definition
框中的选项。此选项强制框名称和标题之间不出现分隔符。