设置 \pagenumbering{Roman} 后不起作用

设置 \pagenumbering{Roman} 后不起作用

我在论文的最后\printbibliography打印了我的参考书目。一切都很好,但之后我想添加附录,如下所示:

\pagenumbering{arabic}
text texxt text

\printbibliography % This ends with my last arabic numbering 100

\pagenumbering{Roman}
\begin{appendix}
\include{xy} % This page should have either Roman I or IV as I already started using for my title page etc.
\end{appendix}

但是现在我编译的文档中有我的参考书目 I 和我所附的附录 II。

这样我就可以自己决定罗马数字应该从哪里开始。在本例中是 9,与 IX 相同。

\pagenumbering{arabic}
text text text
\printbibliography
\clearpage\pagenumbering{Roman}\setcounter{page}{9}
\begin{appendix}
\include{more text}
\end{appendix}

但是我怎样才能让 LaTeX 自动执行此操作呢?我想用类似以下内容替换 9:

\clearpage\pagenumbering{Roman}\setcounter{page}{macro/function to look for the last used Roman and insert it +1}

答案1

更改编号方案时,转到新页面很重要;这就是导致问题的原因:当您发布时,\pagenumbering{Roman}参考书目页面尚未发出。

该方案可以是这样的,也可以用于恢复页码:

\documentclass[twoside]{report} % works also without the twoside option
\usepackage{lipsum}

% a counter to store the last page number in the front matter
\newcounter{rememberpage}

\begin{document}

% Start the front matter
\pagenumbering{Roman}

Text to fill up some pages.

\lipsum[1-12]

% End of the front matter
% First go to a new page (odd page if twoside)
\cleardoublepage
% store the current page number
\setcounter{rememberpage}{\value{page}}

% start the main matter
\pagenumbering{arabic}

Some other text

\lipsum[1-12]

\printbibliography

% End of the main matter
% Go to a new page (odd page if twoside)
\cleardoublepage
% Set up Roman numbering
\pagenumbering{Roman}
% Restore the remembered page number
\setcounter{page}{\value{rememberpage}}

% Start the appendices
\appendix

Now the appendix text

\lipsum

\end{document}

我不会将附录的编号改回罗马字体,但如果您需要这么做……

相关内容