3

I would like to ask the following:

I would like to use the theorem environment in my latex code. I also have some definitions and examples and I would like to let these environments look the same. Therefore, I produced the code below.

My problem is now, that I would like to display examples without indent, but when I do it as I did in the code below, I get a huge vertical whitespace between the word "Examples" and the first example.

Is it possible to avoid the whitespace and at the same time to have no indent?

Thanks for the help!

\documentclass[a4paper]{scrartcl}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{paralist}
\newtheoremstyle{dotless}{}{}{}{}{\bfseries}{}{\newline}{}
\theoremstyle{dotless}
\newtheorem{Definition}{Definition}
\newtheorem*{Examples*}{Examples}

\begin{document}

\begin{Definition}
Here comes a definition.
\end{Definition}

\begin{Examples*}
\
\begin{enumerate}[1)]
  \item First example.
  \item Second example.
  \item Third example.
\end{enumerate}
\end{Examples*}

\end{document}

screenshot

4

Like this? You can use

\leavevmode
\vspace{-\baselineskip}    %% adjust this

Code:

\documentclass[a4paper]{scrartcl}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumitem}     %%% changed
\newtheoremstyle{dotless}{}{}{}{}{\bfseries}{}{\newline}{}
\theoremstyle{dotless}
\newtheorem{Definition}{Definition}
\newtheorem*{Examples*}{Examples}

\begin{document}

\begin{Definition}
Here comes a definition.
\end{Definition}

\begin{Examples*}
\leavevmode
\vspace{-\baselineskip}    %% adjust this
\begin{enumerate}[label=\arabic*),leftmargin=*]  %% add <nosep> also if you like
  \item First example.
  \item Second example.
  \item Third example.
\end{enumerate}
\end{Examples*}

\end{document}

Or use a minipage. But if you have too many items, then page break won't be feasible.

\documentclass[a4paper]{scrartcl}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumitem}
\newtheoremstyle{dotless}{}{}{}{}{\bfseries}{}{\newline}{}
\theoremstyle{dotless}
\newtheorem{Definition}{Definition}
\newtheorem*{Examples*}{Examples}

\begin{document}

\begin{Definition}
Here comes a definition.
\end{Definition}

\begin{Examples*}

\begin{minipage}{\linewidth}
\par
\vspace{0.5\baselineskip}     %% adjust this
\begin{enumerate}[label=\arabic*),leftmargin=*]  %% add <nosep> also if you like
  \item First example.
  \item Second example.
  \item Third example.
\end{enumerate}
\end{minipage}
\end{Examples*}

\end{document}

enter image description here

You can add nosep if you want to reduce the spaces further.

\begin{enumerate}[label=\arabic*),leftmargin=*,nosep]

enter image description here

All these options are possible, if you use enumitem instead of paralist package.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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