In my LaTeX document, I have some sections that contain normal text and other sections that contain text in a box, for which I use the \framed package.

When I try to increase the spacing below my section titles, I get the following problem: Now, the space between the frame box and the section title is larger than it is between normal text and the section title:

Screenshot of the incorrect spacing

This doesn't happen with the default section spacing.

Does anybody know how I get the frames to have the same top margin as normal text?





% ------------------


\section{First section}
Here is text with the correct margin above the text.

\section{Second section}
  Here is framed text with too much space above the frame.  

  • 1
    Note that when you run your MWE you get lots of complaints in the .log file. KOMA complains that you shouldn't use titlesec with KOMA (you should use KOMA's own features). titlesec complains about non-standard sectioning commands. – moewe Dec 16 '16 at 14:52
  • @moewe yeah, this seems to be the problem, I now got it to work with \RedeclareSectionCommand. Thank you! – Baleb Dec 16 '16 at 15:56
  • If you solved your own question, please do not hesitate to post your solution as an answer (and accept it - after a waiting period). – moewe Dec 16 '16 at 15:58

As moewe pointed out, titlesec apparently shouldn't be used with KOMA. I got it to work correctly using the following command instead:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.