2

I am using a slightly-adapted chapter style VZ34 (found in Madsen's 'various chapter styles' PDF, created as a variant over VZ39), which I would like to apply also to the layout of my part divisions. Here's an MWE for the chapter style (which produces the default part style):

\documentclass[12pt,twoside]{memoir}

\renewcommand*{\thepart}{\arabic{part}}

\usepackage{calc}
\newif\ifNoChapNumber
\makeatletter
\makechapterstyle{VZ34}{
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{}
\renewcommand\chapnumfont{\Large\bfseries}
\renewcommand\chaptitlefont{\Large\bfseries\raggedright}
\renewcommand\printchaptertitle[1]{%
\begin{tabular}{@{}p{1cm}|!{\quad}p{\textwidth-1cm-2em-4\tabcolsep }}
\ifNoChapNumber\relax\else\chapnumfont \thechapter\fi
& \chaptitlefont ##1
\end{tabular}
\NoChapNumberfalse
}
\renewcommand\printchapternonum{\NoChapNumbertrue}
}
\chapterstyle{VZ34}

\renewcommand*{\cftpartname}{Part}
\renewcommand*{\cftpartpresnum}{\space}

\begin{document}
\part{This is a test}
\chapter{I am a test}
\end{document}

This yields the following chapter and part layouts: enter image description here

Ultimately, there are only two differences from the chapter style in how the part style should be formatted. Firstly, it should remain vertically-centered, but (if possible) right-aligned. The only other main difference from the chapter heading is that it will have to keep the word 'part' in front of the number (to differentiate it from the sequence of chapters--unfortunately, it is a requirement that both be numbered with Arabic numerals). But otherwise, I'd like it to have the same single-line with the vertical divider layout as seen in the chapter heading.

I have tried adjusting the code for the chapter style to fit parts, but am running into the problem that there's no equivalent of \printchapternonum for parts (there may be other problems too, but at this point I am uncertain how to proceed). Is there a better way to achieve a similar layout?

1 Answer 1

2

This answer doesn't solve the problem with no existence of part equivalent for \printchapternonum, but unless you need a non numbered part, following code should work:

\documentclass[12pt,twoside]{memoir}

\renewcommand*{\thepart}{\arabic{part}}

\usepackage{calc}
\newif\ifNoChapNumber
\newif\ifNoPartNumber
\makeatletter
\makechapterstyle{VZ34}{
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{}
\renewcommand\chapnumfont{\Large\bfseries}
\renewcommand\chaptitlefont{\Large\bfseries\raggedright}
\renewcommand\printchaptertitle[1]{%
\begin{tabular}{@{}p{1cm}|!{\quad}p{\textwidth-1cm-2em-4\tabcolsep }}
\ifNoChapNumber\relax\else\chapnumfont \thechapter\fi
& \chaptitlefont ##1
\end{tabular}
\NoChapNumberfalse
}
\renewcommand\printchapternonum{\NoChapNumbertrue}
}
\chapterstyle{VZ34}

\renewcommand*{\cftpartname}{Part}
\renewcommand*{\cftpartpresnum}{\space}

\renewcommand{\partnamefont}{\huge\bfseries\raggedright}
\renewcommand{\midpartskip}{}
\renewcommand\printparttitle[1]{%
\hspace{1ex}\begin{tabular}[t]{|!{\hspace{1ex}}p{\textwidth-3cm-2em-4\tabcolsep }}
\parttitlefont #1
\end{tabular}
}

\begin{document}

\part{This is a test for a very long long long long title}

\chapter{I am a test with a very long long long long title}

\end{document}

enter image description here

1
  • I should specify that your solution also works with the divisions that the memoir class is doing 'automatically' (e.g. marking off the appendices section, which isn't technically an 'unnumbered part', but which functions like a part break and isn't numbered). So, thanks! The one hitch I'm seeing is that it's trying to justify the part title within the tabular, so I've ended up declaring a custom left-aligned cell in order to correct for this. It looks great!
    – Erika
    Mar 13, 2016 at 21:12

You must log in to answer this question.

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