1

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

enter image description here

Adding the following code to the preamble yields the following error

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

enter image description here

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
1

Try going to Document --> Settings --> LaTeX preamble and add

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

Adjust the length 4em to something appropriate for your case.

  • This worked fine, the error appeared when I added these lines at the end of the preamble. when I added them at the very top, it worked, thanks. – Stoufa May 28 '18 at 10:13

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.