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
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: 10330
- 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: 10330
- 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: 10330
- 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
Code, edit and compile here:\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〉]