1

I have been trying to get an aligned environment inside an enumerate environment inside a theorem environment. Here is my MWE:

\documentclass[12pt,a4paper,oneside]{report}
\usepackage[left=2.00cm,right=2.00cm,top=2.45cm,bottom=2.5cm]{geometry}
\usepackage{amsmath,amssymb,amscd,color,enumitem}
\usepackage{fancyhdr,framed,latexsym,multicol,pstricks,slashed,xcolor}
\usepackage[amsmath,framed,thmmarks]{ntheorem}
\pagestyle{fancy}

\newtheorem{Theorem}{Theorem}

\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=blue,linecolor=black]}
\newshadedtheorem{them}[Theorem]{Theorem}

\theoremstyle{change}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\ast}}
\theoremseparator{}
\newtheorem{exam}{Example}

\title{Calculus Notes}
\author{}
\date{\today}
\begin{document}
\maketitle

\chapter{Limits}

\begin{exam}
\item \begin{align*}
    \lim\limits_{x\to c}(x^3+4x^2-3) &= \lim\limits{x\to c}x^3+4\lim\limits_{x\to c}x^2-\lim\limits_{x\to c}3\\
    &=c^3+4c^2-3
        \end{align*}

\item \begin{align*}
    \lim\limits_{x\to c}\dfrac{x^4+x^2-1}{x^2+5} &=     \dfrac{\lim\limits_{x\to c}(x^4+x^2-1)}{\lim\limits_{x\to c}(x^2+5)}\\
    &=\dfrac{c^4+c^2-1}{c^2+5}
       \end{align*}
\end{exam}

\end{document}

Compiles fine but no numbering within the example enviornment.

8
  • What exactly are supposed to be numbered here? (not at a pc so cannot test) – daleif Sep 7 '16 at 17:45
  • A starred environment is most cases not numbered! – user31729 Sep 7 '16 at 17:46
  • Besides those \limits commands are mostly unnecessary – daleif Sep 7 '16 at 17:46
  • The \item does nothing there apart from vertical spacing -- it is no enumerate etc.(it might be a trivlist, however), but that's not numbered as well – user31729 Sep 7 '16 at 17:47
  • Sorry, I missed the \begin{enumerate} under the \begin{exam}. Now it compiles fine, but: How can I get rid of the large spacing between the "numbers" of the enumerated list and the actual "content" of said list? Thanks! – Michael Dykes Sep 7 '16 at 18:00
1

I defined an eqenumerate environment, which does what you want, if I've well understood. Of course \item must be followed by a displayed equation environment. You may need a small vertical adjustment.

B.t.w., you don't have to load color nor xcolor if you load pstricks.

\documentclass[12pt,a4paper,oneside]{report}
\usepackage[left=2.00cm,right=2.00cm,top=2.45cm,bottom=2.5cm]{geometry}
\usepackage{amsmath,amssymb,amscd,enumitem}
\usepackage{fancyhdr,framed,latexsym,multicol,pstricks,slashed}
\usepackage[amsmath,framed,thmmarks]{ntheorem}
\pagestyle{fancy}

\newtheorem{Theorem}{Theorem}

\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=blue,linecolor=black]}
\newshadedtheorem{them}[Theorem]{Theorem}

\theoremstyle{change}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\ast}}
\theoremseparator{}
\newtheorem{exam}{Example}

\title{Calculus Notes}
\author{}
\date{\today}

\usepackage{etoolbox}
\newlist{eqenumerate}{enumerate}{1}
\setlist[eqenumerate,1]{label =\arabic*. , wide=1em, before={\leavevmode\setlength\abovedisplayskip{0pt}\apptocmd{\item}{\mbox{}\vspace{-\baselineskip}}{}{}}}   %

\begin{document}
\maketitle

\chapter{Limits}

\begin{exam}
  \begin{eqenumerate}
    \item \begin{align*}
    \lim\limits_{x\to c}(x^3+4x^2-3) &= \lim\limits{x\to c}x^3+4\lim\limits_{x\to c}x^2-\lim\limits_{x\to c}3\\
    &=c^3+4c^2-3
    \end{align*}
    \item\vspace*{-1.75ex} \begin{align*}   \lim_{x\to c}\dfrac{x^4+x^2-1}{x^2+5} &=   \dfrac{\lim\limits_{x\to c}(x^4+x^2-1)}{\lim\limits_{x\to c}(x^2+5)} \\
    &=\dfrac{c^4+c^2-1}{c^2+5}
    \end{align*}
  \end{eqenumerate}
\end{exam}

\end{document}

enter image description here

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.