我正在尝试使用嵌套枚举块来获取按字母顺序排列的列表,当嵌套块不在引用块中时,它会抛出错误(!LaTeX 错误:出现问题 - 可能缺少 \item)。我想删除引用块,这样列表就不会缩进太多。非常感谢任何帮助,谢谢。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%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}^5\sqrt{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}
答案1
认为这就是你要找的东西
\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}^5\sqrt{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}