# Lyx: add space before figure title in list of figures

How to add space before figure titles in list of figures ?
I'm using LyX Version 2.3.0

Adding the following code to the preamble yields the following error

``````\usepackage{tocloft}
\setlength{\cftfignumwidth}{4em}
``````

For future reference: these two lines of code must be added at the very top of the preamble otherwise, the previous error might appear.

• Welcome to TeX.SX! Spacing before ToC, ToF, ToT, Bib – Bobyandbob May 28 '18 at 9:53
• Your note for future reference is likely a bit misleading, because I think that depends entirely on what else you have there in the first place. I should have asked about that before posting my answer. You obviously have something conflicting with `tocloft`, so it's possible that `tocloft` is not the best solution. What did you have there? – Torbjørn T. May 28 '18 at 10:21
• @TorbjørnT. that's what my document's preamble looks like: `\usepackage{tocloft} \setlength{\cftfignumwidth}{4em} \usepackage[caption=false,font=footnotesize]{subfig} \usepackage[]{algorithm2e} \usepackage{amsfonts} \usepackage[format=hang,font=small,labelfont=bf]{caption} \usepackage{arabtex} \usepackage{utf8} \usepackage[dvipsnames]{xcolor} \definecolor{RoyalBlue}{cmyk}{1, 0.50, 0, 0} \usepackage{tikz}` – Stoufa May 29 '18 at 22:50
• Right, the problem was with `subfig`. Use `\usepackage[subfigure]{tocloft}` instead of `\usepackage{tocloft}`. `tocloft` will then take extra steps to not conflict with the `subfigure` and `subfig` packages. (Similar to tex.stackexchange.com/questions/336617/.) – Torbjørn T. May 30 '18 at 8:23
• @TorbjørnT. Indeed, with `\usepackage[subfigure]{tocloft}`, the spacing works even if I add it at the end of the preamble, thanks. – Stoufa May 30 '18 at 9:57

``````\usepackage{tocloft}