这是有可能的,如何在页脚中制作不同颜色的奇数页和偶数页线条?我想在书页上制作镜像页脚。
我使用的代码:
\documentclass[a4paper,12pt,czech]{scrbook}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=3cm,lmargin=2.5cm,rmargin=2cm}
\usepackage[most]{tcolorbox}
\usepackage{array}
\usepackage{color}
\usepackage{fancyhdr}
\newlength\Mylenght
\setlength\Mylenght{12cm}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[LE,RO]{\vspace{-7pt}\thepage}
\fancyfoot[RE,LO]{\vspace{-7pt}some text}
\setlength{\footskip}{45pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{3pt}
\renewcommand{\footrule}{
\hbox to\headwidth{
\color{orange}
\leaders
\hrule
height
\footrulewidth
\hfill
}
\vskip-14.5pt
\hspace{128px}\hbox to\Mylenght{
\color{black}
\leaders
\hrule
height
\footrulewidth
\hfill
}
\vskip10pt
}
}
\pagestyle{plain}
\begin{document}
\end{document}
它看起来是这样的:
这就是我想要的:
答案1
您可以使用以下方式区分偶数页和添加页\ifodd <code for odd pages> \else <code for even pages> \fi
:
\documentclass[a4paper,12pt,czech]{scrbook}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=3cm,lmargin=2.5cm,rmargin=2cm}
\usepackage[most]{tcolorbox}
\usepackage{array}
\usepackage{color}
\usepackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[RE,LO]{some text}
\setlength{\footskip}{45pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{3pt}
\renewcommand{\footrule}{%
\ifodd\thepage
\rule{.7\textwidth}{\footrulewidth}%
{\color{orange}\rule{.3\textwidth}{\footrulewidth}}%
\else%
{\color{orange}\rule{.3\textwidth}{\footrulewidth}}%
\rule{.7\textwidth}{\footrulewidth}%
\fi%
\vskip10pt%
}
}
\pagestyle{plain}
\begin{document}
\mbox{}
\newpage
\mbox{}
\end{document}