1

I am absolutely new to latex so please dont bite my head off if this question is not.

Problem

I am trying to change my \chapter style in a koma-script report in Lyx, meaning that i want to change the font size and the spacing before and after title.

What I tried

I tried this using the titlesec package as follows:

\usepackage{titlesec}   
\titleformat {\chapter}[display]{\thechapter\bfseries\LARGE}{}{0 pt}{\vspace{-45 mm}}[\vspace{-10mm}]

This works fine apart from two problems, the specifications of LARGE, Huge etc. are not exactly accurat and my second problem, which is the bigger part, I loose the number as chapter label.

So I tried the following:

\titleformat {\chapter}[display]{\thechapter\bfseries\LARGE}{\thechapter}{0 pt}{\vspace{-45 mm}}[\vspace{-10mm}]

Which gives my chapter labels back, but moves them into a random position and does not align them in front of my actual chapter title anymore.

Thanks for any advice how to fix this!

Edit

Thanks to the comments I am not trying to use titlesec anymore but I am trying to change font size, afterskip and beforeskip as follows:

\RedeclareSectionCommand[beforeskip=10pt,afterskip=10pt,font={\setkomafont\helvet {20pt}}]{\chapter}

Which gives me the error:

Uncontrolled control sequence. Could anyone tell me how I write this correctly ?

7
  • 2
    It would be best if you avoid titlesec.
    – Johannes_B
    Jul 19 '16 at 10:26
  • well I am open for any advice what else to use, or how to do it :)
    – KiW
    Jul 19 '16 at 10:32
  • 2
    Please read about RedeclareSectionCommand in the KOMA-manual.
    – Johannes_B
    Jul 19 '16 at 10:34
  • 1
    I do not understand what the desired result is. But may be you want to use \RedeclareSectionCommand[beforeskip=10pt,afterskip=10pt,font=\fontsize{20}{24}\selectfont]{chapter}
    – esdd
    Jul 19 '16 at 11:54
  • @esdd I bet you have a good candidate as a duplicate at hand?
    – Johannes_B
    Jul 19 '16 at 12:28
2

Do not use package titlesec together with a KOMA-Script class. Each of the classes scrartcl, scrreprt and scrbook provide \RedeclareSectionCommand to change the skips before and after sectioning titles or the font settings for the titles and someother settings for the titles.

Example:

\RedeclareSectionCommand[
  beforeskip=-10pt,
  afterskip=10pt,
  font=\fontsize{20}{24}\‌​selectfont
]{chapter}

Note that beforeskip=-10pt results in a vertical skip of 10pt. The - ensures that the first paragraph after the sectionning command is not indented.

The settings for the font option of \RedeclareSectionCommand have the same effect as if the would be used as argument of \setkomafont: all previous settings for the font element are removed. So

\RedeclareSectionCommand[font=\mdseries]{chapter}

does the same as

\setkomafont{chapter}{\mdseries}

To add only some settings without removing of the old font features, you can use \addtokomafont.

0

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.