2

It is some possibility, how to make different color line odd and even pages in footer? I want to make mirror footer on book pages.

Code what i use:

\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}

That's how it looks: footer style

ant this is what i want:

new footer style

1

1 Answer 1

1

You can differentiate between even and add pages with \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}

enter image description here

1
  • Thx, this is exactly what i looking for.
    – Martin
    Dec 10, 2018 at 10:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .