Text FormattingDefining the space between subsection number and subsection title

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
jjmm
Posts: 13
Joined: Tue Jul 12, 2016 5:23 am

Defining the space between subsection number and subsection title

Post by jjmm »

Hi,

I know how to define the space between section number and section title:

https://tex.stackexchange.com/questions ... tion-title

Code: Select all

\makeatletter % access to internal commands
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\ }
\makeatother
How do we define the space between"subsection" number and "subsection" title?
Thanks!!

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Defining the space between subsection number and subsection title

Post by Johannes_B »

The code you have shown defines the space for all sectional levels.

Please provide a minimal working example, so we have something to test possible solutions.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
jjmm
Posts: 13
Joined: Tue Jul 12, 2016 5:23 am

Defining the space between subsection number and subsection title

Post by jjmm »

Thanks. This is the code where I modify the space between the section number and the section title.

Code: Select all

\documentclass{article}

\makeatletter 
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\ } % space 


\makeatother
\begin{document}

\section{Introduction}
This article

\subsection{My subsection}
However

\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Defining the space between subsection number and subsection title

Post by Stefan Kottwitz »

Well the spacing of the subsection number is modified too in that way. So you already achieve it. Or should it be different?

4ex just to see it better here:

\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\hspace{4ex}} % space
section.png
section.png (9.45 KiB) Viewed 4525 times
Stefan
LaTeX.org admin
Post Reply