[Tex/LaTex] Displaying Text Next to Section/Subsection title in LyX

lyxsectioningspacing

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.

enter image description here

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}

Best 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)

enter image description here

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