5

Hello I saw this question here:
A five level deep list

My question is: How to do the same thing at LyX? It's doesn't work for me when I put the the code at the preamble...

 % Preview source code

%% LyX 2.2.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew]{article}
\usepackage[T1]{fontenc}
\usepackage[cp1255]{inputenc}
\setlength{\parindent}{0cm}
\usepackage{enumitem}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

% The following chunk fixes export with XeTeX.
% It is needed because polyglossia is used by default
% and \make@lr is only defined by babel.
\@ifundefined{make@lr}
{\def\make@lr#1{\begingroup
    \toks@=\expandafter{#1}%
    \edef\x{\endgroup
  \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
  \x}}{\relax}
\newlength{\lyxlabelwidth}      % auxiliary length 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

\setlist[enumerate,1]{label=(\arabic*)}
\setlist[enumerate,2]{label=(\Roman*)}
\setlist[enumerate,3]{label=(\Alph*)}
\setlist[enumerate,4]{label=(\roman*)}
\setlist[enumerate,5]{label=(\alph*)}
\setlist[enumerate,6]{label=(\arabic*)}
\setlist[enumerate,7]{label=(\Roman*)}
\setlist[enumerate,8]{label=(\Alph*)}
\setlist[enumerate,9]{label=(\roman*)}

\makeatother

\usepackage{babel}
\begin{document}
\begin{enumerate}
\item {\beginL 32132\endL}
\begin{enumerate}
\item {\beginL 4332234\endL}
\begin{enumerate}
\item {\beginL 432\endL}
\begin{enumerate}
\item {\beginL 423423\endL}
\begin{enumerate}
\item {\beginL 432432\endL}
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{enumerate}

\end{document}

Thank you!!

5

You need to "update" the definition of enumerate it seems, see Mark's answer to the question you refer to. If I add

\usepackage{enumitem}
\setlistdepth{9}
\renewlist{enumerate}{enumerate}{9}
\setlist[enumerate,1]{label=(\arabic*)}
\setlist[enumerate,2]{label=(\Roman*)}
\setlist[enumerate,3]{label=(\Alph*)}
\setlist[enumerate,4]{label=(\roman*)}
\setlist[enumerate,5]{label=(\alph*)}
\setlist[enumerate,6]{label=(\arabic*)}
\setlist[enumerate,7]{label=(\Roman*)}
\setlist[enumerate,8]{label=(\Alph*)}
\setlist[enumerate,9]{label=(\roman*)}

to the preamble (note the \renewlist on the second line), it works fine here. The preview in LyX doesn't work, but the PDF is fine.

Note that instead of explicitly adding \usepackage{enumitem} you could add the Customisable lists (enumitem) module, as it looks like you have done in the code you show.

enter image description here

  • Doesn't work for me :( There are many errors - here is the first: ! Undefined control sequence. l.36 \setlistdepth {9} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. – heblyx Dec 3 '16 at 16:08
  • 1
    @Yoar Oops, I forgot to say I added the Customized lists (enumitem) module. Sorry, took that as a given. But alternatively, just add \usepackage{enumitem} before \setlistdepth. – Torbjørn T. Dec 3 '16 at 16:09
  • 1
    @Yoar Oh, just realized another possible cause of that problem: the \setlistdepth macro was added in version 3.0 of enumitem, so if you have an older version, then it wouldn't work. – Torbjørn T. Dec 3 '16 at 16:16
  • Now it's works!! – heblyx Dec 3 '16 at 16:16

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.