哈喽,姑娘们、小伙子们!
我想在附录中自定义编号。例如,我希望第一部分的每一页编号为 A.1、A.2、...、An,第二部分编号为 B.1、B.2、... 等等。
我已经准备了一个最小代码,或多或少地展示了如何改变编号,但是,我无法做到我想要的。
\documentclass[11pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage[width=0.00cm, height=0.00cm, left=1.00in, right=1.00in, top=1.00in, bottom=1.00in]{geometry}
\author{Doge of the Serene Republic}
\title{A Socio-economic Analysis of Naval Powers at the Italian Peninsula of the Medieval Period}
\begin{document}
\maketitle
\pagenumbering{arabic}
\thispagestyle{empty}
\begin{abstract}
This is my abstract ...
\end{abstract}
\newpage
\section{This is section one}
\newpage
\section{On the Economic Structure of Venice and the Neighbouring Naval States}
\newpage
\pagenumbering{Alph}
\appendix
\section{The Scientific Method}
\par Here I describe my method in detail ...
\end{document}
答案1
下面是一个可以满足您需求的示例。它处理图形、表格、公式和页面,并在前面添加附录字母。当您只想要一个(无字母的)附录(“附录”)或想要多个带字母的附录(“附录 A”、“附录 B”等)时,它都可以做到这一点。
已编辑,以采纳 Mico 的建议。
\documentclass[12pt]{article}
\usepackage{boxhandler}
\makeatletter
\renewcommand\appendix{\@ifstar{\loneappendix}{\anappendix}}
\newcounter{appndx}
\setcounter{appndx}{0}
\newcommand \loneappendix [1]{
\clearpage
\setcounter{appndx}{1}
\setcounter{figure}{0}
\renewcommand\thefigure{\Alph{appndx}-\@arabic\c@figure}
\setcounter{table}{0}
\renewcommand\thetable{\Alph{appndx}-\arabic{table}}
\setcounter{equation}{0}
\renewcommand\theequation {\Alph{appndx}-\arabic{equation}}
\def\appendixtitle{\appendixname. #1}
\addcontentsline{toc}{section}\appendixtitle
\theappendix\appendixtitle
\setcounter{page}{1}
\renewcommand\thepage{\Alph{appndx}.\arabic{page}}
}
\newcommand \anappendix[1]{
\clearpage
\refstepcounter{appndx}
\setcounter{equation}{0}
\setcounter{figure}{0}
\renewcommand\thefigure{\Alph{appndx}-\@arabic\c@figure}
\setcounter{table}{0}
\renewcommand\thetable{\Alph{appndx}-\arabic{table}}
\renewcommand\theequation {\Alph{appndx}-\arabic{equation}}
\def\appendixtitle{\appendixname~\Alph{appndx}. #1}
\addcontentsline{toc}{section}\appendixtitle
\theappendix\appendixtitle
\setcounter{page}{1}
\renewcommand\thepage{\Alph{appndx}.\arabic{page}}
}
\newcommand\theappendix[1]{
\section*{#1}
}
\makeatother
\begin{document}
\section{First section}
\bxtable[ht]{Caption}{\rule{2in}{1in}}
\section{Second Section}
Text
\begin{equation}
y =x^2
\end{equation}
\appendix{First of Many Appendices}
Let's see if tables are renumbered
\bxtable[ht]{Caption}{\rule{2in}{1in}}
\bxfigure[ht]{Caption}{\rule{2in}{1in}}
\begin{equation}
y =x^2
\end{equation}
I want to check if next page indexes page number
\clearpage
I see that it does.
\appendix{Second Lettered Appendix}
Is it ``B''?
Alternately, I could have called one single appendix:
\appendix*{My Lone Appendix}
The rest follows.
\end{document}
答案2
部分解决...
\documentclass[11pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage[width=0.00cm, height=0.00cm, left=1.00in, right=1.00in, top=1.00in, bottom=1.00in]{geometry}
\author{Doge of the Serene Republic}
\title{A Socio-economic Analysis of Naval Powers at the Italian Peninsula of the Medieval Period}
\begin{document}
\maketitle
\pagenumbering{arabic}
\thispagestyle{empty}
\begin{abstract}
This is my abstract ...
\end{abstract}
\newpage
\section{This is section one}
\newpage
\section{On the Economic Structure of Venice and the Neighbouring Naval States}
\newpage
\clearpage
\pagenumbering{arabic} % resets `page` counter to 1
\renewcommand*{\thepage}{A.\arabic{page}}
\section{The Scientific Method}
\par Here I describe my method in detail ...
\end{document}
另请参阅此处:自定义附录