3

I am a beginner of LaTEX. Because some reasons, I need to change my thesis from word to Latex in some days. I would like to ask how to make a chapter like this? Thank you very much!!!

enter image description here

Thanks for people's help. I know how to change the chapter style.But I still wonder how to add a small content following the chapter. I tried to use the mintoc package but it failed. The small table of content didn't show. How can I solve this problem? Thanks!!!

enter image description here

\documentclass[twosides]{book}
\usepackage{graphics}
\usepackage{color,calc,graphicx,soul,fourier}
\usepackage{calc}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{minitoc}
\usepackage{tikz}
\usepackage{lipsum}


\titleformat{\chapter}%[display]
{\normalfont\fontsize{25}{30}\selectfont\raggedright}% Format and size of title text
{\llap{%
    \rule[-6pt]{6cm}{1.3cm}\rule{6pt}{0pt}}% Black box to the left, lowered 6pt. The end rule is a horisontal space.
  \llap{% Number also to the left, on top of the black box.
    \fontsize{40}{44}\selectfont\color{white}\thechapter\rule{10pt}{0pt}}}
{0pt}
{}{}

\titlespacing*{\chapter}
  {0pt}{50pt}{10pt}


\setcounter{chapter}{1}

\chapter{A long chapter heading that does not fit in one row}

\begin{document}

\dominitoc
\tableofcontents


\section{A test section}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]


\minitoc
\end{document}

2 Answers2

3

Something like this?

\documentclass[twosides]{book}
\usepackage{graphics}
\usepackage{color,calc,graphicx,soul,fourier}
\usepackage{calc}
\usepackage{titlesec}
\titleformat{\chapter}%[display]
{\normalfont\fontsize{25}{30}\selectfont\raggedright}% Format and size of title text
{\llap{%
    \rule[-6pt]{6cm}{1.3cm}\rule{6pt}{0pt}}% Black box to the left, lowered 6pt. The end rule is a horisontal space.
  \llap{% Number also to the left, on top of the black box.
    \fontsize{40}{44}\selectfont\color{white}\thechapter\rule{10pt}{0pt}}}
{0pt}
{}{}
\usepackage{lipsum}
\setcounter{chapter}{1}
\chapter{A long chapter heading that does not fit in one row}
\begin{document}
\lipsum
\end{document}

enter image description here

---EDIT---

To add a ToC for each chapter you can use minitoc as below. Compile two times.

\documentclass[twosides]{book}
\usepackage{graphics}
\usepackage{color,calc,graphicx,soul,fourier}
\usepackage{calc}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{minitoc}
\usepackage{tikz}
\usepackage{lipsum}
\titleformat{\chapter}%[display]
{\normalfont\fontsize{25}{30}\selectfont\raggedright}% Format and size of title text
{\llap{%
    \rule[-6pt]{6cm}{1.3cm}\rule{6pt}{0pt}}% Black box to the left, lowered 6pt. The end rule is a horisontal space.
  \llap{% Number also to the left, on top of the black box.
    \fontsize{40}{44}\selectfont\color{white}\thechapter\rule{10pt}{0pt}}}
{0pt}
{}{}
\titlespacing*{\chapter}
  {0pt}{50pt}{10pt}
\setcounter{chapter}{1}
\begin{document}
\dominitoc
\tableofcontents

\chapter{A long chapter heading that does not fit in one row}
\minitoc
\section{A test section}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]

\chapter{Another chapter}
\minitoc
\section{A test section}
\lipsum[2]
\subsection{A test subsection}
\lipsum[2]

\end{document}

enter image description here

StefanH
  • 13,823
  • Really many thanks. Could I ask one more thing, how could I add a some content following the chapter title? Also, I don't know why I cannot use the command section. Thank you very much. – Tiao Wang Sep 14 '17 at 12:48
  • @TiaoWang, If by the command section mean the two last argument, those are for typsetting the tilte. The number is typset in the third argument. That means if you state \chapter*{Test} you get a chapter heading without number (and without the black box). About the ToC, you can use minitoc or titletoc, see e.g. https://tex.stackexchange.com/questions/3001/list-sections-of-chapter-at-beginning-of-that-chapter – StefanH Sep 14 '17 at 13:29
  • Many thanks for your help. I had tried to use the minitoc package but it failed. The small table of content didn't show. Could you check my questions? New codes I wrote was uploaded. How can I solve this problem? Thanks!!! – Tiao Wang Sep 14 '17 at 14:04
  • @TiaoWang, see edit. – StefanH Sep 15 '17 at 07:19
0

Hope the below code may help you with minitoc:

 \documentclass[twosides]{book}
    \usepackage{graphics}
    \usepackage{color,calc,graphicx,soul,fourier}
\usepackage{minitoc}
    \usepackage{titlesec}
    \titleformat{\chapter}[display]
      {\normalfont\Large\raggedright}
  {{
\hspace*{-5pc}\colorbox{black}{\vbox to 3pc{\vss\hbox to 5pc{\hss\color{white}\Huge\thechapter}}}
    \MakeUppercase{Literature review}
}}
  {10pt}{\Huge}


\usepackage{lipsum}
\setcounter{chapter}{1}
\dominitoc
\begin{document}
\chapter{Chapter 1}
\minitoc
\section{Chapter 1 First Heading}
\lipsum[1]
\chapter{Chapter 2}
\minitoc
\section{Chapter 2 First Heading}
\lipsum[2]
\end{document}

Hope you can do little alteration based on your requirement...

MadyYuvi
  • 13,693