我希望将 fancyhdr 页脚行的外观更改为如下形式:
\usepackage{xcolor}
\newcommand\shadowfill{%
\leavevmode\leaders\hbox{\ooalign{%
\vrule height 4pt depth 0pt width 1pt\cr%
\textcolor{gray}{\vrule height 1pt depth 1pt width 1pt}}%
}\hskip\fill\kern0pt%
}
我试过了
\renewcommand{\footrule}{\shadowfill}
但最后我还是没有得到任何线索。
不确定我是否以正确的方式处理此事。
编辑:
目前看起来像这样
但我想用这条线代替实线
答案1
标题
\documentclass{article}
\usepackage{lipsum}% just to generate filler text for the example
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{Left}
\fancyhead[R]{Right}
\fancyhead[C]{Center}
\renewcommand\headrule{\vskip-0.7\baselineskip\makebox[\textwidth]{\shadowfill}}
\newcommand\shadowfill{%
\leavevmode\leaders\hbox{\ooalign{%
\vrule height 1pt depth 0pt width 1pt\cr%
\textcolor{red}{\vrule height 0pt depth 1pt width 1pt}}%
}\hskip\fill\kern0pt%
}
\usepackage{xcolor}
\begin{document}
\section{Test Section}
\subsection{Test Subsection}
\lipsum[1-20]
\end{document}
页脚
\documentclass{article}
\usepackage{lipsum}% just to generate filler text for the example
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[L]{Left}
\fancyfoot[R]{Right}
\fancyfoot[C]{Center}
\renewcommand\footrule{\makebox[\textwidth]{\shadowfill}\\[-.2\baselineskip]}
\newcommand\shadowfill{%
\leavevmode\leaders\hbox{\ooalign{%
\vrule height 1pt depth 0pt width 1pt\cr%
\textcolor{red}{\vrule height 0pt depth 1pt width 1pt}}%
}\hskip\fill\kern0pt%
}
\usepackage{xcolor}
\begin{document}
\section{Test Section}
\subsection{Test Subsection}
\lipsum[1-20]
\end{document}