[Tex/LaTex] Add chapter number in roman numbers using fancyhdr

fancyhdr

I am trying to add the chapter number to the footer using fancyhdr. What I would like to do is have the chapter number in roman numbers and the page number in arabic together like so:

VI - 8

This is the code I have right now:

\documentclass[a4paper]{book}
\usepackage{fancyhdr}

\begin{document}
\pagenumbering{Roman}
\clearpage
\pagestyle{fancy}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[LE,RO]{}
\fancyhead[LO,RE]{\slshape \leftmark}
%\tableofcontents

\clearpage
\pagenumbering{arabic}
\input{Chapter_1.tex}
\input{Chapter_2.tex}
\input{Chapter_3.tex}
\input{Chapter_4.tex}
\input{Chapter_5.tex}
\input{Chapter_6.tex}

\end{document}

Could anyone please help me??

THank you in advance!

Best Answer

Simply add

\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}

to your current settings. Since, for consistency's sake this should also apply to the first page of each chapter (in ehich the plain style is used), a redefinition of plain will also be needed:

\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
  \renewcommand{\headrulewidth}{0pt}
}

A complete example:

\documentclass[a4paper]{book}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}

\fancyhf{}
\fancyhead[LE,RO]{}
\fancyhead[LO,RE]{\slshape \leftmark}
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\renewcommand{\headrulewidth}{0pt}

\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
  \renewcommand{\headrulewidth}{0pt}
}

\begin{document}

\chapter{Test chapter one}
\lipsum[1-40]
\chapter{Test chapter two}
\lipsum[1-40]
\chapter{Test chapter three}
\lipsum[1-40]

\end{document}

Some images of some of the footers in different chapters:

enter image description here

enter image description here

Of course, activate these settings from the point in which chaters will be numbered on. Since this applies particularly for the redefinition of plain, you could conditionally make the redefinition of the footer depending on wheter you are on the \mainmatter or not:

\makeatletter
\fancypagestyle{plain}{%
  \fancyhf{}
  \if@mainmatter
    \fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
  \else
    \fancyfoot[C]{\thepage}
  \fi
  \renewcommand{\headrulewidth}{0pt}
}
\makeatother

The code:

\documentclass[a4paper]{book}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}

\fancyhf{}
\fancyhead[LE,RO]{}
\fancyhead[LO,RE]{\slshape \leftmark}
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\renewcommand{\headrulewidth}{0pt}

\makeatletter
\fancypagestyle{plain}{%
  \fancyhf{}
  \if@mainmatter
    \fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
  \else
    \fancyfoot[C]{\thepage}
  \fi
  \renewcommand{\headrulewidth}{0pt}
}
\makeatother

\begin{document}

\frontmatter
\tableofcontents

\mainmatter
\chapter{Test chapter one}
\lipsum[1-40]
\chapter{Test chapter two}
\lipsum[1-40]
\chapter{Test chapter three}
\lipsum[1-40]

\end{document}