![每页页数(共 ## 页)](https://linux22.com/image/340460/%E6%AF%8F%E9%A1%B5%E9%A1%B5%E6%95%B0%EF%BC%88%E5%85%B1%20%23%23%20%E9%A1%B5%EF%BC%89.png)
我正在编写我的课程
\documentclass[11pt]{scrartcl}
\usepackage[english]{babel}
\usepackage{currvita}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{makecell}
\usepackage{lastpage}
\usepackage{hyperref}
\tolerance=600
\setlength{\textheight}{235mm}
\raggedright
\begin{document}
\setlength{\cvlabelwidth}{40mm}
\sffamily
\pagestyle{fancy}
\lhead[\sffamily Curriculum Vitae]{\sffamily Curriculum Vitae}
\rhead[\sffamily Name]{\sffamily Name}
\thispagestyle{empty}
\cfoot{\thepage\ of \pageref{LastPage}}
\date{}
\end{document}
除了第一页以外,我每页的页码都正确,第一页没有页码。如果我删除,\thispagestyle{empty}
我也会在第一页上获得页码,但我也会获得页眉
\lhead[\sffamily Curriculum Vitae]{\sffamily Curriculum Vitae}
\rhead[\sffamily Name]{\sffamily Name}
我不希望它出现在第一页。您知道我怎样才能在第一页上放置编号而不删除吗\thispagestyle{empty}
?
答案1
firstpage
创建与常规页面样式不同的单独页面样式fancy
:
\documentclass{article}
\usepackage{fancyhdr,lastpage,lipsum}
\usepackage{hyperref}
\pagestyle{fancy}% The default page style
\fancyhf{}% Clear header/footer
\lhead[\sffamily Curriculum Vitae]{\sffamily Curriculum Vitae}
\rhead[\sffamily Name]{\sffamily Name}
\cfoot{\thepage\ of \pageref*{LastPage}}
\renewcommand{\headrulewidth}{0pt}% No header rule
\fancypagestyle{firstpage}{
\fancyhf{}% Clear header/footer
\cfoot{\thepage\ of \pageref*{LastPage}}
\renewcommand{\headrulewidth}{0pt}% No header rule
}
\begin{document}
\thispagestyle{firstpage}% Only this page should have the firstpage style
% All other pages will have fancy
\lipsum
\end{document}