![参考书目第一页不符合页码格式](https://linux22.com/image/323306/%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE%E7%AC%AC%E4%B8%80%E9%A1%B5%E4%B8%8D%E7%AC%A6%E5%90%88%E9%A1%B5%E7%A0%81%E6%A0%BC%E5%BC%8F.png)
抱歉,我问了一个简单的问题(我无法通过搜索找到直接的答案)。参考书目中的第一个页码如下
其他页面的页码以粗体显示,
如何调整 TEX 文件以便参考书目内的页码以粗体显示?
\documentclass[12pt,a4paper]{report}
\usepackage[a4paper,margin=6mm, bottom=14mm]{geometry}
\usepackage{amsmath}
\usepackage{natbib}
\usepackage{tocbibind}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
\usepackage{blindtext}
\fancypagestyle{axionstyle}{%
\fancyhf{}
\renewcommand{\headrulewidth}{5pt}
\cfoot{\Large \textbf{\thepage}} % for example
}
\title{COMPUTATIONAL METHODS FOR THE RIEMANN ZETA FUNCTION}
\author{Axion004}
\begin{document}
\maketitle
\pagestyle{empty}
\pagenumbering{gobble} %????
\tableofcontents
\clearpage
\pagestyle{axionstyle}
\pagenumbering{arabic}%
\section*{Summary}
\addcontentsline{toc}{section}{Summary}
\nocite{•}
\bibliographystyle{plain}
\cleardoublepage
\phantomsection
\bibliography{RiemannTEX}
\pagestyle{axionstyle}
\end{document}
答案1
您可以使用 etoolbox 包来修改第一个 \bibitem 的行为并发出指令 \thispagestyle。
\usepackage{etoolbox}
\newbool{firstbib}
\booltrue{firstbib}
\preto{\bibitem}{\ifbool{firstbib}{\thispagestyle{fancy}\setbool{firstbib}{false}}{}}
修改TEX文件结尾
\end{flushleft}
\nocite{•}
\bibliographystyle{plain}
\cleardoublepage
\phantomsection
\newbool{firstbib}
\booltrue{firstbib}
\preto{\bibitem}{\ifbool{firstbib}{\thispagestyle{axionstyle}\setbool{firstbib}{false}}{}}
\bibliography{RiemannTEX}
\pagestyle{axionstyle}
\end{document}