How to type triangles, absolute values and other symbols in LaTeX

Organize the input commands for triangles, absolute values, gradients, wavy lines, reversible arrows and various slashes in LaTeX, explaining the required macro packages, mathematical mode requirements, and how to distinguish and check when the symbols are similar.

Key points of this article

  • Most symbols must be entered in math mode, with a pair of dollar signs wrapped in the line, otherwise the command will report an error or not be displayed.
  • \triangle, \nabla, \sim, \leftrightarrow are basic commands and do not require additional macro packages; a few symbols such as solid triangles require amssymb.
  • The vertical bar of absolute value can be entered directly. When the brackets need to become taller with the content, use \left and \right to pair them.
  • \sim represents an approximate relationship, and \tilde is the accent added above the letters. The two have similar appearances but different meanings. Wrong writing will change the meaning of the formula.
  • Backslashes in text and backslash commands in formulas are different, and mixing them will result in incorrect characters.

When writing papers, handouts, or technical documents, letters, numbers, and common operators are generally easy to handle, but many people get stuck when encountering triangles, absolute values, gradients, wavy lines, reversible arrows, and slashes. Most of the common symbol cheat sheets only list addition, subtraction, multiplication and division, Greek letters and set symbols, and these corner symbols are often not included.

This article is based on "what do you want to express", and the corresponding commands, required macro packages, and possible errors are given. After reading, you can enter these symbols in any editing environment that supports LaTeX and check that the results are as expected.

How to type triangle symbols in LaTeX? One sentence conclusion

The rules for entering most symbols are the same: write the command in math mode. Inline formulas are wrapped with a pair of dollar signs, and stand-alone formulas are \[ and \]. The table below gives recommended practices for common situations.

your situationRecommended practicesreason
To ordinary triangle △Enter \triangleBasic commands, no additional macro packages required
Want a solid triangle ▲Enter \blacktriangle and load amssymb in the preambleThe symbol belongs to the extended symbol library
To represent absolute value or normOrdinary vertical lines are input directly; the norm is \lVert x \rVertVertical lines can be written directly, double vertical lines require special commands.
Need gradient or Laplacian operatorGradient input \nabla f, Laplacian input \nabla^2 f\nabla is the basic command, ^2 means square
To reversible (bidirectional) arrowUse \leftrightarrow for ordinary double arrows; \rightleftharpoons for chemical equilibriumThe appearance and semantic scenes of the two are different

Before you start: Confirm these points first

  1. Confirm if the symbol is in math mode. The definitions of these symbols only take effect in mathematical typesetting. If you enter \nabla directly in text mode, the compiler will report an error or output abnormal characters.
  2. Confirm whether additional macro packages are needed. \triangle, \nabla, \sim, \leftrightarrow are basic commands. \blacktriangle, \vartriangle, \nmid, \leadsto, etc. need to write \usepackage{amssymb} in the introduction area. Spin symbols require \usepackage{graphicx}.
  3. Distinguish between symbols and accents. \sim means "approximate" or "identically distributed" relationships, \tilde{x} is the accent above the letter x. Both look like waves, but have completely different meanings in the formula.
  4. Distinguish slashes in text and formulas. There are special commands for backslashes in formulas. Backslashes in text must be written in other ways. When the two are mixed, character misalignment or compilation errors often occur.

# steps to enter and check symbols in the UniDoc Page Editor

The following steps take the UniDoc Web Page Editor (app.unidoc.top) as an example. The editor supports formulas and round-trip conversion between LaTeX and Word, which is suitable for checking effects while entering.

  1. Open app.unidoc.top, create a new document, or open an existing document.

two. Insert the formula where you want it, and then enter the LaTeX command, such as\triangle, to see if the preview appears as.

  1. Enter an absolute value. Ordinary vertical bar can be written directly as |x|; double vertical bar norm as \lVert x \rVert, and when parentheses need to be stretched, it is written as \left\lvert x \right\rvert.
  2. Input gradient and Laplace operator. \nabla f is shown as quadratic Laplace operator \nabla^2 f.
  3. Enter wavy lines and reversible arrows. The approximate relation is \sim or \approx, stress is \tilde{x}, two-way arrow is \leftrightarrow, and chemical reversible is \rightleftharpoons.
  4. Enter a slash. The ordinary slash in the formula directly writes the /; backslash with the \backslash; collection difference with \setminus, which is displayed as "slash". The backslash in the text requires the use of \textbackslash.
  5. Handles rotation symbols. To rotate ∈ 90 degrees, you need to write \rotatebox{90}{$\in$} in a LaTeX environment that can load macro packages, and load graphicx in the introduction area. If the page editor does not accept the macro package, compile the line in the local LaTeX environment and use the result for the document.
  6. Check the preview results one by one to make sure that the shape and meaning of each symbol is consistent with your expectations.

# check item by item after completion

The appearance of the symbol is similar and the macro package depends on many. It is recommended to check it item by item after the input is completed.

Check itemWhat do you think?What if there's a problem?
Is the symbol shape correct?Confirm one by one with reference to each other.Change the command if the shape is wrong, such as changing\ tilde to\ sim.
Is there a Undefined control sequence error report?View the command name of the error lineAdd amssymb or graphicx, or check spelling and case
Is the absolute value vertical bar height appropriate?Observe the vertical bar when the parentheses contain fractions or superscriptsUse\ left and\ right pairing instead
Whether the slash is abnormal in text and formulaSee if the backslash becomes a strange character.Text with\ textbackslash, formula with\ backslash
Is the meaning of the symbol consistent with the original text?Compare with the symbol description at the definitionIf the meaning is not clear, go back to the original definition and confirm.

If the formula is obtained through OCR from the scanned version of PDF, symbols are particularly likely to be mistakenly identified, such as\ sim and\ tilde, vertical bars and the letter l. This kind of content should be checked one by one against the original picture.

# frequently asked questions (FAQ)

1. How to type the absolute value in LaTeX?

Normal absolute values are entered directly into the vertical bar, such as |x|. When brackets contain fractions or superscripts and need to be automatically scaled, using \left\lvert x \right\rvert, they must appear in pairs.

2. How to play the wavy line in LaTeX?

The approximate or similar relation is expressed by \sim or \approx. To add waves over letters, use \widetilde{xyz} when you need to overwrite multiple characters with \tilde{x};. The tilde in plain text should use \textasciitilde, otherwise it will become a non-wrapping space.

3. Input\ nabla does not display a gradient symbol, what should I do?

First check to see if the command is in mathematical mode, and it will not display correctly in text mode. After confirming that it is correct, read the wrong message and check whether the spelling and case are correct.

4. Use the online symbol query tool to find the LaTeX command, what do you want to see?

The focus is on whether it can directly give replicable commands and explain the required macro packages. When choosing tools, you should also pay attention to the file size limit, whether to add watermarks, whether to collect your input, and whether the exported source code can be directly used for compilation.

# Summary

The key to how to type the LaTeX triangle symbol is to put it into the mathematical mode before confirming whether additional macro packages are needed. Absolute values, gradients, wavy lines, reversible arrows and slashes have their own corresponding commands, and the meaning should be distinguished when the symbols are similar. Check item by item after input is completed, which can avoid most of the errors.

Open OmniDoc to edit, convert or translate your LaTeX document

Updated 2026-11-11