Go to page:

Search:   Help



LyX documentation


Shared groups




Categories: FAQ, Spacing
<< | Page list | >>

Frequently Asked Question about adjusting spacing in LyX

§ How do I reduce the vertical space in itemize and enumerate listings?

For individual lists, you'll have to do this by hand: for example, for one particular list, you can add the following LaTeX code at the beginning of the list:


The numerical parameter is an elastic distance and is added to the normal paragraph spacing (\parsep). Thus, to completely avoid spacing between items, use {-1\parsep} instead of {0mm}, and {-0.5\parsep} for half spacing. (Also, in my LyX 2.0.0, the ERT has to be inside the explanation part of the description list, so don't read "at the beginning" overly strictly.)

If you want to change the spacing globally, read on:

  • A very comfortable solution to configure any space in itemize, enumeration and description lists is the Enumitem LyX module. It makes use of package enumitem. Read its docs for details.
  • Otherwise, to reduce the length in all enumerate and itemize lists, add the following to the preamble (tested in Lyx 2.0.3 - works well. Note, this paragraph previously suggested to to also have "\setlength{\parsep}{0pt}" after "\setlength{\itemsep}{0pt}". This did nothing for me.)

§ How do I insert a fixed amount of horizontal space?

LaTeX offers a range of predefined horizontal spaces: \enspace (1/2 em), \thinspace (1/6 em), \negthinspace (-1/6 em), \quad (1 em), \qquad (2 em), etc. An "em" is roughly the width of the letter "m" in the current font.

As of version 1.4, LyX supports all these natively. You can insert them via the minibuffer, i.e. with the shortcut M-x space-insert <spacetype>, where <spacetype> is the LaTeX command without the backslash. As of LyX 1.6, there's also a menu entry and a dialog (Insert→Formatting→Horizontal Space...,).

With LyX < 1.4, you have to insert the LaTeX commands with ERT.

For customized lengths, LaTeX has the \hspace command, which takes any valid TeX length as its argument; units can be mm (millimeters), cm (centimeters), in (inches), pt (points = 1/72 inch), em (width of letter "m"), or ex (height of letter "x"). Examples: \hspace{1in}, \hspace{2.5em}, etc. This is supported natively as of LyX 1.6 (Insert→Formatting→Horizontal Space..., select Custom). In earlier versions of LyX, you have to use ERT.

§ How can I add a thin space?

Is there any possibility to insert this small separating space (i.e. the latex: \,) via keyboard and without ERT?

Use C-S-<Space>, Insert>Formatting>half space or M-x space-insert thin. (Requires LyX >=1.4)

§ How can I add "invisible" vertical and/or horizontal distances

  • \vphantom{\int_a^b} produces a vertical space (0 width) which height is exactly the height of its argument. Assuming that the integral is what forces the ] size, it gives the right result.
  • \hphantom{z+\exp[} does exactly the same but produces an horizontal space.

More tweaking might be needed for this equation, but I think it explains the trick. There is also a \phantom{} which sets both height and width.

§ Why is Spacing: OneHalf not the same as Spacing: Custom: 1.5?

Spacing OneHalf is a predefined spacing provided by the setspace package (LaTeX: \onehalfspacing). It is defined as being 1.5 * line height. So, in a document with 10pt base font size, spacing OneHalf means the line spacing is 15pt. Line spacing thereby means the empty space between the lines [leading] plus the line height. So you have a leading of 5pt in this case.

However, spacing Single (LaTeX: \singlespacing) does not mean 1 * line height. If it would, there would be zero leading, and the lines would just sit on top of each other, which would obviously result in unreadable text. Single spacing is usually ca. 1.2 * line height (the precise value depends on the font size).

This means, consequently, that OneHalf is not 1.5 * Single, but rather ca. 1.2 * Single (again, depending on the font size).

The custom value, as opposed to that, is a real multiplicator of Single. So if you want a line spacing value of 1.5 * singlespacing, use line spacing "Custom: 1.5".

Confused? Blame the author of the setspace package ;-)

FAQ Spacing

<< | FAQ.PageList | >>

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2012-09-04 21:42 CEST