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
Hi,
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
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
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Reduce horizontal space between section title and number
Hi Lars,
welcome to the board!
The answer depends on the document class you are using. Which one is it?
Stefan
welcome to the board!
The answer depends on the document class you are using. Which one is it?
Stefan
LaTeX.org admin
-
- Posts: 10
- Joined: Thu Dec 29, 2011 3:30 pm
Re: Reduce horizontal space between section title and number
Thank you Stefan,
The documentclass I use is the report class.
The documentclass I use is the report class.
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Reduce horizontal space between section title and numbering
With the titlesec package:
Customize the 0.2em if you like, originally it's 1em.
Stefan
Code: Select all
\documentclass{report}
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{0.2em}{}
\begin{document}
\chapter{One}
\section{Header}
\end{document}
Stefan
LaTeX.org admin
-
- Posts: 10
- Joined: Thu Dec 29, 2011 3:30 pm
Re: Reduce horizontal space between section title and number
Thank you very much!
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
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: 10290
- 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
LaTeX.org admin
-
- Posts: 10
- Joined: Thu Dec 29, 2011 3:30 pm
Re: Reduce horizontal space between section title and number
Thank you very much for your help. It was very helpful.
Best regards,
Lars
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
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)
Reduce horizontal space between section title and numbering
Answer to m/s: no, an empty field != package's default. I tried. Would it be such a hardship to wrap this with a keyval command to be able to change only a subset of the parameters?
Manual: https://mirror.las.iastate.edu/tex-arch ... tlesec.pdf
Code: Select all
\titleformat{〈command 〉}[〈shape〉]{〈format〉}{〈label 〉}{〈sep〉}{〈before-code〉}[〈after-code〉]
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)