在 inparaenum 环境中中断后,如何\begin{inparaenum}
以任意字母(除 a) 之外)开头。我想让新的 inparaenum 环境与前一个环境的结尾相关。
\documentclass[14pt,a4paper,headlines=6,headinclude=true]{scrartcl}
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage{paralist}
\usepackage{tabto}
\begin{document}
\begin{enumerate}
\item \textbf{Working with logarithms}:
\NumTabs{3}
\begin{inparaenum}[a)]
Calculate the following
\item $\ln 1 = $
\tab \item $\ln e = $
\tab \item $\ln \frac{1}{e} = $
\end{inparaenum}
Express the following in terms of $\ln 2$:
\NumTabs{3}
\begin{inparaenum}[d)]
\item $\ln 4$
\tab \item $\ln \sqrt[3]{2^5}$
\tab \item $\ln \frac{1}{16} $
\end{inparaenum}
\end{enumerate}
\end{document}
有没有办法让第二行以 d 开头,而不是在所有位置都使用 d?非常感谢 :)
答案1
您可以手动设置数字;因为它是二级列表,所以您必须设置enumii
。
\documentclass[14pt,a4paper,headlines=6,headinclude=true]{scrartcl}
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage{paralist}
\usepackage{tabto}
\begin{document}
\begin{enumerate}
\item \textbf{Working with logarithms}:
\NumTabs{3}
\begin{inparaenum}[a)]
Calculate the following
\item $\ln 1 = $
\tab \item $\ln e = $
\tab \item $\ln \frac{1}{e} = $
\end{inparaenum}
Express the following in terms of $\ln 2$:
\NumTabs{3}
\begin{inparaenum}[a)]\setcounter{enumii}{3}
\item $\ln 4$
\tab \item $\ln \sqrt[3]{2^5}$
\tab \item $\ln \frac{1}{16} $
\end{inparaenum}
\end{enumerate}
\end{document}
你也可以使用enumitem
:
\documentclass[14pt,a4paper,headlines=6,headinclude=true]{scrartcl}
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage[inline]{enumitem}
\usepackage{tabto}
\begin{document}
\begin{enumerate}
\NumTabs{3}
\item \textbf{Working with logarithms}:
Calculate the following\\[\medskipamount]
\begin{enumerate*}[label=\alph*),itemjoin=\tab,before={}]
\item $\ln 1 = $
\item $\ln e = $
\item $\ln \frac{1}{e} = $
\end{enumerate*}
Express the following in terms of $\ln 2$:\\[\medskipamount]
\begin{enumerate*}[label=\alph*),itemjoin=\tab,resume]
\item $\ln 4$
\item $\ln \sqrt[3]{2^5}$
\item $\ln \frac{1}{16} $
\end{enumerate*}
\end{enumerate}
\end{document}
答案2
另一个版本,使用我的assoccnt
包,无需记住计数器值:
计数器contenumii
用于自动存储计数器总值enumii
,并在计数结束后存回inparaenum
。
警告:每次使用另一个二级枚举时,它将递增
然后使用包\SuspendCounters
中的功能assoccnt
\documentclass[14pt,a4paper,headlines=6,headinclude=true]{scrartcl}
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage{paralist}
\usepackage{tabto}
\usepackage{assoccnt}
\newcounter{contenumii}
\DeclareAssociatedCounters{enumii}{contenumii}
\begin{document}
\begin{enumerate}
\item \textbf{Working with logarithms}:
\NumTabs{3}
\begin{inparaenum}[a)]
Calculate the following
\item $\ln 1 = $
\tab \item $\ln e = $
\tab \item $\ln \frac{1}{e} = $
\end{inparaenum}
Express the following in terms of $\ln 2$:
\NumTabs{3}
\begin{inparaenum}[a)]\setcounter{enumii}{\number\value{contenumii}}
\item $\ln 4$
\tab \item $\ln \sqrt[3]{2^5}$
\tab \item $\ln \frac{1}{16} $
\end{inparaenum}
\end{enumerate}
\end{document}
其他选项:enumitem
包,有resume
选项,但这个不太紧凑paralist
(最初,也许可以改变)
答案3
我知道这是一个很晚的答案,但我发现这对我有用:
% Counter used in continuing lists.
\newcounter{contlist}
% ...
\begin{inparaenum}[(a)]
\item line-item 1
\item line-item 2
\end{inparaenum}
\setcounter{contlist}{\value{enumi}}
% ...
\begin{inparaenum}[(a)]
\setcounter{enumi}{\value{contlist}}
\item line-item 3
\item line-item 4
\end{inparaenum}
这适用于不同的枚举样式[1、(b)、(iii)等]。