Page LayoutRemove a . after numbering \paragraph or \subparagraph

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Remove a . after numbering \paragraph or \subparagraph

Post by fja »

Hi, there!
I have this question: I need to format the \paragraph and \subparagraph like this:
1) First Paragraph
2) 2nd …
a) First subparagraph


I used this code:

Code: Select all

\documentclass[letterpaper,12pt,oneside]{book}
\usepackage[spanish,es-lcroman]{babel}
\begin{document}
 \setcounter{secnumdepth}{5}
\renewcommand{\theparagraph}{\arabic{paragraph})}
\renewcommand{\thesubparagraph}{\alph{subparagraph})}
\end{document}
And it works fine! But, it puts a dot after de number, I mean:

1). First Paragraph Text of this paragraph
2). 2nd … Text of this paragraph
a). First subparagraphText of this paragraph


So, what can I do to get this dot out? And, how can I get a breakline between the (sub)paragraph's title and the rest of the text? I mean:
1) First Paragraph's title
This is the text of this paragraph
a) First subparagraph's title
This is the text of this subparagraph
Last edited by fja on Fri May 06, 2011 11:51 pm, edited 1 time in total.

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: 10328
Joined: Mon Mar 10, 2008 9:44 pm

Remove a . after numbering \paragraph or \subparagraph

Post by Stefan Kottwitz »

Hi fja!

That's caused by the Spanish style of babel. Without babel, you won't get those dots. If you write Spanish, perhaps it would be good to match the style, with dots instead of parentheses? The babel documentation says to Spanish:
There is a dot after section numbers in titles, headings, and toc.
Stefan
LaTeX.org admin
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Re: Remove a . after numbering \paragraph or \subparagraph

Post by fja »

Maybe you're right about the dot. (The thing is that is the format given to my thesis)

But, what about the second issue, I mean, the text of \paragraph or \subparagraph in a new line??

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

Remove a . after numbering \paragraph or \subparagraph

Post by Stefan Kottwitz »

Hi,

redefine \paragraph and \subparagraph using \@startsection. This command is documented in the LaTeX source documentation, you could type texdoc source2e on your computer or load it from CTAN.

titlesec is a flexible package for customizing headings. You could use it for that purpose. I just don't have time in the moment, hoewever in the late evening I can post come code for you.

Do you still need to remove the dot? If yes, I could check that also in the evening.

Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10328
Joined: Mon Mar 10, 2008 9:44 pm

Remove a . after numbering \paragraph or \subparagraph

Post by Stefan Kottwitz »

Here's a redefinition for \paragraph and \subparagraph with new line:

Code: Select all

\makeatletter
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
  {-3.25ex\@plus -1ex \@minus -.2ex}%
  {1.5ex \@plus .2ex}%
  {\normalfont\normalsize\bfseries}}
\renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
  {-3.25ex\@plus -1ex \@minus -.2ex}%
  {1.5ex \@plus .2ex}%
  {\normalfont\normalsize\bfseries}}
\makeatother
Stefan
LaTeX.org admin
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Remove a . after numbering \paragraph or \subparagraph

Post by fja »

Stefan_K wrote:Here's a redefinition for \paragraph and \subparagraph with new line:
Stefan
Thanks, Stefan, it works fine!!!!! :D
Post Reply