LyXReserve more Space for Numbers in LoF

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
happygoron
Posts: 2
Joined: Wed Sep 19, 2012 9:24 pm

Reserve more Space for Numbers in LoF

Post by happygoron »

Hello,

I have a small issue with the LoF in my document. When the figure number goes above a certain number of characters it overlaps with the figure caption. I have been unable to find a way of altering the margins for the figure list. Is there a way to shift the figure captions across by a mm or two?

I have attached an example image from my PDF.

Many thanks in advance for your help,
Neil
Attachments
LoF-Error.png
LoF-Error.png (13.14 KiB) Viewed 3767 times
Last edited by localghost on Wed Sep 19, 2012 9:47 pm, edited 1 time in total.
Reason: Images are scaled appropriately to maintain the forum format (see Board Rules).

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Reserve more Space for Numbers in LoF

Post by cgnieder »

Hi Neil,

Welcome to the LaTeX community!

How are you creating your LoF? Are you using a standard class or custom class? Du you use packages that modify it… You'll get the fastest and best help if you provide us with a Infominimal working example, that is a code part that can be copied and compiled as is without having to add \documentclass and that contains all necessary but no unnecessary parts to describe the essential parts of the problem. Have a look at the link for more information.

Regards
site moderator & package author
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reserve more Space for Numbers in LoF

Post by localghost »

Search the forum for solutions by tocloft or take a look at the "Similar Topics" on the bottom of this page (only when logged in). Even in LyX it should be possible to include this package. For details regarding package inclusion consult the LyX help or its documentation.


Best regards and welcome to the board
Thorsten
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: Reserve more Space for Numbers in LoF

Post by cgnieder »

Boff! It completely escaped my attention that the question is posted in the LyX forum :( (which doesn't disqualify my answer but still...)
site moderator & package author
happygoron
Posts: 2
Joined: Wed Sep 19, 2012 9:24 pm

Reserve more Space for Numbers in LoF

Post by happygoron »

Hi,

Many thanks for your help guys. After a very frustrating morning that led to me having to update miktex and swear a lot as I couldn't get the tocloft commands to work properly I found this page trying to get that working:

http://staff.washington.edu/fox/tex/uwthesis.shtml

On this it gives the following command to edit the width for the section numbers:

Code: Select all

\makeatletter
\renewcommand*\l@figure{\setlength\@tempdima{2.3em}%
    \@dottedtocline{1}{1.5em}{\@tempdima}}
\makeatother
Where the 2.3 is default. This worked! Maybe hiding from learning latex properly by using lyx wasn't the greatest idea...

Many thanks for your help nonetheless.
Last edited by cgnieder on Thu Sep 20, 2012 6:08 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reserve more Space for Numbers in LoF

Post by localghost »

The code you presented turns the same set screw as tocloft does. So if you manage to insert this code into your document preamble, you should also manage to insert the following.

Code: Select all

\usepackage{tocloft}
\setlength{\cftfignumwidth}{4em}    % choose an appropriate length here
happygoron wrote:[…] Maybe hiding from learning latex properly by using lyx wasn't the greatest idea. […]
Good insight.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Reserve more Space for Numbers in LoF

Post by cgnieder »

I recently learned that LyX users can insert TeX code into the document directly with what they call ERT (“evil red text”). I also learned that you can add arbitrary code to the preamble via Document > Settings... > LaTeX Preamble.

Regards
site moderator & package author
Post Reply