Text FormattingReduce space between two section title words

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bgreen
Posts: 39
Joined: Wed Nov 22, 2023 11:02 am

Reduce space between two section title words

Post by bgreen »

Hello,

The code below produces a two word title, however, the two words are at the opposite ends of the page.

I'm not sure if this is addressed through justification or reducing space between the words.

Advice on how I can locate the two words closer together would be appreciated.

Code: Select all

\documentclass{article}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage{graphicx} 
\usepackage[english] {babel}
\usepackage{blindtext}
\usepackage[section]{placeins}
\usepackage{subcaption}
\usepackage[colorlinks]{hyperref}
\pagestyle {empty}
\usepackage[labelformat=empty]{caption}
\usepackage {wrapfig}
\titleformat*{\section}{\fontsize{12}{14}\selectfont}
\graphicspath{ {D:/a_surf/BB/bgpage/} }
\begin{document}
\pagecolor{yellow!30}
{\centering

\section {The M\={a}ori}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10358
Joined: Mon Mar 10, 2008 9:44 pm

Reduce space between two section title words

Post by Stefan Kottwitz »

Hi,

you can put the \centering command into \titleformat like this:

Code: Select all

\titleformat*{\section}{\fontsize{12}{14}\selectfont\centering}
Then use \section as usual.

Stefan
LaTeX.org admin
bgreen
Posts: 39
Joined: Wed Nov 22, 2023 11:02 am

Reduce space between two section title words

Post by bgreen »

Thank you Stefan.
Post Reply