I am working on a twosided article layout where the footnotes are enclosed by two \textwidth
lines above and below and on pages without a footnote a single h-line is spanning across \textwidth
at the bottom of the text-body. But the footer itself should span across \textwidth
plus \marginparwidth
I tried the fancyhdr to create a line at the border between footer and text-body, but on even pages the footrule hangs on the wrong side:
It should look like on odd pages:
Here is a MWE:
\documentclass[a4paper,12pt,
twoside,%
]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{%
inner=2cm,
outer=4cm,
top=2.5cm,
bottom=2.5cm,
marginparwidth=3cm,
}
\setlength\parindent{0pt}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[EL,OR]{\textbf{\thepage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.5pt}
\addtolength{\headwidth}{\marginparwidth}
\renewcommand\footrule{\hrule width\textwidth}
\fancypagestyle{plain}{}
\usepackage[%
hang,%
%marginal,%
bottom%
]{footmisc}
\setlength{\footnotemargin}{0.5cm} %Abstand zwischen textkörper und FN bei hang-option
%\setlength{\footnotesep}{0.35cm} %Abstand zwischen FN
\setlength{\skip\footins}{0,5cm} %Abstand zwischen FN-Nummer und FN-Text
\renewcommand{\footnoterule}{\rule{\textwidth}{0.5pt}{\vspace*{2mm}}}
\usepackage{blindtext}
\begin{document}
\blindtext[3]\footnote{text}
\blindtext[3]\footnote{text}
\blindtext[4]
\end{document}
The important part oft the layout is the horizontal rule at the bottom of the text-body, on pages with and without footnotes.
I guess some more professional TeX-users can offer a solution.
Edit:
If someone has another solution without fancyhdr, I'm also happy. As long as it looks like the second picture and offers a footer spanning through textwidth and marginparwidth (where the pagenumber is displayed).
2. Edit:
Unfortunatley, the test pages which i got to style the Latex layout had footnotes on every page. But the layout expects a single hrule at the bottom of the text-body also on pages without a footnote. Therefore, @cabohah's great solution doesn't fit my needs, because the lower rule only appears if a footnote-command is called. Sorry for the confusion. Is there a possibility to place a hrule
on the bottom of the text-body of every page, notwithstanding if there is a footnote or not? Also updated the initial question above with this requirement.
Thanks and best!
Best Answer
Instead of trying to add the rule below the footnotes to the page footer, you could patch the output of the footnotes:
Here a similar solution, for those who do not use
footmisc
:EDIT because of change of question to a completely different one
If you are just asking for a separation line above the page footer, that should only span the width of the text area, despite the page number should be aligned at the outer edge of the
\marginpar
column, the simplest solution would be to use packagescrlayer-scrpage
. It provides not only to set the line length independent from the footer width, but also to align all separation lines either centered, inner aligned or outer aligned. SoIs enough to get:
If you want a bold page number, you can use
\addtokomafont{pagefoot}{\bfseries}
.If you cannot use
scrlayer-scrpage
for some reason, not expanding the\headwidth
but move the pagination into the outer margin would be a suggestion without redefining\footrule
: