Skip to content

Commit

Permalink
Refine the header settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
weijianwen committed Jan 8, 2016
1 parent 1eaf526 commit 01e91d9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 46 deletions.
93 changes: 49 additions & 44 deletions sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
\RequirePackage{xcolor}
\RequirePackage{wasysym}
\RequirePackage{listings}
\RequirePackage[xetex, bookmarksnumbered, colorlinks, linkcolor=blue, citecolor=blue, plainpages=false, pdfstartview=FitH]{hyperref}
\RequirePackage[xetex, bookmarksnumbered, colorlinks, urlcolor=black, linkcolor=black, citecolor=black, plainpages=false, pdfstartview=FitH]{hyperref}
\RequirePackage{longtable}
\RequirePackage[perpage, bottom]{footmisc}
\RequirePackage{enumitem}
Expand Down Expand Up @@ -378,53 +378,58 @@
\cleardoublepage
}

% 根据学位论文类型、单双面打印设置页眉页脚类型
\pagestyle{fancy}
\fancyhf{}

% fancyhdr页眉页脚设置
\ifsjtu@bachelor
% 本科学位论文正文页眉页脚,只处理单面打印的情况
\fancyhead[L]{\includegraphics[width=0.22\textwidth]{figure/sjtubanner}}
\fancyhead[R]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small 第~{\bfseries\thepage}~页\,共~{\bfseries\pageref{LastPage}}~页}
\fancypagestyle{plain}{% 设置开章页页眉页脚风格(只有页码作为页脚)
\fancyhf{}%
\fancyhead[L]{\nouppercase{\small\kaishu\includegraphics[width=0.22\textwidth]{figure/sjtubanner}}}
\fancyhead[R]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small 第~{\bf\thepage}~页\,共~{\bf\pageref{LastPage}}~页}
}
% 本科学位论文页眉页脚设置
%% 正文页眉页脚
\fancypagestyle{main}{
\fancyhf{}
\fancyhead[L]{\includegraphics[width=0.22\textwidth]{figure/sjtubanner}}
\fancyhead[R]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small 第~{\bfseries\thepage}~页\,共~{\bfseries\pageref{LastPage}}~页}
}
%% 开章页页眉页脚
\fancypagestyle{plain}{% 设置开章页页眉页脚风格(只有页码作为页脚)
\fancyhf{}%
\fancyhead[L]{\nouppercase{\small\kaishu\includegraphics[width=0.22\textwidth]{figure/sjtubanner}}}
\fancyhead[R]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small 第~{\bf\thepage}~页\,共~{\bf\pageref{LastPage}}~页}
}
\else
% opnright 研究生学位论文正文页眉页脚设置
\if@openright
\fancyhead[LO, RE]{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}
\fancyhead[RO]{\nouppercase{\small\kaishu\leftmark}}
\fancyhead[LE]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bfseries\thepage}~---}
% openright 开章页页眉页脚
\fancypagestyle{plain} {
\fancyhf{}
\fancyhead[LO,RE]{\nouppercase{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}}
\fancyhead[RO]{\nouppercase{\small\kaishu\leftmark}}
\fancyhead[LE]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
}
\else
% openany 研究生学位论文正文页眉页脚设置
\fancyhead[L]{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}}
\fancyhead[R]{\nouppercase{\small\kaishu\leftmark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
% openany 开章页页眉页脚
\fancypagestyle{plain} {
\fancyhf{}
\fancyhead[L]{\nouppercase{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}}
\fancyhead[R]{\nouppercase\small\kaishu\leftmark}}
% \fancyhead[L]{\small {\it\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
}
\fi
% 研究生学位论文页眉页脚设置
\if@twoside
%% 正文页眉页脚
\fancypagestyle{main}{
\fancyhead[LO, RE]{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}
\fancyhead[RO]{\nouppercase{\small\kaishu\leftmark}}
\fancyhead[LE]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bfseries\thepage}~---}
}
%% 开章页页眉页脚
\fancypagestyle{plain}{
\fancyhf{}
\fancyhead[LO,RE]{\nouppercase{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}}
\fancyhead[RO]{\nouppercase{\small\kaishu\leftmark}}
\fancyhead[LE]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
}
\else
%% 正文页
\fancypagestyle{main}{
\fancyhead[L]{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}}
\fancyhead[R]{\nouppercase{\small\kaishu\leftmark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
}
\fancypagestyle{plain}{
\fancyhf{}
\fancyhead[L]{\nouppercase{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}}
\fancyhead[R]{\nouppercase\small\kaishu\leftmark}}
% \fancyhead[L]{\small {\it\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
}
\fi
\fi


% 中英文摘要
\newenvironment{abstract}{\chapter*{\sjtu@value@title\vskip 20pt\sjtu@label@abstract}\markboth{\sjtu@label@abstract}{}}{}
\newcommand\keywords[1]{\vspace{2ex}\noindent{\bf\large \sjtu@label@keywords} #1}
Expand Down
7 changes: 5 additions & 2 deletions thesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
%%==================================================

% 双面打印
\documentclass[doctor, adobefonts, openright, cs4size]{sjtuthesis}
\documentclass[doctor, adobefonts, openright, twoside, cs4size]{sjtuthesis}
% \documentclass[bachelor, adobefonts, openany, oneside, cs4size, submit]{sjtuthesis}
% \documentclass[master, adobefonts, review]{sjtuthesis}
% \documentclass[%
% bachelor|master|doctor, % 必选项
% adobefonts|winfonts, % 只测试了adobefonts,请使用adobefonts
% openany|openright, % 单面打印,双面打印(默认)
% oneside|twoside, % 单面打印,双面打印(奇偶页交换页边距,默认)
% openany|openright, % 可以在奇数或者偶数页开新章|只在奇数页开新章(默认)
% cs4size|c5size, % 正文字号:小四、五号(默认)
% review, % 盲审论文,隐去作者姓名、学号、导师姓名、致谢、发表论文和参与的项目
% submit % 定稿提交的论文,插入签名扫描版的原创性声明、授权声明
Expand Down Expand Up @@ -43,6 +44,7 @@
\frontmatter % 使用罗马数字对前言编号

%% 摘要
\pagestyle{main}
\include{tex/abstract}

%% 目录、插图目录、表格目录
Expand All @@ -57,6 +59,7 @@
\mainmatter % 使用阿拉伯数字对正文编号

%% 正文内容
\pagestyle{main}
\include{tex/chapter01}
\include{tex/chapter02}
\include{tex/chapter03}
Expand Down

0 comments on commit 01e91d9

Please sign in to comment.