我现在正在从切换fancyhdr
到scrpage2
,几乎所有东西都运行正常。只有一个问题。我必须构建的页脚非常大,应该将其与文本分开的线穿过页脚而不是位于页脚上方。另一方面,无论页眉有多大,页眉分隔线都可以正常工作。我发现让线条位于页脚上方的唯一方法是在几何包中设置选项,但我认为这不应该是这样做的方法,而且它不太舒服,甚至不好看。
\documentclass[oneside]{scrartcl}
\usepackage[headsepline]{scrpage2}
\usepackage{lipsum}
\setlength{\headheight}{18ex}
\automark{section}
\defpagestyle{mystyle}{ %
{} %
{} %
{\parbox{5cm}{logo \\ \medskip \hspace{0.15cm} www.awwwwr.com} \hfill \parbox{5cm} {\raggedleft Pages \\
Autor: \\
Date: \\
Bla \\
Date: \\
Date: \\
Date: \\}}
}
{%
(\linewidth,1pt)
{}
{}
{\scriptsize
\begin{tabular}{l}
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
\hfill
\begin{tabular}{r}
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
}
}
\pagestyle{mystyle}
\begin{document}
\section{bla}
\lipsum
\end{document}
有人能告诉我如何使用这个软件包来很好地解决这个问题scrpage2
吗?或者没有其他选择吗?
答案1
有变化的两行标记为 % PS。仅更正了表格的位置。
\documentclass[oneside]{scrartcl}
\usepackage[headsepline]{scrpage2}
\usepackage{lipsum}
\setlength{\headheight}{18ex}
\automark{section}
\defpagestyle{mystyle}{ %
{} %
{} %
{\parbox{5cm}{logo \\ \medskip \hspace{0.15cm} www.awwwwr.com} \hfill \parbox{5cm} {\raggedleft Pages \\
Autor: \\
Date: \\
Bla \\
Date: \\
Date: \\
Date: \\}}
}
{%
(\linewidth,1pt)
{}
{}
{\scriptsize
%\begin{tabular}{l}
\begin{tabular}[t]{l} % PS
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
\hfill
%\begin{tabular}{r}
\begin{tabular}[t]{l} % PS
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
}
}
\pagestyle{mystyle}
\begin{document}
\section{bla}
\lipsum
\end{document}
答案2
scrpage2
已过时。自 2013 年起,官方继任者是scrlayer-scrpage
。如果我在您的示例中仅用scrpage2
替换:scrlayer-scrpage
\documentclass[oneside]{scrartcl}
\usepackage[headsepline]{scrlayer-scrpage}
\usepackage{lipsum}
\setlength{\headheight}{18ex}
\automark{section}
\defpagestyle{mystyle}{ %
{} %
{} %
{\parbox{5cm}{logo \\ \medskip \hspace{0.15cm} www.awwwwr.com} \hfill \parbox{5cm} {\raggedleft Pages \\
Autor: \\
Date: \\
Bla \\
Date: \\
Date: \\
Date: \\}}
}
{%
(\linewidth,1pt)
{}
{}
{\scriptsize
\begin{tabular}{l}
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
\hfill
\begin{tabular}{r}
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
}
}
\pagestyle{mystyle}
\begin{document}
\section{bla}
\lipsum
\end{document}
我得到的结果:
但我也收到警告信息:
Package scrlayer-scrpage Warning: \headheight to low. (scrlayer-scrpage) At least 89.08252pt needed, (scrlayer-scrpage) but only 84.86224pt found. (scrlayer-scrpage) I'll enlarge \headheight, for further (scrlayer-scrpage) processing, but you should do this yourself, (scrlayer-scrpage) e.g., setting typearea's option (scrlayer-scrpage) `headheight=89.08252pt'. (scrlayer-scrpage) I'll also decrease \topmargin on input line 45. Package scrlayer-scrpage Warning: \footheight to low. (scrlayer-scrpage) At least 56.99991pt needed, (scrlayer-scrpage) but only 17.0pt found. (scrlayer-scrpage) I'll enlarge \footheight, for further (scrlayer-scrpage) processing, but you should do this yourself, (scrlayer-scrpage) e.g., setting typearea's option (scrlayer-scrpage) `footheight=56.99991pt'. (scrlayer-scrpage) I'll also increase \footskip on input line 45.
因此甚至可能类似于:
\documentclass[oneside,headinclude,footheight=57pt,headheight=89.1pt]{scrartcl}
\usepackage[headsepline]{scrlayer-scrpage}
\usepackage{lipsum}
\automark{section}
\defpagestyle{mystyle}{ %
{} %
{} %
{\parbox{5cm}{logo \\ \medskip \hspace{0.15cm} www.awwwwr.com} \hfill \parbox{5cm} {\raggedleft Pages \\
Autor: \\
Date: \\
Bla \\
Date: \\
Date: \\
Date: \\}}
}
{%
(\linewidth,1pt)
{}
{}
{\scriptsize
\begin{tabular}{l}
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
\hfill
\begin{tabular}{r}
1 \\
2 \\
3 \\
4 \\
5 \\
6
\end{tabular}
}
}
\pagestyle{mystyle}
\begin{document}
\section{bla}
\lipsum
\end{document}
会更好。