我的文档中有许多 tcolorbox,我想将其中一个添加到我的目录中。
测试代码:
\documentclass[10pt,a4paper,twoside,spanish]{scrbook}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{4}
\usepackage{units}
\usepackage{endnotes}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{scrhack}
\usepackage{graphicx}
\usepackage{color,xcolor}
\usepackage[most]{tcolorbox}
\tcbuselibrary{theorems}
\usepackage{tikz, pgf, pgfplots}
\usetikzlibrary{arrows,backgrounds,plotmarks,shapes.geometric,calc}
\pgfplotsset{width=7cm,compat=newest}
\pgfplotsset{plot coordinates/math parser=false}
\tcbset {
teoestilo/.style={
shadow={2mm}{-1mm}{0mm}{black!50!white},
colback=gray!20!white,
coltext=black,
coltitle=white,
enlarge top by=\baselineskip/2+1mm,
enlarge top at break by=0mm,
pad at break=2mm,
fonttitle=\bfseries\large,
fontupper=\normalsize,
enhanced,
colframe=black,
boxrule=1pt,
arc=2mm,
breakable,
top=2mm,
toptitle=1mm,
bottomtitle=1mm,
before=\vskip18pt,
separator sign ={\ $\blacktriangleright$}
},
}
\newtcbtheorem[auto counter, number within=section]{teorema}%
{Teorema}{teoestilo}{th}
\newtcbtheorem[auto counter, number within=section]{definicion}%
{Definicion}{teoestilo}{def}
\newtcbtheorem[auto counter, number within=section]{ejercicio}%
{Ejercicio}{teoestilo}{ejer}
\newtcbtheorem[auto counter, number within=section]{corolario}%
{Corolario}{teoestilo}{coro}
\newtcbtheorem[auto counter, number within=section]{ejemplo}%
{Ejemplo}{teoestilo}{ejem}
\newtcbtheorem[auto counter, number within=section]{nota}%
{Nota}{teoestilo}{not}
\newtcbtheorem[auto counter, number within=section]{propo}%
{Proposición}{teoestilo}{prop}
\begin{document}
\maketitle
\tableofcontents{}
\chapter{MÉTODOS ITERATIVOS PARA RAÍCES REALES}
\section{Método De la Bisección}
\subsection{Introducción}
text test
\begin{teorema}{Bolzano}{}
Sea una función cualquiera $f\: :[a,\: b]\longrightarrow\mathbb{R}$, tal que $f\in C([a,\: b])$. Entonces:\\
Si $f(a)\cdot f(b)<0\Rightarrow \exists c\in ]a,\: b[\:/\: f(c)=0$
\end{teorema}
\begin{definicion}{Definicion}{}
xdkdkdkdkd
\end{definicion}
\end{document}
谢谢
答案1
好的,我找到了相关信息,tcolorbox
有tcblistof
命令,使用此命令您可以从自己的 tcolorboxes 中创建目录。代码:
\documentclass[10pt,a4paper,twoside,spanish]{scrbook}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{4}
\usepackage{units}
\usepackage{endnotes}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{scrhack}
\usepackage{graphicx}
\usepackage{color,xcolor}
\usepackage[most]{tcolorbox}
\tcbuselibrary{theorems}
\usepackage{tikz, pgf, pgfplots}
\usetikzlibrary{arrows,backgrounds,plotmarks,shapes.geometric,calc}
\pgfplotsset{width=7cm,compat=newest}
\pgfplotsset{plot coordinates/math parser=false}
% Fixing the tables with tcolorbox
\makeatletter
\renewcommand*\l@tcolorbox{\@dottedtocline{1}{1.5em}{3.0em}}
\makeatother
\tcbset {
teoestilo/.style={
shadow={2mm}{-1mm}{0mm}{black!50!white},
colback=gray!20!white,
coltext=black,
coltitle=white,
enlarge top by=\baselineskip/2+1mm,
enlarge top at break by=0mm,
pad at break=2mm,
fonttitle=\bfseries\large,
fontupper=\normalsize,
enhanced,
colframe=black,
boxrule=1pt,
arc=2mm,
breakable,
top=2mm,
toptitle=1mm,
bottomtitle=1mm,
before=\vskip18pt,
separator sign ={\ $\blacktriangleright$}
},
}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{teorema}%
{Teorema}{teoestilo}{th}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{definicion}%
{Definicion}{teoestilo}{def}
\newtcbtheorem[auto counter, number within=section,list inside=ej]{ejercicio}%
{Ejercicio}{teoestilo}{ejer}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{corolario}%
{Corolario}{teoestilo}{coro}
\newtcbtheorem[auto counter, number within=section,list inside=ej]{ejemplo}%
{Ejemplo}{teoestilo}{ejem}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{nota}%
{Nota}{teoestilo}{not}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{propo}%
{Proposición}{teoestilo}{prop}
\begin{document}
\maketitle
\tableofcontents{}
\newpage
\tcblistof[\section*]{thm}{Listado de Teoremas, Proposiciones, Corolarios Y Definiciones}
\newpage
\tcblistof[\section*]{ej}{Listado Ejercicios y Ejemplos}
\newpage
\chapter{MÉTODOS ITERATIVOS PARA RAÍCES REALES}
\section{Método De la Bisección}
\subsection{Introducción}
text test
\begin{teorema}{Bolzano}{}
Sea una función cualquiera $f\: :[a,\: b]\longrightarrow\mathbb{R}$, tal que $f\in C([a,\: b])$. Entonces:\\
Si $f(a)\cdot f(b)<0\Rightarrow \exists c\in ]a,\: b[\:/\: f(c)=0$
\end{teorema}
\begin{definicion}{Definicion}{}
xdkdkdkdkd
\end{definicion}
\end{document}
现在已经修复,图片显示了修复之前的错误: