I would like to add \linewidth-sized lines above and below my chapter titles (similar to borders above/below the 'paragraph' in MS Word)
I tried the following, which somewhat approximates the desired look (not perfect, and I don't really understand the \kern-.75\ht\strutbox stuff:
\documentclass[
draft,
parskip=full,
]{scrreprt}
\makeatletter
\renewcommand{\chapterlinesformat}[3]{%
\parbox[t]{\linewidth}{%
\raggedchapter%
\noindent\rule{\linewidth}{.6pt}%
\par\@hangfrom{#2}{#3}%
\par\kern-.75\ht\strutbox\rule{\linewidth}{.6pt}%
}%
}
\makeatother
\begin{document}
\chapter{test}
\end{document}
However, this causes overfull hboxes on every chapter title (and makes it difficult to see if I have actual overfull hboxes), even though the lines do not extend past the width of the text area.
I also tried the solution in KOMA-Script line above and below chapter title (lowermost part of the accepted answer), however the lines are very far from the text and the overfull hbox issue persists (if only on the lower rule).


parskipbeingfull. What I guess komascript is doing is adding a rule or something at the end of each paragraph to make sure it has at least one em left at the end (though I haven't checked). If you add\parafter yourparboxthe overfull line is solved (but the spacing is off). I'd be inclined just to live with it: the output (once draft mode is off) is fine. – Paul Stanley Dec 19 '18 at 17:48\parshifts the entire thing. – Joe Dec 20 '18 at 07:55