574. LaTeX技巧83:fancyhdr页眉页脚设计史上最全代码

您所在的位置:网站首页 页眉页脚的宽度怎么设置 574. LaTeX技巧83:fancyhdr页眉页脚设计史上最全代码

574. LaTeX技巧83:fancyhdr页眉页脚设计史上最全代码

2024-07-09 19:14| 来源: 网络整理| 查看: 265

代码如下:

\documentclass{ctexart}\setcounter{page}{6}\setlength\textheight{100.0pt}\setlength\textwidth{200.0pt}\usepackage{fancyhdr}\usepackage{lastpage}\usepackage{layout}%\pagestyle{empty}%不设置页眉页脚\footskip = 10pt\pagestyle{fancy}% 设置页眉\lhead{page \thepage\ of \pageref{LastPage}}\chead{页眉中间}\rhead{\small\leftmark}\cfoot{\thepage}\rfoot{页脚左}%\lfoot{页脚右}\renewcommand{\headrulewidth}{1pt}%页眉线宽,设为0可以去页眉线\setlength{\skip\footins}{0.5cm}%脚注与正文的距离\renewcommand{\footnotesize}{}%设置脚注字体大小\renewcommand{\footrulewidth}{1pt}%脚注线的宽度%===============%双线页眉的设置% \makeatletter %双线页眉% \def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi%% \hrule\@height 1.0pt \@width\headwidth\vskip1pt%上面线为1pt粗% \hrule\@height 0.5pt\@width\headwidth%下面0.5pt粗% \vskip-2\headrulewidth\vskip-1pt}%两条线的距离1pt% \vspace{6mm}}%双线与下面正文之间的垂直间距% \makeatother%===============% \pagestyle{fancy}% \fancyhead{} %clear all fields% \fancyhead[CE]{ \应\用 \数 \学 }% \fancyhead[CO]{{ huangzh: 数学}}% \fancyhead[RO]{\thepage} %奇数页眉的右边% \fancyhead[LE]{\thepage} %偶数页眉的左边% \fancyhead[RE]{\zihao{-5} 2005 c}% \fancyfoot[C]{} %================================================================%**\setcounter{tocdepth}{3}\begin{document}\section{第一节}1、1子曰:“学而时习之,不亦说乎?有朋自远方来,不亦乐乎?人不知而不愠,不亦君子乎?”1、2有子曰:“其为人也孝弟,而好犯上者,鲜矣;不好犯上,而好作乱者,未之有也。君子务本,本立而道生。孝弟也者,其为仁之本与!”\section{第二节}1、3子曰:“巧言令色,鲜矣仁!”1、4曾子曰:“吾日三省吾身:为人谋而不忠乎?与朋友交而不信乎?传不习乎?”\end{document}

效果图一:

双线页眉的设置



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3