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.
Best Answer
You have a simple solution with the
enumitem
package (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 theresume*
option after the beginning of the next section: