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.

Is it possible to start your text right after the section or subsection title (without starting a new line)? Thank you. I hope the question is clear enough and does not need a MWE.

share|improve this question
    
It is always best to provide a MWE as it maximises the chance that (a) you supply enough information and that (b) the person answering tests their answer. In this case the answer probably depends on which class you are using, but you haven't said. –  David Carlisle Feb 21 '13 at 0:36
add comment

2 Answers 2

David has already provided the package-free solution; here's another option, using the titlesec package (simply selecting the runin predefined format):

\documentclass{article}
\usepackage{titlesec}

\titleformat{\section}[runin]
  {\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}[runin]
  {\normalfont\large\bfseries}{\thesubsection}{1em}{}

\begin{document}

\section{Test Section} 
Test
\subsection{Test Subsection} 
Test

\end{document}

enter image description here

share|improve this answer
add comment

In the default classes the run-in style is used for \paragraph and \subparagraph to change \section to use the same find it's defintion, in article it is

\newcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries}}

and you need to invert the sign of the 3/4th arguments as that is used as a switch to specify run-in style so

\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {3.5ex \@plus 1ex \@minus .2ex}%
                                   {-1em}%
                                   {\normalfont\Large\bfseries}}

Also changed the 4th arg to specify 1em space after (rather than below) the heading, as for \paragraph

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.