How to insert pipe symbol |
in TeX (LaTeX)?
-
3Try asking at http://tex.stackexchange.com/ – Oded Aug 15 '10 at 15:22
-
Thanks, at tex.stackexchange.com I've got right answer http://tex.stackexchange.com/questions/1774/how-to-insert-pipe-symbol-in-tex/1775#1775 – avsej Aug 15 '10 at 15:57
6 Answers
In math mode:
\|
is a double pipe: ||
\text{\textbar}
is a single pipe: | (requires the amsmath
package)

- 33,336
- 5
- 41
- 62

- 497
- 1
- 5
- 16
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.
http://www.math.toronto.edu/mathit/symbols-letter.pdf
\textpipe
or use something like \big|
when in math mode.

- 4,722
- 3
- 37
- 48
write: \textpipe
Here you have the handbook of latex symbols: The Comprehensive LATEX Symbol List

- 16,942
- 22
- 92
- 158
-
1simple document fails with error `Undefined control sequence. l.3 \textpipe` – avsej Aug 15 '10 at 15:45
-
1
Using \textbar
will give the pipe symbol.

- 11,289
- 20
- 44
- 72

- 31
- 2
-
This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). – Stefano Sansone Sep 06 '21 at 09:19
use $|$
and it the document compiles successfully & it is the best way to type pipe symbol in TeX or Latex.

- 1