5

In the question asked here, How to have the same solution but in a different command without affecting the \section command? I mean I would like to create another command e.g. \runinsection that would make the text continue beside the section header while maintaining the \section command with its normal behavior.

Thanks in advance.

1 Answers1

7

You can simply define a new command \runinsection

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

and use it as in the following MWE:

\documentclass{article}

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

\usepackage{lipsum} %just for the example

\begin{document}

\section{This is a normal section}

\lipsum[1]

\runinsection{This is a run-in section}

\lipsum[1]

\end{document} 

Output

enter image description here

karlkoeller
  • 124,410