Latex 公式图表按章节编号、顺序编号

latex最前面加上三句代码:

\documentclass[a4paper]{article}

%核心就是下面三段代码
\usepackage{amsmath}
\numberwithin{equation}{section}%公式按章节编号
\numberwithin{figure}{section}%图表按章节编号
%在其他文章类型中,section可以换为chapter

\begin{document}
	\section{principle}
	%这里只演示公式
	\begin{equation}
		x+y=2
		\label{equ1}
	\end{equation}
	Such as(\ref{equ1})
	\begin{equation}
		a+b=1
		\label{equ2}
	\end{equation}
	Such as(\ref{equ2})
\end{document}

编译出来如下所示:

Latex 公式图表按章节编号、顺序编号_第1张图片

可以看到公式按照章节编号。

有些文章模板本来就是按照章节编号,如果不想这样,可以用下面三段代码改回去非章节编号

\usepackage{chngcntr}
\counterwithout{equation}{section}
\counterwithout{figure}{section}

Latex 公式图表按章节编号、顺序编号_第2张图片

你可能感兴趣的:(latex,信号处理)