Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在latex中创建自定义页面编号?_Latex_Page Numbering - Fatal编程技术网

如何在latex中创建自定义页面编号?

如何在latex中创建自定义页面编号?,latex,page-numbering,Latex,Page Numbering,我有一份报告,里面还有附录。 我想要的是在附录开始时在页面编号上使用不同的样式 我使用阿拉伯语直到我到达附录。然后我想做这样的事情: 我希望自定义页面编号为: Chapter: A Section: {Chapter}{1} (A-1) \newpage \页面编号{CustomPageNumber} 这可能吗 Some paragraph. Some paragraph. Some paragraph. Some paragraph. Some paragraph. \new

我有一份报告,里面还有附录。 我想要的是在附录开始时在页面编号上使用不同的样式

我使用阿拉伯语直到我到达附录。然后我想做这样的事情:

我希望自定义页面编号为:

Chapter: A
Section: {Chapter}{1}       (A-1)
\newpage
\页面编号{CustomPageNumber}
这可能吗

Some paragraph. Some paragraph. Some paragraph. Some paragraph. Some paragraph.

\newpage
\setcounter{page}{1}
\renewcommand{\thepage}{A-\arabic{page}}

Some paragraph. Some paragraph. Some paragraph. Some paragraph. Some paragraph.
这会接近你想要做的吗?这就是如何操作
页面
计数器和
\page
命令的方法,该命令确定将打印的页码
\roman{page}
将给出罗马数字,
\alph{page}
a、b、c

另一个明智的解决方案是按照前面的建议使用这个包。

如果您能够使用这个类(我推荐),那么您可以使用页面样式。请参见
第7.2章页面样式
。例如,创建两种样式:

\pagestyle{plain}%常规页码
... 东西
\clearpage%在此创建一个新的页面编号
\copypagestyle{Appendix PS}{plain}
\更新命令{\thepage}{Chapter\Chapter Section\Section page\page}
\页面样式{AppendixPS}

我已经有一段时间没有对此进行过测试了,也没有使用过乳胶,但我希望它能提供一些思考的素材,或者至少能让您走上正确的道路。

首先,我要创建一个包含所有章节和附录等的文件,称为main.tex或desh.tex

在那里,您可以执行所有包含和文档设置,以及页眉和页脚设置:

% Free Header and Footer
\usepackage{fancyhdr}
\lfoot[\fancyplain{}{}]{\fancyplain{}{}}
\rfoot[\fancyplain{}{}]{\fancyplain{}{}}
\cfoot[\fancyplain{}{\footnotesize\thepage}]{\fancyplain{}{\footnotesize\thepage}}
\lhead[\fancyplain{}{\footnotesize\nouppercase\leftmark}]{\fancyplain{}{}}
\chead{}
\rhead[\fancyplain{}{}]{\fancyplain{}{\footnotesize\nouppercase\sc\leftmark}} 
在这里,它将使页码位于页脚的中心。章节标题在页眉的左边,如果你的作品是双页的,也在右边

然后你可以开始包括你的其他章节。。我的看起来是这样的(仍在论文中):


希望有帮助!页眉和页脚有时比较困难,有时如果更改\documentclass,也可能会出现不同的情况。;)

+1个好答案。用
fancyhdr
做个例子,这将是一个非常好的答案。+1这节省了我几个小时的时间。为了得到更准确的答案,你应该详细说明你正在寻找的“自定义页码”的确切格式和行为。我投票结束这个问题,因为它是关于乳胶的
% --- Start of Document ----------------------------------------
\begin{document}

\pagenumbering{roman}       %roemische ziffern

\pagestyle{fancy}           % Initialize Header and Footer

\include{title}         % Title Page
\include{affidavit}     % affidavit
\include{abstracts}     % Englisch and German abstracts
\include{acknowl}       % Acknowledgements
\include{glossary}      % Glossary
\include{abbreviation}  % Abkuerzungen
%\include{keywords}     % Keywords
\include{toc}       % Table of Contents

%--- Include your chapters here ----------
\setcounter{page}{1}    % set page to 1 again to start arabic count
\pagenumbering{arabic}
%\include{chapter0}
\include{chapter1}      % Introduction
\include{chapter2}      % Background
\include{chapter3}      % Konzeption
\include{chapter4}      % Technische Umsetzung
\include{chapter5}

\include{chapter6}

%
%% ....

\appendix
\include{appendix}          % Appendix A

\end{document}