5

I am trying to create a list that will look like this:

  1. Something
    1a) apple
    1b) pear
    1c) banana
  2. Something
    2a)

This is the code I have now, but apparently it does not automatically change the "1" in "1a)". I have done some searching but did not find what I wanted.

\documentclass[10pt, twocolumn]{article}
\usepackage{paralist}

\begin{document}
\begin{inparaenum}[\bfseries 1a\upshape)]
    \item
    \item
\end{inparaenum}
\end{document}

Thanks

1
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. You might also want to add to your question how you're including the pdfs etc.
    – Aradnix
    Sep 19, 2014 at 1:43

3 Answers 3

6

[Edit I realised that using easylist is easier than enumitem:)]

I am assuming that you want to define an environment inparaenum that behaves like this. The easiest way to do this is (probably) using the easylist package:

\documentclass{article}
\usepackage[at]{easylist}% easy lists with @ starting each item

\begin{document}

\begin{easylist}
  \ListProperties(Style1*=\bfseries,Numbers2=l,Mark1={},Mark2={)},Indent2=1em)
  @ Something
  @@ apple
  @@ pear
  @@ banana
  @ Something
  @@ Frogs
\end{easylist}

\end{document}

This produces the list:

enter image description here

Another, more standard, alternative is to use the enumitem package:

\documentclass{article}
\usepackage{enumitem}

\newlist{inparaenum}{enumerate}{2}% allow two levels of nesting in an enumerate-like environment
\setlist[inparaenum]{nosep}% compact spacing for all nesting levels
\setlist[inparaenum,1]{label=\bfseries\arabic*.}% labels for top level
\setlist[inparaenum,2]{label=\arabic{inparaenumi}\emph{\alph*})}% labels for second level

\begin{document}

\begin{inparaenum}
  \item Something
  \begin{inparaenum}
    \item apple
    \item pear
    \item banana
  \end{inparaenum}
  \item Something
  \begin{inparaenum}
    \item Frogs
  \end{inparaenum}
\end{inparaenum}

\end{document}

This produces the expected list:

enter image description here

6

In this case you can easily create what you want using nested environments, you can use the enumerate environment for that, but in the inside one instead of use \item you can use \item[1 a)] for do it in a more explicit way. From your own MWE:

\documentclass[10pt, twocolumn]{article}
\begin{document}
\begin{enumerate}
    \item Something
    \begin{enumerate}
         \item[1 a)] apple
         \item[1 b)] pear
         \item[1 c)] banana
     \end{enumerate}
    \item Something more
    \begin{enumerate}
         \item[2 a)] watermelon
    \end{enumerate}
\end{enumerate}
\end{document}

Try the code above where you can see the nested environment I told you before. I don't know the environment inparaenum, so probably you forgot to load the package that defines it or you omit the code where you defined it in the preamble.

Anyway, you can also make your own style with the description environment or use the enumitem package. I'm almost sure that you can find here the answer, this seems not to be the first time I read the question.

1

A short solution with package enumitem:

\documentclass{article}
\usepackage{enumitem}
\begin{document}

 \begin{enumerate}

  \item Kisertet
   \begin{enumerate}[label=\theenumi\alph*)]
    \item jarja
    \item be
    \item Europat
   \end{enumerate}

   \item a
   \begin{enumerate}[label=\theenumi\alph*)]
    \item kommunizmus
    \item kisertete.
   \end{enumerate}

 \end{enumerate}

\end{document}

enter image description here

With enumitem you can configure the item labels: \theenumi reads out the counter of the highest level, \alph* converts the next level counter into a,b,c...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .