# Horizontal Line Options in LaTeX 2022: Inserting Horizontal/Vertical Lines

– Horizontal Line Options in LaTeX –

Horizontal Line Options in LaTeX: LaTeX, an open-source document preparation, and typesetting program, provides an alternative approach compared with a traditional word processor to word processing.

Instead of having a collection of graphical buttons and showing the results immediately after an edit.

LaTeX documents contain programming commands that define how a document looks, and are typically given several options that allow the writer to customize the look exactly as they like.

The five different options for drawing horizontal lines in LaTeX are a good example of this.

### What is LaTeX?

LaTeX is a typesetting system and an open-source preparation of documents. This system specifies how a document looks with the help of its programming commands.

Other word processor shows graphical buttons to choose from and give the result right after an edit. LaTeX gives multiple options to users on how they wanted their document to look.

### Options/ Commands for LaTeX Horizontal Lines:

#### \hline

The command “\hline” is the simplest of the horizontal line options in LaTeX and, most of the time, it is the one you want.

It will simply draw a horizontal line between the paragraphs that proceed and follow it when the document is rendered. This also means that, of course, if “\hline” is used in mid-paragraph, then it will force a break in paragraphs.

#### \rule

The “\rule{length}{thickness}” command provides a little more power than the ordinary “\hline.”

First, the rule does not force a break between paragraphs: it is acceptable to use a rule mid-paragraph if that is the effect you desire.

Second, you can specify two arguments for the rule. The first is the length of the line, and the second is the thickness of the line. Both require a unit to be used, such as “cm” (centimeter) or “pt” (points).

#### \line

The LaTeX “\line(x,y){length}” allows you to draw a line segment anywhere on the page you like, horizontal or otherwise.

The line will have the length defined in the length argument and the slope (x,y). A 10-centimeter horizontal line would be “\line(0,0){10 cm}.” We can only use it within the “LaTeX picture” environment.

#### \dotfill

The “\dotfill” command allows you to draw a line of dots. This creates a “rubber” space that will have a minimum size of a few dots but will expand as needed to fill the available horizontal space.

This is useful for defining a table of contents where the chapter title is left justified, the page number right justified and the space between contains the “\dotfill” command to fill it with dots.

However, it can draw a horizontal line of dots across the page if the “” new paragraph command follows it.

#### \hrulefill

The “\hrulefill” command has the same functionality as the “\dotfill” command, except it will fill the available space with the “horizontal rule,” a thin line along the bottom of the text.

## Vertical blank spaces

Vertical blank spaces have the same syntax as horizontal ones.: Let’s see the two commands that insert vertical blank spaces.

#### \vspace{5mm}

Insert vertical spaces whose length is 5mm. We can use other LATEX units with this command.

#### \vfill

Inserts a blank space that will stretch accordingly to fill the vertical space available. That’s why the line “Text at the bottom of the page.” is moved to the bottom, and it fill the rest of the space in.

There are other three commands commonly used to insert vertical blank spaces:

#### \smallskip

Adds a 3pt space plus or minus 1pt depending on other factors (document type, available space, etc)

#### \medskip

Adds a 6pt space plus or minus 2pt depending on other factors (document type, available space, etc)

#### \bigskip

Adds a 12pt space plus or minus 4pt depending on other factors (document type, available space, etc).