How to insert pipe symbol |
in TeX (LaTeX)?
The pipe character is not hidden on a keyboard. It is located right above the Enter key. Another way to type the vertical bar character is to turn on the numeric keypad, hold ALT , then press 1, 2, and 4.
Change the List separator to a pipe character. The pipe character is found above the ENTER key on the keyboard (SHIFT + \). Click OK.
You may be wondering how to insert symbols in LaTeX. It is possible to add certain symbols in-text while others require LaTeX's math mode to be activated. ”, you can use the command \star in your code.
You simply type \LaTeX . One problem with this is that if you type it a lot of times in your text you will need to type \LaTeX\␣ ¹ (i.e., followed by \ and an actual space) to force a space after it. \xspace is from the xspace package. Additionaly, writing \LaTeX{} adds the space after.
In math mode:
\|
is a double pipe: ||
\text{\textbar}
is a single pipe: | (requires the amsmath
package)
The pipe symbol may be used directly in the input and will produce the desired output if you use T1 font encoding. For example:
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
Pipe sign: |
\end{document}
See Special LaTeX characters for such an example with its output and more information.
Update: since the question has been posted to tex.stackexchange.com as well, this answer has been copied there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With