> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/formatting/01-lengths-in-latex.md).

# Lengths in LaTeX

In LaTeX there are a lot of lengths determining various dimensions of prepared documents. For example, specified dimension parameters characterize [fonts](/latex/fonts/01-font-sizes-families-and-styles.md), [pages](/latex/formatting/07-page-size-and-margins.md), or [paragraphs](/latex/formatting/04-articles-how-to-change-paragraph-spacing-in-latex.md).

## Units

Below a description of available units in LaTeX.

| Abbreviation | Value                                                                                                                                                                             |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pt**       | a point is approximately 1/72.27 inch, that means about 0.0138 inch or 0.3515 mm (exactly point is defined as 1/864 of American *printer’s foot* that is 249/250 of English foot) |
| **mm**       | a millimeter                                                                                                                                                                      |
| **cm**       | a centimeter                                                                                                                                                                      |
| **in**       | inch                                                                                                                                                                              |
| **ex**       | roughly the height of an 'x' (lowercase) in the current font (it depends on the font used)                                                                                        |
| **em**       | roughly the width of an 'M' (uppercase) in the current font (it depends on the font used)                                                                                         |
| **mu**       | math unit equal to 1/18 em, where em is taken from the math symbols family                                                                                                        |
| **sp**       | so-called "special points", a low-level unit of measure where 65536sp=1pt                                                                                                         |

Below an example that shows the difference between ex and em units.

```latex
\documentclass[twocolumn]{article}
\usepackage{blindtext}
\usepackage{graphicx}

\setlength{\columnsep}{1in}

\begin{document}

A width of \texttt{10ex} produces:

\includegraphics[width=10ex]{overleaf-logo}
\vspace{5mm}

A width of \texttt{10em} produces:

\includegraphics[width=10em]{overleaf-logo}

\end{document}
```

![LengthsEx1OverleafUpdated.png](/files/Vb5dVJMQgamFMgoM4oQm)

[Open an example in Overleaf](https://www.overleaf.com/project/new/template/19506?id=65960656\&templateName=Length+types+and+values+in+LaTeX\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

## Lengths

Lengths are units of distance relative to some document elements. Lengths can be changed by the command:

```latex
\setlength{\lengthname}{value_in_specified_unit}
```

For example, in a two-column document the column separation can be set to 1 inch by:

```latex
\setlength{\columnsep}{1in}
```

![LengthsEx2.png](/files/g6ZbSDcANx7QAJtZCvbN)

Below is a table with some of the most common lengths and their description

| Length            | Description                                                              |
| ----------------- | ------------------------------------------------------------------------ |
| `\baselineskip`   | Vertical distance between lines in a paragraph                           |
| `\columnsep`      | Distance between columns                                                 |
| `\columnwidth`    | The width of a column                                                    |
| `\evensidemargin` | Margin of even pages, commonly used in two-sided documents such as books |
| `\linewidth`      | Width of the line in the current environment.                            |
| `\oddsidemargin`  | Margin of odd pages, commonly used in two-sided documents such as books  |
| `\paperwidth`     | Width of the page                                                        |
| `\paperheight`    | Height of the page                                                       |
| `\parindent`      | Paragraph indentation                                                    |
| `\parskip`        | Vertical space between paragraphs                                        |
| `\tabcolsep`      | Separation between columns in a table (tabular environment)              |
| `\textheight`     | Height of the text area in the page                                      |
| `\textwidth`      | Width of the text area in the page                                       |
| `\topmargin`      | Length of the top margin                                                 |

[Open an example in Overleaf](https://www.overleaf.com/project/new/template/19506?id=65960656\&templateName=Length+types+and+values+in+LaTeX\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

## Using lengths as units

Default lengths can be set to any desired value up to a maximum of approximately 16384pt (or 5.75 metres), a hard-coded limit built into TeX engines. LaTeX's length parameters can also be used as units to set the dimensions of other LaTeX elements. For instance, you can set an image to have a width of one quarter the total text width:

```latex
\includegraphics[width=0.25\textwidth]{overleaf-logo}
[...]
```

![LengthsEx3OverleafV2.png](/files/ckaxROnFYPstrYCaNq7s)

In the command `\includegraphics` the width is set to 0.25 the width of the entire text area (see [Inserting Images](/latex/more-topics/27-inserting-images.md) for more information about this command). You can use any length and multiply it by any factor.

[Open an example in Overleaf](https://www.overleaf.com/project/new/template/19506?id=65960656\&templateName=Length+types+and+values+in+LaTeX\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

## Further reading

For more information see [the article about lengths on wikibooks](http://en.wikibooks.org/wiki/LaTeX/Lengths).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/formatting/01-lengths-in-latex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
