Page Layout ⇒ Reduce horizontal space between section title and numbering
-
- Posts: 10
- Joined: Thu Dec 29, 2011 3:30 pm
Reduce horizontal space between section title and numbering
Is it possible to reduce the horizontal space between the section title and section numbering? My section header looks like this:
1 Header
and I'd like something like this:
1. Header
Best regards,
Lars
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Reduce horizontal space between section title and number
welcome to the board!
The answer depends on the document class you are using. Which one is it?
Stefan
-
- Posts: 10
- Joined: Thu Dec 29, 2011 3:30 pm
Re: Reduce horizontal space between section title and number
The documentclass I use is the report class.
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Reduce horizontal space between section title and numbering
Code: Select all
\documentclass{report}
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{0.2em}{}
\begin{document}
\chapter{One}
\section{Header}
\end{document}
Stefan
-
- Posts: 10
- Joined: Thu Dec 29, 2011 3:30 pm
Re: Reduce horizontal space between section title and number
Texmaker marks \titleformat and \thesection as unrecognized commands but it works wonderfully.
Is there any way to do the same with the table of contents? I have called it by invoking \tableofcontents ?
Best regards,
Lars
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Reduce horizontal space between section title and numbering
Texmaker doesn't know all LaTeX packages, and titlesec is an extension package, so that's normal.larschrjensen wrote:Texmaker marks \titleformat and \thesection as unrecognized commands but it works wonderfully.
Probably with titletoc, which is a companion to titlesec for designing the table of contents. Or use tocloft.larschrjensen wrote:Is there any way to do the same with the table of contents? I have called it by invoking \tableofcontents?
Stefan
-
- Posts: 10
- Joined: Thu Dec 29, 2011 3:30 pm
Re: Reduce horizontal space between section title and number
Best regards,
Lars
Reduce horizontal space between section title and numbering
Is an empty field = default? And also, where are the default values to be found?Stefan Kottwitz wrote:With the titlesec package:
Customize the 0.2em if you like, originally it's 1em.Code: Select all
\titleformat{\section} {\normalfont\Large\bfseries}{\thesection}{0.2em}{}
Stefan
Reduce horizontal space between section title and numbering
Code: Select all
\titleformat{〈command 〉}[〈shape〉]{〈format〉}{〈label 〉}{〈sep〉}{〈before-code〉}[〈after-code〉]