XinzeZhang / HUST-PhD-Thesis-Latex

华中科技大学博士毕业论文Latex模板
133 stars 31 forks source link

最终提交版本如何变成红头文件 #7

Open RainerTian opened 1 year ago

RainerTian commented 1 year ago

您好,最后学院上会需要红头文件,请问这个页眉、页眉下面的俩条横线和页脚上面的横线如何变成红色的?如何在代码里更改

XinzeZhang commented 1 year ago

您好,最后学院上会需要红头文件,请问这个页眉、页眉下面的俩条横线和页脚上面的横线如何变成红色的?如何在代码里更改

在cls文件的页眉页眉处,对学校名,顶部hrule和底部footrule加上颜色标记即可。

例如:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 定义页眉页脚,参考 fancyhdr 宏包的代码
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%改动4

\newcommand{\headrulewidth}{1pt}
\newcommand{\footrulewidth}{0.5pt}
\def\ps@plain{%
  \ifHUST@finalformat
    \def\@oddhead{}
  \else
    \def\@oddhead{%
      \vbox{%
        \parbox[b]{\textwidth}{\centering\sihao%
          \ziju{0.81em} \kai \bfseries \sanhao[1] \textcolor[RGB]{212,14,14}{\HUST@schoolename\HUST@apply}}
        \vskip6pt
        \hspace{-4mm} \vbox{\hspace{-3mm} \textcolor[RGB]{212,14,14}{\hrule width 1.04\textwidth height\headrulewidth depth0pt\vskip1pt \hrule width 1.04\textwidth height\headrulewidth}}}}\fi%
    \let\@evenhead=\@oddhead
  \ifHUST@finalformat
   \def\@oddfoot{%
     \hbox to\textwidth{%
      \vbox{%
      \hfill \parbox[t]{\textwidth}{\centering\wuhao\thepage\strut}\hfill
      }}}
   \else
   \def\footrule{{\vskip-0.3\normalbaselineskip\vskip-\footrulewidth
   \hrule\@width 1.04\textwidth\@height\footrulewidth\vskip0.45\normalbaselineskip}}
   \def\@oddfoot{%
     \hbox to \textwidth{%
     \hspace{-4mm}\vbox{%
     \textcolor[RGB]{212,14,14}
      \footrule
      \hfill \hspace{-4mm} \parbox[t]{\textwidth}{\hspace{10mm}\centering\wuhao\thepage\strut} \vspace{3mm}\hfill
      }}}
   \fi
  \let\@evenfoot=\@oddfoot}
\pagestyle{plain}
\renewcommand{\chaptermark}[1]{\markboth{\@chapapp \ ~~#1}{}}
RainerTian commented 1 year ago

实现了,感谢感谢