I am using KOMA-Script report class scrreprt:

I am trying to change the beforeakip and afterskip of my Section titles:


This is what I do which comes up with the following error:

Missing \endcsname insertred. (3 times)

If I leave out the lines for \section and \subsection it works perfectly fine.

Hence the question: Why does the same command not work for subsection and section ? And what do I have to change in order for it to work?

The full LaTeX code

\documentclass[11pt,twoside,english,openright, bibliography=totoc]{scrreprt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[colorlinks=true, urlcolor=blue, linkcolor=black,  citecolor=black]{hyperref} 
\usepackage[automark, headsepline, footsepline, plainfootsepline]{scrlayer-scrpage}


\usepackage {blindtext} %creates blindtext


\chapter{This is a Chapter}
\section{This is a Section}
\subsection{This is a Sub-section}
\subsubsection*{This is sub-sub-section}


Error line 57 !missing\endcsname inserted. \numexpr\end(document)

Warnining line 1 The marginal notes overrun the paper

closed as off-topic by Mensch, Zarko, Torbjørn T., Werner, ebosi Feb 6 '17 at 14:28

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Make a complete example instead of showing only snippets and show the log-file. – Ulrike Fischer Jul 20 '16 at 15:02
  • Please check my edit... the error is the output I get out of lyx. The hole log would be a bit long I assume – KiW Jul 20 '16 at 15:07
  • 1
    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document} – Runar Jul 20 '16 at 15:57
  • 2
    Lyx can export your code, so you have a latex example. You will have to produce a full example and show the log. I expanded your snippet to a small document and it compiles without error. Also be aware that it was your choice to use lyx. If this now makes it more difficult and time consuming to get support, this your problem and not mine. – Ulrike Fischer Jul 20 '16 at 17:22
  • 4
    I'm voting to close this question as off-topic because it was solved by comments. – Mensch Feb 6 '17 at 13:37