1

I'm new with LyX, and need some help.
I'm trying to write homework, and every question is separate to a few "sub-question" (there is not "main" question - only 1.1, 1.2, 1.3...).
I success only to write it with a little space and new line like this:

1 
  (i)
  (ii)

and I'm trying to find a way to write it:

1 (i)
  (ii)
  (iii)

I sure that it's possible to do it with latex code, but I search for a way to do it in LyX.
Thank a lot

puhs
  • 33
  • 3

2 Answers2

1

Just nest enumerates as usual.

\documentclass{article}
\usepackage[shortlabels]{enumitem}
\begin{document}
\begin{enumerate}
    \item Hello
    \item Lorem lipsum
    \item \begin{enumerate}[(i)]
        \item This is a subitem
        \item Also this
    \end{enumerate}
    \item How about this?
\end{enumerate}
\end{document}

enter image description here

0

One very different option can be linguex:

mwe1

mwe2

Equivalent LaTeX code:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}
\let\oldalph\alph
\let\alph\roman
\renewcommand{\ExLBr}{} 
\renewcommand{\ExRBr}{.}
\renewcommand{\SubExLBr}{(} 
\renewcommand{\SubExRBr}{)}
\def\newex{\setcounter{ExNo}{0}\ex}
\usepackage{babel}

\begin{document}

Some text

\ex.\a. Foo (compact)\b.Foo\b.Foo\b.Foo

The end of parahraph ended the sublist.

You can have no enumerated text whitin main items.

\ex.\a.  Foo (spacied)\\
     \b. Foo\\
     \b. Foo\\
     \b. Foo

Now a new main list:

\newex.\a.  A new foo !\\
     \b. Foo\\
     \b. Foo\\
     \b. Foo\\

Some more text

\end{document}

To use this in LyX:

1) Add this to the LaTeX Preamble (menu Document → Configuration):

\usepackage{linguex}
% next lines are only to change the default format 
\let\oldalph\alph
\let\alph\roman
\renewcommand{\ExLBr}{} 
\renewcommand{\ExRBr}{.}
\renewcommand{\SubExLBr}{(} 
\renewcommand{\SubExRBr}{)}
% to sart a new list
\def\newex{\setcounter{ExNo}{0}\ex}

2) That is not mandatory but show better the example in the LyX screen, as showed here: Document → Configuration → Text design → Do not indent paragraphs but separate them with a vertical space.

3) To make a list una ERT box (Ctrl+L) an write \ex.\a. for first item a subitem, \b. for the following subitems.

Note that it matter a lot if you end each subitem typing the nest item code or with a break line, that is, after \\ (in a ERT box) or a Ctrl-Enter in Lyx, or with a end of paragraph (\par or blank line in LaTeX, Enter in LyX). Remember that a end paragraph end a sublist, but not the main list.

Run texdoc linguex for more information.

Fran
  • 80,769