Text Formattingchanging section title format

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
martman
Posts: 8
Joined: Thu Jul 31, 2008 4:09 am

changing section title format

Post by martman »

Anyone mind giving me a hand using the titlesec package to change the section title format?

Id like to have it so under (the next line) the title is a bunch of = signs. I know it sounds a bit weird but it will come in handy oddly enough.

So something like:

Section 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

Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

changing section title format

Post by Stefan Kottwitz »

Hi martman,

you could use ulem or the soul package:

Code: Select all

\usepackage{titlesec}
\usepackage[normalem]{ulem}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{\uuline}
Stefan
LaTeX.org admin
martman
Posts: 8
Joined: Thu Jul 31, 2008 4:09 am

Re: changing section title format

Post by martman »

double underline looks close, but I'd really like equal signs if possible. Besides from pdf output I also need text, and my convert cant handle uuline but should be able to use a equal sign easily.

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

changing section title format

Post by Stefan Kottwitz »

With ulem it's also possible to use equal signs, like:

Code: Select all

\newcommand\equalsigns{\bgroup\markoverwith{\raisebox{-1.1ex}{=}}\ULon}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{\equalsigns}
Stefan
LaTeX.org admin
martman
Posts: 8
Joined: Thu Jul 31, 2008 4:09 am

Re: changing section title format

Post by martman »

Hate to keep pushing my luck but is there a easy way to change that last one so there are 80 equal signs?

Thanks alot!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

changing section title format

Post by Stefan Kottwitz »

If you need a fixed number of equal signs you don't need ulem:

Code: Select all

\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}[==== ... ====]
Stefan
LaTeX.org admin
Post Reply