Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I "translate" the following from memoir class to report class? I'm currently writing a dissertation in report class and it would be great if I could use this chapter heading:

\documentclass{memoir}
\usepackage{tikz, blindtext}
\makechapterstyle{box}{
  \renewcommand*{\printchaptername}{}
  \renewcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries}
  \renewcommand*{\printchapternum}{
    \flushright
    \begin{tikzpicture}
      \draw[fill,color=black] (0,0) rectangle (2cm,2cm);
      \draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter };
    \end{tikzpicture}
  }
  \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries}
  \renewcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont##1}
}
\chapterstyle{box}
\begin{document}
\chapter{Introduction}

\end{document}

It looks like this

share|improve this question
    
Why not just use memoir? If you need to use report you can use the titlesec package to achieve the same result. –  Alan Munn Oct 31 '13 at 2:18

2 Answers 2

up vote 5 down vote accepted

The following is a fairly adequate adaptation of memoir's box chapter style (left is memoir; right is report):

enter image description here

\documentclass{report}
\usepackage{tikz, lipsum}% http://ctan.org/pkg/{pgf,lipsum}
\newcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries}
\newcommand*{\printchapternum}{
  \begin{tikzpicture}
    \draw[fill,color=black] (0,0) rectangle (2cm,2cm);
    \draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter };
  \end{tikzpicture}
}
\newcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries}
\newcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont#1}

\makeatletter
% \@makechapterhead prints regular chapter heading.
% Taken directly from report.cls and modified.
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedleft
    \ifnum \c@secnumdepth >\m@ne
        \printchapternum
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \printchaptertitle{#1}\par\nobreak
    \vskip 40\p@
  }}
% \@makeschapterhead prints starred chapter heading.
% Taken directly from report.cls and modified.
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedleft
    \interlinepenalty\@M
    \printchaptertitle{#1}\par\nobreak
    \vskip 40\p@
  }}
\makeatother
\begin{document}
\chapter{Introduction}
\lipsum
\end{document}

I've included a similar update to \@makeschapterhead that is responsible for setting a starred chapter heading. Some tweaking may be necessary, but that's left up to the reader.

share|improve this answer

The obligatory approach with »titlesec« (at left report, at right memoir).

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{titlesec}
\usepackage{tikz}
\usepackage{blindtext}

\newcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries}

\titleformat{\chapter}[display]
{\filleft\bfseries\sffamily}
{\filleft%
  \begin{tikzpicture}
    \draw[fill,color=black] (0,0) rectangle (2cm,2cm);
    \draw[color=white] (1cm,1cm) node {\chapnumfont\thechapter};
  \end{tikzpicture}
}
{20pt}
{\Huge}

\begin{document}
  \blinddocument
\end{document}

enter image description hereenter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.