TransWikia.com

Throws an missing item error when I try to use a nested enumerate to have an alphabetical list

TeX - LaTeX Asked by user203697 on November 27, 2020

I am trying to use a nested enumerate block to have an alphabetical list and it throws an error (! LaTeX Error: Something’s wrong–perhaps a missing item) when the nested block isn’t in a quote block. I want to remove the quote block so the lists aren’t indented as far. Any help is much appreciated, thank you.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Do not alter this block of commands.  If you're proficient at LaTeX, you may include additional packages, create macros, etc. immediately below this block of commands, but make sure to NOT alter the header, margin, and comment settings here. 
documentclass[12pt]{article}
 usepackage[margin=1in]{geometry} 
usepackage{amsmath,amsthm,amssymb,amsfonts, enumitem, fancyhdr, color, comment, graphicx, environ}
AtBeginDocument{
  thispagestyle{fancy}% First page
  pagestyle{empty}% Other pages
}
setlength{headheight}{65pt}
newenvironment{problem}[2][Problem]{begin{trivlist}
item[hskip labelsep {bfseries #1}hskip labelsep {bfseries #2.}]}{end{trivlist}}
newenvironment{sol}
    {emph{Solution:}
    }
    {
    qed
    }
specialcomment{com}{ color{blue} textbf{Comment:} }{color{black}} %for instructor comments while grading
NewEnviron{probscore}{marginpar{ color{blue} tiny Problem Score: BODY color{black} }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Fill in the appropriate information below
lhead{Student Name}  %replace with your name
rhead{XYZ} %replace XYZ with the homework course number, semester (e.g. ``Spring 2019"), and assignment number.
 chead{textbf{Large Homework 0}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

setlength{parindent}{0in}
%Do not alter this block.
begin{document}

%BLOCK 1
%Copy the following block of text for each problem in the assignment.
textbf{Exercise 0.1:} Sigma notation review: Write the sum in expanded form:
begin{quote}
begin{enumerate}
begin{enumerate}
item $sum_{i=1}^5sqrt{i}=boxed{sqrt{1}+sqrt{2}+sqrt{3}+sqrt{4}+sqrt{5}}$
item $sum_{i=1}^ni^10=boxed{1^10+2^10+3^10+cdots+n^10}$
item $sum_{i=0}^{n-1}(-1)^i=boxed{(-1)^0+(-1)^1+(-1)^2+cdots+(-1)^{n-1}}$
item $sum_{j=0}^{n+3}j^2=boxed{0^2+1^2+2^2+cdots+j^2}$
end{enumerate}
end{enumerate}
end{quote}

%BLOCK 2
%Copy the following block of text for each problem in the assignment.
textbf{Exercise 0.2:} Sigma notation review: Write the sum in sigma notation:

begin{enumerate}
begin{enumerate}
item $1 + 2 + 3 + 4 + 5 + 6 +cdots+ 10=boxed{sum_{i=1}^{10}i}$
item $ 2 + 4 + 6 + 8 +cdots+2n=boxed{sum_{i=1}^{n}2i}$
item $1 +x+x^2+x^3+cdots+x^n=boxed{sum_{i=0}^nx^i}$
item $1 + 2x+3x^2+4x^3+cdots+(n-1)x^n=boxed{sum_{i=2}^n(n-1)x^n}$
end{enumerate}
end{enumerate}


%BLOCK 3
%Copy the following block of text for each problem in the assignment.
textbf{Exercise 0.3:} Factorial review: What is the factorial function? What notation is used for this function?
\ A factorial function uses the notation $``x!"$ and is equivalent to $prod_{i=0}^{x-1}(x-i)$.

end{document}

One Answer

Thinks, this is what you are looking for

documentclass[12pt]{article}
 usepackage[margin=1in]{geometry} 
usepackage{amsmath,amsthm,amssymb,amsfonts, enumitem, fancyhdr, color, comment, graphicx, environ}
AtBeginDocument{
  thispagestyle{fancy}% First page
  pagestyle{empty}% Other pages
}
setlength{headheight}{65pt}
newenvironment{problem}[2][Problem]{begin{trivlist}
item[hskip labelsep {bfseries #1}hskip labelsep {bfseries #2.}]}{end{trivlist}}
newenvironment{sol}
    {emph{Solution:}
    }
    {
    qed
    }
specialcomment{com}{ color{blue} textbf{Comment:} }{color{black}} %for instructor comments while grading
NewEnviron{probscore}{marginpar{ color{blue} tiny Problem Score: BODY color{black} }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Fill in the appropriate information below
lhead{Student Name}  %replace with your name
rhead{XYZ} %replace XYZ with the homework course number, semester (e.g. ``Spring 2019"), and assignment number.
 chead{textbf{Large Homework 0}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

setenumerate{itemsep=3pt,topsep=3pt,leftmargin=1in}
setlength{parindent}{0in}
%Do not alter this block.
begin{document}

%BLOCK 1
%Copy the following block of text for each problem in the assignment.
textbf{Exercise 0.1:} Sigma notation review: Write the sum in expanded form:
%begin{quote}
%begin{enumerate}
begin{enumerate}[label=(alph*)]
item $sum_{i=1}^5sqrt{i}=boxed{sqrt{1}+sqrt{2}+sqrt{3}+sqrt{4}+sqrt{5}}$
item $sum_{i=1}^ni^10=boxed{1^10+2^10+3^10+cdots+n^10}$
item $sum_{i=0}^{n-1}(-1)^i=boxed{(-1)^0+(-1)^1+(-1)^2+cdots+(-1)^{n-1}}$
item $sum_{j=0}^{n+3}j^2=boxed{0^2+1^2+2^2+cdots+j^2}$
end{enumerate}
%end{enumerate}
%end{quote}

%BLOCK 2
%Copy the following block of text for each problem in the assignment.
textbf{Exercise 0.2:} Sigma notation review: Write the sum in sigma notation:

%begin{enumerate}
begin{enumerate}[label=(alph*)]
item $1 + 2 + 3 + 4 + 5 + 6 +cdots+ 10=boxed{sum_{i=1}^{10}i}$
item $ 2 + 4 + 6 + 8 +cdots+2n=boxed{sum_{i=1}^{n}2i}$
item $1 +x+x^2+x^3+cdots+x^n=boxed{sum_{i=0}^nx^i}$
item $1 + 2x+3x^2+4x^3+cdots+(n-1)x^n=boxed{sum_{i=2}^n(n-1)x^n}$
end{enumerate}
%end{enumerate}


%BLOCK 3
%Copy the following block of text for each problem in the assignment.
textbf{Exercise 0.3:} Factorial review: What is the factorial function? What notation is used for this function?
\ A factorial function uses the notation $``x!"$ and is equivalent to $prod_{i=0}^{x-1}(x-i)$.

end{document}

enter image description here

Answered by Samjith on November 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP