Page LayoutCustom Chapter Headings without Chapter Prefix

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
budrik
Posts: 5
Joined: Tue Oct 16, 2012 10:13 am

Custom Chapter Headings without Chapter Prefix

Post by budrik »

Hi,

I'm currently writing my PhD thesis and try to produce a nice chapter style. Does anybody know how to produce the attached chapter style?

An example of what I'm after is attached.


Regards
budrik
Attachments
example.pdf
(38.53 KiB) Downloaded 437 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Custom Chapter Headings without Chapter Prefix

Post by Stefan Kottwitz »

Hi Budric,

welcome to the board!

Have a look at the titlesec package, I guess you can use this, it's pretty flexible. The fncychap package provides some other example styles.

Stefan
LaTeX.org admin
budrik
Posts: 5
Joined: Tue Oct 16, 2012 10:13 am

Custom Chapter Headings without Chapter Prefix

Post by budrik »

Hi,
thanks for the answer ;-). I have this so far:

Code: Select all

\documentclass[runningheads,a4paper,10pt]{book}
\usepackage{lipsum}
\usepackage{titlesec}

\titleformat{\chapter}{\sffamily\bfseries\Huge}{}{0pt}{}
\titleformat{\section}[leftmargin]{\sffamily\bfseries\large}{}{0pt}{}
\titlespacing*{\section}{2.5cm}{*2.5}{0.5cm}

\begin{document}
\chapter{1 Introduction}
\section{Content}
\lipsum[1]
\section{Outline}
\lipsum[1]
\end{document}
But it is not looking that good as the example!

regards
Last edited by budrik on Tue Oct 23, 2012 9:11 am, edited 1 time in total.
budrik
Posts: 5
Joined: Tue Oct 16, 2012 10:13 am

Re: Custom Chapter Headings without Chapter Prefix

Post by budrik »

Hi,

can anybody help me to get the "1" from "1 Introduction" into the left margin, such that it is aligned with "Content" and "Outline"?

Thanks for any help
budrik
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Custom Chapter Headings without Chapter Prefix

Post by localghost »

budrik wrote:Hi
can anybody help me to get the "1" from "1 Introduction" into the left margin, such that it is aligned with "Content" and "Outline"?[…]
A strict alignment with the section titles is not possible because you have chosen to center them. Nevertheless you can try something like this.

Code: Select all

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{titlesec}

\titleformat{\chapter}{\sffamily\bfseries\Huge}{\llap{\makebox[2em][r]{\thechapter}\hspace{1em}}}{0pt}{}
\titleformat{\section}[leftmargin]{\filcenter\sffamily\bfseries\large}{}{0pt}{}
\titlespacing*{\section}{2.5cm}{*2.5}{0.5cm}

\begin{document}
  \chapter{Introduction}
    \section{Content}
      \lipsum[1]

    \section{Outline}
      \lipsum[2]
\end{document}
For an exact alignment you should flush the section titles to the right by replacing \filcenter with \filleft. This might require a subsequent correction of the additional horizontal space in the chapter heading.

And please check your examples for functionality next time. The \raggedcenter command is unknown and makes the compilation of your example impossible. That could be a reason why you have gotten no answer.


Thorsten
budrik
Posts: 5
Joined: Tue Oct 16, 2012 10:13 am

Re: Custom Chapter Headings without Chapter Prefix

Post by budrik »

Hi Thorsten,

Thanks for the code! That's exactly what I want. And yes, I will fix the example code.

Regards Patrik
Post Reply