新年快乐!我用乳胶写我的硕士论文,我希望方程式的编号格式如下:
[章节].[节].[本节中的方程数量]
例如 (1.2.3) 是第 1 章第 2 节的第三个方程,(2,2,3) 是第 2 章第 2 节的第三个方程。谢谢!
我的代码是:
\documentclass[11pt,a4paper]{report}
\usepackage{xltxtra}
\usepackage{xgreek}
\usepackage{color}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\setmainfont[
UprightFont = Kerkis,
ItalicFont = KerkisItalics,
SlantedFont = KerkisItalics,
BoldFont = Kerkisb,
BoldItalicFont = Kerkisbi,
BoldSlantedFont = Kerkisbi,
SmallCapsFont = KerkisSmallCaps]
{Kerkis}
\newcommand{\rp}{\mathbb{RP}}
\newcommand{\eq}{\begin{equation}
\end{equation}}
\usepackage{float}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{relsize}
\usepackage{longtable}
\usepackage{fancyhdr}
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
\usepackage[]{mcode}
\usepackage{color}
\usepackage{theorem}{\theorembodyfont{\rmfamily}
\newtheorem{theorem}{Θεώρημα}}
\pagestyle{fancy}
\fancyhf{}
\usepackage{enumerate}
\usepackage[usenames,dvipsnames]{pstricks}
\newtheorem{prop}{Πρόταση}
\newtheorem{lemma}[theorem]{Λήμμα}
\theoremstyle{definition}
\newtheorem{definition}{Ορισμός}
\newenvironment{proof}{\paragraph{Απόδειξη}}{\hfill$\square$}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\cfoot{\thepage}
\usepackage[usenames,dvipsnames]{pstricks}
\usepackage{epsfig}
\usepackage{pst-grad} % For gradients
\usepackage{pst-plot}
\usepackage{hyperref}
\hypersetup{pdftex,colorlinks=true,allcolors=blue}
\usepackage{hypcap}
\renewcommand\thesection{\arabic{section}}
\usepackage{chngcntr}
\counterwithin{equation}{section}
\begin{document}
\chapter{Chapter 1}
\section{Section 1 of chapter 1}
\begin{equation}
a^2=b^2+c^2
\end{equation}
\chapter{Chapter 2}
\section{Section 1 of chapter 1}
\begin{equation}
a^2=b^2+c^2
\end{equation}
\end{document}