3

I'm messing around with titlesec to make a frame with the chapter name in it. I can't figure out how to move the chapter name ("Chapter Foo" in the example).

Here's the MWE:

\documentclass[a4paper,book,openany,twocolumn]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{lipsum} 
\usepackage{titlesec}
\titleformat{\chapter}[frame]
{\normalfont\huge\bfseries}{\thechapter}{5em}{\Huge}
\titlespacing*{\chapter}{0pt}{-40pt}{15pt}
\begin{document}
\chapter*{Chapter Foo}
\lipsum
\lipsum[3-6]
\end{document}

This is what I have: enter image description here

This is what I want: enter image description here

I hope someone can help!

Werner
  • 603,163

1 Answers1

3

As has been mentioned in comments, titlesec and memoir are not fully compatible. You can use the built-in commands from memoir to easily define your style; a simple example (make the necessary adjustments according to your needs):

\documentclass[a4paper,openany,twocolumn]{memoir}
\usepackage{lipsum}

\makeatletter
\makechapterstyle{Nordestgaard}{%
\renewcommand*{\printchaptername}{}
\renewcommand*{\printchapternum}{}
\renewcommand*{\chaptitlefont}{\normalfont\Huge\bfseries}
\renewcommand*{\printchaptertitle}[1]{%
\fbox{%
  \begin{minipage}[b][5cm][b]{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
  \raggedright\chaptitlefont\strut##1\par\smallskip%
  \end{minipage}}}
\setlength\afterchapskip{15pt}
\setlength\beforechapskip{-40pt}
}
\makeatother
\chapterstyle{Nordestgaard}

\begin{document}

\chapter{Test chapter}
\lipsum[1-6]

\end{document}

enter image description here

Gonzalo Medina
  • 505,128