0

I'm using a two custom chapterstyle, one for the main document and one for the backmatter. While it is recognizing and rendering both styles, I get extra text. In the preamble I have the main style:

\usepackage{pgfornament}

\makechapterstyle{myheading-1}
{\renewcommand\chapternamenum{\fontsize{20}{20}\centering}
\renewcommand\printchaptername{}
\renewcommand\midchapskip{1ex}
\renewcommand\chaptitlefont{\fontsize{18}{18}\scshape\centering}
 \renewcommand\afterchaptertitle{%
          \par\centering%
        \raisebox{1ex}{\pgfornament[scale=0.35]{88}}\par\nobreak\vspace{3ex}}
}
\chapterstyle{myheading-1}

\makepagestyle{chapter} 
{\thispagestyle{empty}
}

And then I have my main document.

At the end, I have:

\backmatter
\makechapterstyle{afterwards} 
{
\setlength{\beforechapskip}{-50pt}   
\renewcommand\chapternamenum{} 
\renewcommand\printchaptername{} 
\renewcommand\chaptitlefont{\fontsize{18}{18}\scshape\centering} 
\renewcommand\afterchaptertitle{%           
\par\centering%         
\raisebox{1ex}{\pgfornament[scale=0.35]{88}}\par\nobreak\vspace{3ex}} 
} 
\chapterstyle{afterwards}

Followed by an about the author, reading list, and bibliography.

The new style renders correctly (it's the same style, set higher on the page) however, in the PDF exported I get a page that is empty of everything but the text "1ex."

How do I get rid of this extra text and what is a better way to include two different custom styles? (I initially tried including both styles in the preamble. Got lots of errors)

Notes: I am using memoir, and coding via Lyx. The backmatter and backmatter chapter style are in a "Tex Code" block between the final chapter and the beginning of the after-content.

1
  • Have you seen my answer which solves your problem? Feb 20, 2021 at 18:33

1 Answer 1

2

In your definition of \makechapterstyle{heading-1}{...} you used

 \renewcommand\midchapskip{1ex}

but it should have been

\setlength{\midchapskip}{1ex}

You can define both chapterstyles in the preamble. The following is a cobbled together corrected version of what you might have supplied as an MWE.

% memchapprob.tex  SE 583682   

\documentclass{memoir}
\usepackage{pgfornament}

\makechapterstyle{myheading-1}
{\renewcommand\chapternamenum{\fontsize{20}{20}\centering}
\renewcommand\printchaptername{}
%\renewcommand\midchapskip{1ex}
\setlength\midchapskip{1ex}
\renewcommand\chaptitlefont{\fontsize{18}{18}\scshape\centering}
 \renewcommand\afterchaptertitle{%
          \par\centering%
        \raisebox{1ex}{\pgfornament[scale=0.35]{88}}\par\nobreak\vspace{3ex}}
}

\makechapterstyle{afterwards}{%
\setlength{\beforechapskip}{-50pt}   
\renewcommand\chapternamenum{} 
\renewcommand\printchaptername{} 
\renewcommand\chaptitlefont{\fontsize{18}{18}\scshape\centering} 
\renewcommand\afterchaptertitle{%           
\par\centering%         
\raisebox{1ex}{\pgfornament[scale=0.35]{88}}\par\nobreak\vspace{3ex}} 
} 

\chapterstyle{myheading-1}
\makepagestyle{chapter}{\thispagestyle{empty}}

\begin{document}
\chapter{Main chapter}
Some text.

\backmatter
\chapterstyle{afterwards}

\chapter{Afterwards}
More text.
\clearpage
Even more text.

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .