0

I am using the code below to change the style of my page numbering. This works quite well. But only for the first two arabic numbered pages. That means page 1 and page 2 are showed correctly. all other pages are missing the blue line as you can see in the pictures.

ToC and ToT and ToP are numbered roman and there the code works without problems.

Any ideas? thanks

\fancypagestyle{plain}{%
    \fancyhf{}
    \fancyfootoffset[OR]{1.85cm}
    \fancyfoot[OR]{%
        {\ }%\tgherosfont%
        {\color{chaptercolor}\rule[-90pt]{0.8mm}{100pt}}%
        \hspace*{10pt}\begin{minipage}[b]{1.5cm}%
            \color{chaptercolor}\normalsize\textbf{\thepage}%
        \end{minipage}%
    }
    \fancyfootoffset[EL]{1.85cm}
    \fancyfoot[EL]{%
        %\tgherosfont%
        \begin{minipage}[b]{1.5cm}%
            \raggedleft\color{chaptercolor}\normalsize\textbf{\thepage}%
        \end{minipage}%
        \hspace*{10pt}{\color{chaptercolor}\rule[-90pt]{0.8mm}{100pt}}%
    }
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}

enter image description here enter image description here

1
  • Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with a \documentclass command, include any necessary packages and be as small as possible to demonstrate your problem. At the moment we have to guess what packages etc you are using before we can compile your code.
    – user30471
    May 17, 2019 at 12:58

1 Answer 1

0

To use the style for all pages and not only for plain:

\documentclass{book}

\usepackage{fancyhdr}
\usepackage{xcolor}
\colorlet{chaptercolor}{blue}

\fancypagestyle{plain}{%
    \fancyhf{}
    \fancyfootoffset[OR]{1.85cm}
    \fancyfoot[OR]{%
        {\ }%\tgherosfont%
        {\color{chaptercolor}\rule[-90pt]{0.8mm}{100pt}}%
        \hspace*{10pt}\begin{minipage}[b]{1.5cm}%
            \color{chaptercolor}\normalsize\textbf{\thepage}%
        \end{minipage}%
    }
    \fancyfootoffset[EL]{1.85cm}
    \fancyfoot[EL]{%
        %\tgherosfont%
        \begin{minipage}[b]{1.5cm}%
            \raggedleft\color{chaptercolor}\normalsize\textbf{\thepage}%
        \end{minipage}%
        \hspace*{10pt}{\color{chaptercolor}\rule[-90pt]{0.8mm}{100pt}}%
    }
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}


\pagestyle{fancy}
\fancyhf{}
\fancyfootoffset[OR]{1.85cm}
\fancyfoot[OR]{%
    {\ }%\tgherosfont%
    {\color{chaptercolor}\rule[-90pt]{0.8mm}{100pt}}%
    \hspace*{10pt}\begin{minipage}[b]{1.5cm}%
        \color{chaptercolor}\normalsize\textbf{\thepage}%
    \end{minipage}%
}
\fancyfootoffset[EL]{1.85cm}
\fancyfoot[EL]{%
    %\tgherosfont%
    \begin{minipage}[b]{1.5cm}%
        \raggedleft\color{chaptercolor}\normalsize\textbf{\thepage}%
    \end{minipage}%
    \hspace*{10pt}{\color{chaptercolor}\rule[-90pt]{0.8mm}{100pt}}%
}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\usepackage{blindtext}

\begin{document}

\tableofcontents

\Blinddocument


\end{document}

enter image description here

(instead of creating this layout yourself, you could also use the cleanthesis package which has such page number per default)

3
  • Works perfectly. Thank you very much! Is there a way to compoine, "fancy and plain" in one "command"? something like that: \pagestyle{fancy, plain}
    – C. Hediger
    May 17, 2019 at 13:10
  • @C.Hediger I don't know if they can be combined
    – user189125
    May 17, 2019 at 13:11
  • ok, no problem :) thanks anyway
    – C. Hediger
    May 17, 2019 at 13:12

You must log in to answer this question.

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