页脚隐藏页码

页脚隐藏页码

我正在为我的工作团队编写手册,这里我遇到了一些麻烦,我想在每页的底部添加一条彩色线,因此我对颜色进行了定义,然后在页脚中使用它,看起来不错,但问题是它会删除页码 !!!

请帮我保留行号和页码,谢谢

\documentclass [14pt]  {extarticle}
\usepackage[margin=0.7in]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{array}
\usepackage{wrapfig}
\usepackage{float}
\usepackage {multirow}
\usepackage{hyperref}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{geometry}
\usepackage[font=small]{caption}
\usepackage{gensymb}
\usepackage{pgffor}
\usepackage{xparse}
\usepackage{fancybox}
\usepackage{afterpage}
\usepackage{titlesec}
\setlength{\parindent}{0cm}
\usepackage[titles]{tocloft}
\renewcommand{\cftdot}{}
\usepackage{fancyhdr}
\pagestyle{fancy}

%____________________________________________________________
\fancyhead{} % clear all header fields
\renewcommand{\headrulewidth}{0pt} % no line in header area
%\fancyfoot[C]{\thepage} 
\fancyfoot[C]{\color{cadetblue}\noindent\makebox[\linewidth]{\rule{\paperwidth}{30pt}}}  
%____________________________________________________________

\definecolor{cadetblue}{rgb}{0.37, 0.62, 0.63}

\begin{document}
\begin{titlepage}

%LOGO
\noindent
\begin{minipage}[b]{0.3\textwidth}    
\includegraphics[width=\linewidth]{1}
\end{minipage}
\hfill
\begin{minipage}[t]{0.3\textwidth}
\includegraphics[width=\linewidth]{2}
\end{minipage}

\begin{center}
\vfill
{\textbf{\myfont TITLE }}}\\  

\vfill
\end{center}

\begin{flushleft}
AAAAAA Co.\\
SSSSSSSSSS Department\\
\vspace{3mm} 
Created by :\\ 
FFFFFFFF\\
\vspace{3mm}  
Reviewed by :\\ 
AAAAAAA \\
\end{flushleft}

{\color{cadetblue}\noindent\makebox[\linewidth]{\rule{\paperwidth}{18pt}}}
\end{titlepage}
% ----------------------------------------------------------------

\cleardoublepage
\pagenumbering{gobble}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}

\setcounter{page}{1}
\pagenumbering{arabic}

\section{\uppercase {Introduction}}

答案1

基本上,您需要通过重叠两个 s 将行号和页码放在同一个页脚中\makebox{\textwidth]

我稍微最小化了你的 MWE。另外,我不明白为什么\rule会出现在基线下,但它确实不需要增加它。

\documentclass [14pt]  {extarticle}
\usepackage[margin=0.7in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{xcolor}

\usepackage{lipsum}% NWE only

%____________________________________________________________
\fancyhead{} % clear all header fields
\renewcommand{\headrulewidth}{0pt} % no line in header area
%\fancyfoot[C]{\thepage} 
\fancyfoot[C]{\rlap{\makebox[\textwidth]{\thepage}}%
\makebox[\textwidth]{\color{cadetblue}\rule{\paperwidth}{\dimexpr 0.7in-\footskip}}}
%____________________________________________________________

\definecolor{cadetblue}{rgb}{0.37, 0.62, 0.63}

\begin{document}

\lipsum[1-8]

\end{document}

相关内容