Page Layout ⇒ Centering sections
-
- Posts: 2
- Joined: Mon Feb 21, 2011 5:20 am
Centering sections
I am using article as document class to write a paper. But I need to put the sections at the center of the page. Is there any package/way to do that? Thank you!
Ricardo.
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
Centering sections
I can think of two scenarios. First, you have the following stated in your preamble:
Code: Select all
\documentclass[twoside]{article}
The other scenario is that you'd like to recreate a Word document:
Code: Select all
\begin{document}
\centering
Random text here..
\end{document}
Follow howtoTeX on twitter
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Centering sections
Assumed that you mean section headings, you can do that very easy by the titlesec package. Details in the package manual.adarpodracir wrote:[…] But I need to put the sections at the center of the page. […]
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[bf,sf]{titlesec}
\usepackage{blindtext}
\titleformat{\section}{\normalfont\Large\bfseries\filcenter}{\thesection}{1em}{}
\begin{document}
\blinddocument
\end{document}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 2
- Joined: Mon Feb 21, 2011 5:20 am
Re: Centering sections
Dear localghost. Thank you very much. That was exactly what I was looking for!

Ricardo.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Centering sections
Then please mark the topic accordingly as you have already been directed and as written in the Board Rules (to be read before posting).adarpodracir wrote:[…] That was exactly what I was looking for! […]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10