Page Layout ⇒ Custom Chapter Headings without Chapter Prefix
Custom Chapter Headings without Chapter Prefix
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
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
welcome to the board!
Have a look at the


Stefan
Custom Chapter Headings without Chapter Prefix
thanks for the answer

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}
regards
Re: Custom Chapter Headings without Chapter Prefix
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Custom Chapter Headings without Chapter Prefix
A strict alignment with the section titles is not possible because you have chosen to center them. Nevertheless you can try something like this.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"?[…]
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}
\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
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Custom Chapter Headings without Chapter Prefix
Thanks for the code! That's exactly what I want. And yes, I will fix the example code.
Regards Patrik