25

This latex code:

\documentclass[9pt]{amsart}

\begin{document}
  \subsubsection*{Animals}
  Rabbit horse monkey cow
\end{document}

Generates something that looks approximately like this:

Animals. Rabbit horse monkey cow.

I'd like to add a newline after the section heading, but if I use \\ with

\subsubsection*{Animals}\

I get:

! LaTeX Error: There's no line here to end.

If I put the \\ inside the brackets, with Animals, then I get a newline but it separates "Animals" from the period:

Animals

. Rabbit horse monkey cow.

How can I put a newline after the section heading without separating it from the period?

EDIT: A good solution is provided below using redefinition of \subsubsection, but a simpler method is to do

\subsubsection*{Animals}\hspace*{\fill} \\
Rabbit horse monkey cow.
4
  • 2
    Trying to break lines with \\ is a common mis-use of line-breaking. See Documents with typical LaTeX errors.
    – Werner
    Commented Jun 19, 2012 at 18:55
  • 1
    you can put something typesettable but invisible after the subsubsection heading; $ $ does nicely. i can't recommend titlesec because it's an option we don't permit when a paper is submitted to an ams journal, so we've never tested it. (for the same reason, i can't "unrecommend" it either. for whatever it's worth, it has never been identified as causing failures with amsart; just "not tested here".) Commented Jun 19, 2012 at 20:06
  • @barbarabeeton since I added to my initial answer an option using titlesec, I took the liberty to quote you; I hope it's OK. Commented Jun 19, 2012 at 20:27
  • 1
    @GonzaloMedina -- yes, it's okay, and i appreciate the recognition that publishers do have guidelines, and would really like it if authors actually read (and follow) the instructions. thanks. Commented Jun 19, 2012 at 20:35

6 Answers 6

24

You can redefine \subsubsection appropriately; here's the original definition in amsart.cls

\def\subsubsection{\@startsection{subsubsection}{3}%
  \z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
  {\normalfont\itshape}}

and you can redefine it using something like this:

\documentclass[9pt]{amsart}
\usepackage[parfill]{parskip}    

\makeatletter
\def\subsubsection{\@startsection{subsubsection}{3}%
  \z@{.5\linespacing\@plus.7\linespacing}{.1\linespacing}%
  {\normalfont\itshape}}
\makeatother

\begin{document}
\subsubsection*{Animals}
Rabbit horse monkey cow
\end{document}

enter image description here

Another option, not requiring knowing the inner definition of \subsubsection, is to use the titlesec package:

\documentclass[9pt]{amsart}
\usepackage[parfill]{parskip}
\usepackage{titlesec}

\titleformat{\subsubsection}
  {\normalfont\normalsize\itshape}{\thesubsubsection}{1em}{}
\titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{0ex plus .2ex}

\begin{document}
\subsubsection*{Animals}
Rabbit horse monkey cow
\end{document}

However, if you are writing a paper for a submission to an AMS journal, pay attention to the following warning from barbara beeton regarding the use of titlesec with the AMS document classes:

i can't recommend titlesec because it's an option we don't permit when a paper is submitted to an ams journal, so we've never tested it. (for the same reason, i can't "unrecommend" it either. for whatever it's worth, it has never been identified as causing failures with amsart; just "not tested here".)

3
  • 3
    As reference for more information on what the elements in \@startsection means, see Where can I find help files or documentation for commands like \@startsection for LaTeX?
    – Werner
    Commented Jun 19, 2012 at 18:59
  • Thanks Gonzalo, good response. Looks like I need to teach myself some lessons on redefinition and \@startsection. @Werner: helpful link! Commented Jun 19, 2012 at 19:06
  • So, following your first idea, what should be the parameter to be modified in order to get that final period that was included before at the end of the section heading? Commented Mar 21, 2019 at 12:37
17

A simple workaround not requiring any modification.

If you directly put \\ then it tells you there is no line here to end, but if you put any character before \\ it will allow you to create a new line.

So my workaround is put a ~ right after the \subsubsection{tittle}, and \\ after ~, the ~ create an invisible space after your title, and which enables you to create a new line for your visible paragraphs.

10

The simplest way would be to give subsubsection some invisible text before the newline:

subsubsection*{Animals}~\\Rabbit horse monkey cow

You may choose \mbox{} instead of ~.

2

You could simply add \hfill at the end of the \subsubsection{} like so

\subsubsection{Something}\hfill
1
  • 1
    The above does not work. TL 2022
    – Nasser
    Commented Oct 22, 2022 at 12:24
0

If you want to fine tune the spacing after the linebreak then you can use an invisible rule e.g. \subsection{Animals}\rule[-10pt]{0pt}{10pt}\\

1
  • 1
    Welcome to TeX.SX! In general a full compilable answer is to favour just like MWEs in the questions.
    – Ruben
    Commented Dec 26, 2013 at 20:20
0

Using hfill with an empty new line works for me.

\subsubsection{myTitle}
\hfill

My paragraph. My paragraph. My paragraph. My paragraph. My paragraph. 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .