# Section Commands Inside Enumerate Environment

Good Morning,

I would like to have subsection commands both before and inside an enumerate environment:

\subsection*{Instantaneous Velocity}

\begin{enumerate}
\item[\textsf{\textbf{Example 1}}] The table below gives the position $s$ of a car at time $t$.

\begin{enumerate}
\item Find the average velocity over the following intervals.
\begin{enumerate}
\item $0 \leq t \leq 0.4$
\end{enumerate}
\item Estimate the instantaneous velocity at $t=0.4$.
\end{enumerate}
\vfill

\subsection*{Defining Instantaneous Velocity Using the Idea of a Limit}

\item[\textsf{\textbf{Example 2}}] Yackety yack yack

\vfill

\end{enumerate}


When I compile this, the subsection inside the enumerate environment is indented (clearly, to match the enumerate environment) but I would like for it to align with the subsection that is outside of the enumerate environment.

I am aware of \suspend \resume and \interitemtext, but was wondering if there might be some simple(er) solution to this, or a basic concept that I might be missing.

Randy Scott, Santiago Canyon College, Orange, CA

-
With \usepackage{mdwlist} you can \suspend an enumeration and then \resume it. This may help. – Ethan Bolker Feb 23 '14 at 16:56
From the point of the logical structure of a document, is there really a need to have a sectional unit inside a list? – Gonzalo Medina Feb 23 '14 at 16:56
Why do you want it inside the list if you want it to appear to be outside the list? That is, putting it inside the list essentially tells TeX to format it accordingly and that will typically involve the indentation etc. So I don't understand why you'd want to do that if that's not the effect you desire. – cfr Feb 23 '14 at 17:25
Thanks for your suggestions. I wanted this construction to mirror the layout of the textbook I am using. In each section of the book, there are multiple subsections, but the number of examples continues through the entire section. – Randy Scott Feb 24 '14 at 5:06
@Randy Scott: I discover this explanation of your request. My suggestion for such a structure would be to use something like: \newtheorem{example}{Example}[chapter], whereby the examples would be numbered continuously (if I may say so…) throughout a chapter. – Bernard Feb 24 '14 at 8:44

You have a simple solution with the enumitempackage (no need to manually number the outer enumerate). The idea is just to close the enumerate environment at the end of the subsection and to open another one with the resume* option after the beginning of the next section:

        \documentclass[12pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage{enumitem}

\begin{document}

\subsection*{Instantaneous Velocity}

\begin{enumerate}[label =\textsf{\textbf{Example \arabic*. }}, wide,labelindent = 0pt]
\item The table below gives the position $s$ of a car at time $t$.

\begin{enumerate}
\item Find the average velocity over the following intervals.
\begin{enumerate}
\item $0 \leq t \leq 0.4$
\end{enumerate}
\item Estimate the instantaneous velocity at $t=0.4$.
\end{enumerate}
\end{enumerate}
\vfill

\subsection*{Defining Instantaneous Velocity Using the Idea of a Limit}

\begin{enumerate}[resume*]

\item  Yackety yack yack

\end{enumerate}
\vfill
\end{document}


-
Thanks Bernard! (I know we are not supposed to use comments to say "Thanks," but my Mom taught me better than that! – Randy Scott Feb 24 '14 at 5:08
– jmc Jun 11 '14 at 9:15
jmc, thanks for getting my right side! – Randy Scott Nov 15 '15 at 15:02