# Displaying Text Next to Section/Subsection title in LyX

Within a given section (or subsection), I would like my section title to appear on the left and I want the text to appear immediately after the title of the section as in the following example.

In this example, is the text also in Section mode? When I try to include the paragraph in Section mode, I cannot obtain the PDF. So I currently have the text of the paragraph in Standard mode.

Source Code for Section and Text:

\section{\noindent \textbf{Introduction.}}

\begin{doublespace}
Let $\left\{ x:0\le x<1\right\}$ be the compact group of real numbers
modulo 1.\end{doublespace}


Entire Source Code:

\documentclass[english]{amsart}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsthm}
\usepackage{setspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{mathtools}

\makeatletter
\renewcommand{\section}{%
\@startsection{section}
{1}
\z@
{.7\linespacing \@plus \linespacing}
{.5\linespacing}
{\normalfont\centering}% \scshape
}
\makeatother

\makeatother

\usepackage{babel}
\begin{document}

\section{\noindent \textbf{Introduction.}}

\begin{doublespace}
Let $\left\{ x:0\le x<1\right\}$ be the compact group of real numbers
modulo 1.\end{doublespace}

\end{document}


## 1 Answer

Don't put formatting in the \section argument!

Just define section to be inline rather than display (by changing the sign of the space argument)

\documentclass[english]{amsart}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsthm}
\usepackage{setspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{mathtools}

\makeatletter
\renewcommand{\section}{%
\@startsection{section}
{1}
\z@
{1\baselineskip plus \baselineskip}
{-1em}
{\normalfont\bfseries}% \scshape
}
\makeatother

\makeatother

\usepackage{babel}
\begin{document}

\section{Introduction.}

\begin{doublespace}
Let $\left\{ x:0\le x<1\right\}$ be the compact group of real numbers
modulo 1.\end{doublespace}

\end{document}

• I'm using LyX. How can I edit so that my source looks like yours? – The Substitute Nov 22 '15 at 0:20
• I have no idea about lyx, but you already have a redefinition of \section in your preamble, I just fixed it to give the layout that you asked about. So presumably you just do whatever you did originally to get a definition in the preamble? – David Carlisle Nov 22 '15 at 0:23