Horizontal Line Options in LaTeX: Inserting Horizontal/Vertical Lines

Horizontal Line Options in LaTeX: Inserting Horizontal/Vertical Lines.

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.

Horizontal Line Options in LaTeX

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 gives the result right after an edit. LaTeX gives multiple options to users on how they wanted their document to look like.

Options/ Commands for LaTeX horizontal lines:

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, 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 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}.” It can only be used 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 space between contains the “\dotfill” command to fill it with dots. However, it can draw a horizontal line of dots across the page if it is followed by the “” new paragraph command.

\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.

Read Also:

Vertical blank spaces

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. Other LATEX units can be used 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 the rest of the space is filled 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)

Finally, depending on our needs for word processing, LaTeX offers us various options to make our works more straightforward and faster in drawing or creating horizontal and/or vertical lines.

SHARE THIS ARTICLE

There is never a time that isn’t right to help. If this information was useful to you, do well to share it with friends and loved ones. It’s your turn to help other people. You can share this article on your favorite social media handle.

Add a Comment

Your email address will not be published. Required fields are marked *