Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.
share
2  
Trying to break lines with \\ is a common mis-use of line-breaking. See Documents with typical LaTeX errors. –  Werner Jun 19 '12 at 18:55
    
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".) –  barbara beeton Jun 19 '12 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. –  Gonzalo Medina Jun 19 '12 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. –  barbara beeton Jun 19 '12 at 20:35
add comment

4 Answers

up vote 11 down vote accepted

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".)

share
2  
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 Jun 19 '12 at 18:59
    
Thanks Gonzalo, good response. Looks like I need to teach myself some lessons on redefinition and \@startsection. @Werner: helpful link! –  Sean Mackesey Jun 19 '12 at 19:06
add comment

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 ~.

share
add comment

A simple walk-around 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 walk-around 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.

share
add comment

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}\\

share
    
Welcome to TeX.SX! In general a full compilable answer is to favour just like MWEs in the questions. –  Ruben Dec 26 '13 at 20:20
add comment

This site is currently not accepting new answers.

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