10

How can I start \begin{inparaenum} with an arbitrary letter (other than a)) after a break in the inparaenum-environment. I would like to let a new inparaenum-environment be related to the end of the earlier one.

\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}

Is there a way to let the second row start with d instead of using d in all positions? Thank you very much :)

enter image description here

  • The \begin{inparamenum}[d)] is wrong and the compiler complains about it ;-) – user31729 Apr 8 '15 at 8:24
11

You can set the number by hand; since it's a second level list, you have to set 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}

enter image description here

You can use, instead, 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}

enter image description here

  • The \setcounter{enumii}{3} works fine as long as I stay in the upper enumerate-environment. Doesn't work in a new enumerate-inparaenum-environment. But that's ok for the moment. Thank you – Mac Apr 8 '15 at 8:43
  • @Mac: This deliberately depends on the nesting of the environments – user31729 Apr 8 '15 at 10:10
  • 3
    @Mac I suggest you to switch to enumitem, that's much more powerful than paralist. – egreg Apr 8 '15 at 10:40
6

Another version, using my assoccnt package, without the need of remembering the counter value:

The contenumii counter is used to store the total value of the enumii counter automatically and stored back after inparaenum.

Caveat: It will be incremented each time when another second level enumeration is used

Use the \SuspendCounters feature from the assoccnt package then

\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}

Other options: enumitem package, with the resume option, but this is not as compact as paralist (initially, can be changed, perhaps)

  • I cannot compile this.. it says assoccnt.sty not found. Somehow not loading the new package. I'm not sure what to do about it. But thanks for the idea :) – Mac Apr 8 '15 at 8:46
  • @Mac: No problem at all... but it's on TeXLive and CTAN of course – user31729 Apr 8 '15 at 8:48
  • That means I have to load it manually? I'm used to let this be done by TexnicCenter. I'm still looking for how to force my editor do this – Mac Apr 8 '15 at 8:58
  • @Mac: I don't use those editor stuff like TexnicCenter etc. I update manually all the time (daily!) by invoking tlmgr on a Linux console – user31729 Apr 8 '15 at 9:11
  • @ChristianHupfer Daily?! Why? – cfr Apr 9 '15 at 2:54
1

I know it's a very late answer, but I found this to work for me:

% 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}

This works across different styles of enumerations [1, (b), (iii), etc].

  • 1
    Welcome to TeX.SX! The other answers are also applicable to other styles, so how does this add anything new? – TeXnician Oct 7 '18 at 13:44
  • It answers the original question, and doesn't need hand-coding. Nor does it need other styles/environments. – sn00p Oct 10 '18 at 10:58

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.