行列式.pdf
这是我作品
原问题的MWE如下
\documentclass[lang=cn,11pt,twoside,openany]{elegantbook}
\geometry{paperheight=10cm}
\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}
这样得到的「example
」按照文档所述是「按chapter
」编号
如何修改为「按章、节两层计数器」编号呢?
也不太难,看下原码即可:
% 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}
example
环境,对于同样属于「示例类环境」的problem
和exercise
环境的修改,也是类似的...留做习题...