注意,本站不是「PDF分享」站
提问就要focus在真正体现你问题的关键点上,给可以体现你问题的示例代码
我帮你在原问题里补充了「最小工作示例」,希望你下次提问能自己给出

也不太难,看下原码即可:
% elegantbook.cls Line 1165
%% Example with counter
\newcounter{exam}[chapter]
\setcounter{exam}{0}
\renewcommand{\theexam}{\thechapter.\arabic{exam}}
\newenvironment{example}[1][]{
\refstepcounter{exam}
\par\noindent\textbf{\color{main}{\examplename} \theexam #1 }\rmfamily}{
\par\ignorespacesafterend}想办法把上面的设置覆盖掉即可...
\documentclass[lang=cn,11pt,twoside,openany]{elegantbook}
\geometry{paperheight=10cm}
\counterwithin{exam}{section}
\renewcommand{\theexam}{\thesection.\arabic{exam}}
\begin{document}%
\chapter{test}
\section{sec}
\begin{example}
test test test test
\end{example}
\begin{example}
test test test test
\end{example}
\section{sec}
\begin{example}
test test test test
\end{example}
\chapter{test}
\section{sec}
\begin{example}
test test test test
\end{example}
\begin{example}
test test test test
\end{example}
\section{sec}
\begin{example}
test test test test
\end{example}
\end{document} 



















问 使用elegantbook模板如何设置「示例类环境」example的计数器为「按章、节两级标题」计数?