我尝试给整个页眉和页脚加下划线,但做不到。您能提示一下这是怎么做的吗?
\documentclass[10.5pt,a4paper,oldfontcommands]{memoir}
\usepackage[polutonikogreek, latin, english, french, ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage[dvips]{graphicx}
\usepackage{times}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{latexsym}
\usepackage{stmaryrd}
\usepackage{enumerate}
\usepackage{nicefrac}
\usepackage[all]{xy}
\usepackage{tabularx}
\usepackage{pst-plot,pstricks}
\usepackage{varwidth}
\usepackage{thmtools}
\usepackage{enumitem}
\usepackage{geometry}
\usepackage{float}
\usepackage{siunitx}
\usepackage{natbib}
\usepackage{graphicx,xcolor}
\usepackage{epstopdf}
\usepackage{pdfpages}
\usepackage{epsfig}
\usepackage{filecontents}
\usepackage{transparent}
\graphicspath{{img/}}
\usepackage{pgfplots}
\def\FunctionF(#1){(#1)^3- 3*(#1)}%
\usepackage{url}
\renewcommand{\listfigurename}{Abbildungen}
\floatstyle{boxed}
\restylefloat{figure}
\usepackage[breaklinks=true,colorlinks=true, linkcolor=black,urlcolor=black,citecolor=black, bookmarks=true,bookmarksopenlevel=2]{hyperref}
\usepackage{geometry}
\geometry{total={210mm,297mm},
left=20mm,right=20mm,
bindingoffset=10mm, top=20mm,bottom=20mm}
\OnehalfSpacing
%%% CHAPTER'S STYLE
\chapterstyle{lyhne}
%%% STYLE OF SECTIONS, SUBSECTIONS, AND SUBSUBSECTIONS
\setsecheadstyle{\Large\bfseries\sffamily\raggedright}
\setsubsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsubsecheadstyle{\bfseries\sffamily\raggedright}
\newcommand{\insertunderline}{\rule[-.3\baselineskip]{\linewidth}{.4pt}}
%%% STYLE OF PAGES NUMBERING
\makepagestyle{mypagestyle}
\makeevenfoot{mypagestyle}{November 2016}{\insertunderline}{\thepage}
\makeoddfoot{mypagestyle}{November 2016}{\insertunderline}{\thepage}
\makeevenhead{mypagestyle}{Schweizer Jugend Forscht}{\insertunderline}{Potz Blitz - Gewitter in Theorie und Praxis }
\makeoddhead{mypagestyle}{Schweizer Jugend Forscht}{\insertunderline}{Potz Blitz - Gewitter in Theorie und Praxis}
\pagestyle{mypagestyle}
\begin{document}
Hello
\clearpage
Hello
\end{document}
答案1
使用中心页眉/页脚插入水平线可能更容易:
\documentclass{memoir}
\newcommand{\insertunderline}{\rule[-.3\baselineskip]{\linewidth}{.4pt}}
\newcommand{\insertoverline}{\rule[.8\baselineskip]{\linewidth}{.4pt}}
%%% STYLE OF PAGES NUMBERING
\makepagestyle{mypagestyle}
\makeevenfoot{mypagestyle}{November 2016}{\insertoverline}{\thepage}
\makeoddfoot{mypagestyle}{November 2016}{\insertoverline}{\thepage}
\makeevenhead{mypagestyle}{Schweizer Jugend Forscht}{\insertunderline}{Potz Blitz - Gewitter in Theorie und Praxis}
\makeoddhead{mypagestyle}{Schweizer Jugend Forscht}{\insertunderline}{Potz Blitz - Gewitter in Theorie und Praxis}
\pagestyle{mypagestyle}
\begin{document}
Lorem ipsum
\end{document}
但是,在页眉/页脚下方/上方插入规则最好使用
\makeheadrule{<style>}{<width>}{<thickness>}
\makefootrule{<style>}{<width>}{<thickness>}{<skip>}
考虑到上述示例,您可以使用以下命令:
%%% STYLE OF PAGES NUMBERING
\makepagestyle{mypagestyle}
\makeevenfoot{mypagestyle}{November 2016}{}{\thepage}
\makeoddfoot{mypagestyle}{November 2016}{}{\thepage}
% Use these if you want the chapter page style to match mypagestyle
\makeevenhead{mypagestyle}{Schweizer Jugend Forscht}{}{Potz Blitz - Gewitter in Theorie und Praxis}
\makeoddhead{mypagestyle}{Schweizer Jugend Forscht}{}{Potz Blitz - Gewitter in Theorie und Praxis}
\makeheadrule{mypagestyle}{\textwidth}{\normalrulethickness}
\makefootrule{mypagestyle}{\textwidth}{\normalrulethickness}{\footruleskip}
还有一件事要记住memoir
chapter
对每个 都使用页面样式\chapter
。您可能还需要更改chapter
页面样式:
\documentclass{memoir}
%%% STYLE OF PAGES NUMBERING
\makepagestyle{mypagestyle}
\makeevenfoot{mypagestyle}{November 2016}{}{\thepage}
\makeoddfoot{mypagestyle}{November 2016}{}{\thepage}
% Use these if you want the chapter page style to match mypagestyle
\copypagestyle{chapter}{plain}
\makeoddfoot{chapter}{November 2016}{}{\thepage}
\makeevenhead{mypagestyle}{Schweizer Jugend Forscht}{}{Potz Blitz - Gewitter in Theorie und Praxis}
\makeoddhead{mypagestyle}{Schweizer Jugend Forscht}{}{Potz Blitz - Gewitter in Theorie und Praxis}
\makeheadrule{mypagestyle}{\textwidth}{\normalrulethickness}
\makefootrule{mypagestyle}{\textwidth}{\normalrulethickness}{\footruleskip}
\makefootrule{chapter}{\textwidth}{\normalrulethickness}{\footruleskip}
\pagestyle{mypagestyle}
\begin{document}
\chapter{A chapter}
Lorem ipsum
\clearpage
Lorem ipsum
\end{document}