0

I am using KOMA's scrreprt together with fancyhdr and want my page numbers on the outside of each page. So I use:

\fancyfoot[LE,RO]{\thepage}

which works as expected. Now, how do I add a short horizontal line (rule) above the page number? The rule should cover about one third of the page width.

user1583209
  • 785
  • 4
  • 12

2 Answers2

1

please see if this suits your requirement -- code edited from -- short vertical line in footer fancyhdr

You can experiment with \hspace{-4cm} for moving the entire line left or right toward the page margins

You can experiment with \rule[10pt]{7cm}{6pt} to change the length height and thickness of the line alone

Disadvantages of using fancyhdr with KOMA are given at the website shortcut provided at top

enter image description here

enter image description here

\documentclass[12pt, a4paper,twoside,footheight=23pt]{scrreprt}
\usepackage{blindtext}% only for dummy text
\usepackage{xcolor}
\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\clearpairofpagestyles
\rofoot*{\vfootline\hspace{-4cm}\pagemark}
\lefoot*{\pagemark\hspace{-4cm}\vfootline}% for twosided document

\newlength\linepagesep \setlength{\linepagesep}{5pt} \newcommand*\vfootline{\textcolor{blue}{\rule[10pt]{7cm}{6pt}}}

\begin{document} \blinddocument \end{document} Other example

js bibra
  • 21,280
1

I would suggest to use package scrlayer-scrpage which is part of the KOMA-Script bundle. Then you can enable the footsepline and adjust its layer:

\documentclass[
  twoside
]{scrreprt}
\usepackage{blindtext}% only for dummy text

\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically \clearpairofpagestyles \ofoot*{\pagemark}

\KOMAoptions{ footsepline=1pt:.3333\paperwidth,% syntax: footsepline=<thickness>:<length> plainfootsepline, olines } \ModifyLayer[ hoffset=0pt, width=\paperwidth, addvoffset=-5pt% move the line up ]{scrheadings.foot.above.line} \RedeclareLayer[ clone=scrheadings.foot.above.line ]{plain.scrheadings.foot.above.line}

\usepackage{xcolor} \addtokomafont{footsepline}{\color{red!50!black}}

\begin{document} \blinddocument \end{document}

enter image description here

esdd
  • 85,675