3

I thought it will be a piece of cake - I started with titlesec, but it ended up with:

Non standard sectioning command detected(titlesec) Using default spacing and no format.

Then I started digging some other topics, but eventually none of them helped me with this problem. I guess the issue lies within the mwrep class which I'm using, but I'm clueless what hack am I supposed to use. I would greatly appreciate any help. Here's the example:

\documentclass[12pt,a4paper]{mwrep}

\usepackage[MeX]{polski}
\usepackage{fontspec}
\usepackage[]{unicode-math}
\setmainfont[Mapping=tex-text]{Times New Roman}
\setmathfont{XITS Math}
\defaultfontfeatures{Ligatures=TeX}

\usepackage{setspace}
\usepackage[top=2.5cm, bottom=2.5cm, left=3.5cm, right=2.5cm]{geometry}
\usepackage{titlesec}
\titleformat{\chapter}[display]   
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}   
\titlespacing*{\chapter}{0pt}{-50pt}{100pt}
\doublespacing

\begin{document}
\chapter{Litwo, Ojczyzno moja!}
Ty jeste\'s jak zdrowie\ldots
\end{document}
mlmmn
  • 65

1 Answers1

4

The mwrep class uses a non-standard manner to format their sectioning commands.

To modify the behavior of \chapter add the following lines in your preamble:

\makeatletter
\SetSectionFormatting[breakbefore,wholewidth]{chapter}
        {-20\p@}  %<-------------------- change this value (default is 56)
        {\FormatBlockHeading{\LARGE}}
        {24\p@}
\makeatother

As you can note in the comment, adjust the value to your needs.

MWE

\documentclass[12pt,a4paper]{mwrep}

\makeatletter
\SetSectionFormatting[breakbefore,wholewidth]{chapter}
        {-20\p@}  %<-------------------- change this value (default is 56)
        {\FormatBlockHeading{\LARGE}}
        {24\p@}
\makeatother

\usepackage[MeX]{polski}
\usepackage{fontspec}
\usepackage[]{unicode-math}
\setmainfont[Mapping=tex-text]{Times New Roman}
\setmathfont{XITS Math}
\defaultfontfeatures{Ligatures=TeX}

\usepackage{setspace}
\usepackage[top=2.5cm, bottom=2.5cm, left=3.5cm, right=2.5cm]{geometry}
\doublespacing

\begin{document}
\chapter{Litwo, Ojczyzno moja!}
Ty jeste\'s jak zdrowie\ldots
\end{document} 

Output

enter image description here

karlkoeller
  • 124,410