Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

Thanks for your help,

Randy Scott, Santiago Canyon College, Orange, CA

share|improve this question
1  
With \usepackage{mdwlist} you can \suspend an enumeration and then \resume it. This may help. –  Ethan Bolker Feb 23 at 16:56
3  
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 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 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 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 at 8:44

1 Answer 1

up vote 4 down vote accepted

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}

enter image description here

share|improve this answer
    
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 at 5:08
    
xkcd.com/859 ) –  jmc Jun 11 at 9:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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