答案1
我向您推荐这个最小的工作示例。
\documentclass{report}
\usepackage[Bjornstrup]{fncychap}
\usepackage{algpseudocode}
\usepackage{algorithm}
\makeatletter \renewcommand\thealgorithm{\thechapter.\arabic{algorithm}} \@addtoreset{algorithm}{chapter} \makeatother
\begin{document}
\chapter{Sonny}
\begin{algorithm}
\caption{Pseudocode}\label{alg:cap}
\begin{algorithmic}
\State $i \gets 10$
\If{$i\geq 5$}
\State $i \gets i-1$
\Else
\If{$i\leq 3$}
\State $i \gets i+2$
\EndIf
\EndIf
\end{algorithmic}
\end{algorithm}
\end{document}
答案2
以下是使用和的可能解决方案xcolor
:titlesec
array
\documentclass{book}
\setcounter{chapter}{1}
\usepackage{graphicx}
\usepackage[svgnames]{xcolor}
\usepackage{titlesec}
\titleformat{\chapter}[display]{\filleft\huge\bfseries}{\selectfont\color{FireBrick}\scalebox{4}{\thechapter}}{1em}{}
\begin{document}
\chapter{Dataset}
\end{document}