[Tex/LaTex] How to get the abstract title to runin

abstractline-breaking

We have written a style class file and I need the abstract to be in a special format to the rest of the report. It ought to look like such:

Abstract - text text text...

But with the current configuration it looks like such:

Abstract - 

text text text...

The code we use that configures the abstract looks like such:

\renewenvironment{abstract}{
 \fontsize{10}{12}\selectfont
 \begin{changemargin}{10mm}{10mm}
 \noindent\em Abstract -
}{
 \end{changemargin}
}

I found out about the [runin] command but with my limited LaTeX knowledge don't know where to place it (I tried several positions but from the errors I get I doubt it's designed to work with the \renewenvironment{abstract} command).

Any help is appreciated!

Edit

Here is the change margin function

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist

Best Answer

As noted in the comments your code does not produce a new line so there must be a blank line in the document.

The standard latex mechanism for producing displayed environments is to use list or \trivlist If you do this then it handles ignoring blank lines at the start and merging any space before or after the environment.

enter image description here

\documentclass{article}

%definition of quote with addition of [\textbf{Abstract --- ]
\renewenvironment{abstract}
               {\list{}{\rightmargin\leftmargin}%
                \item[\textbf{Abstract ---}]\relax}
               {\endlist}

\begin{document}

\begin{abstract}Red yellow blue\end{abstract}


\begin{abstract}

Red yellow blue

\end{abstract}

\end{document}
Related Question