19

How to insert pipe symbol | in TeX (LaTeX)?

avsej
  • 3,822
  • 4
  • 26
  • 31
  • 3
    Try 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 Answers6

18

In math mode:

\| is a double pipe: ||

\text{\textbar} is a single pipe: | (requires the amsmath package)

trope
  • 497
  • 1
  • 5
  • 16
14

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.

Community
  • 1
  • 1
Stefan
  • 3,550
  • 1
  • 18
  • 18
4

http://www.math.toronto.edu/mathit/symbols-letter.pdf

\textpipe or use something like \big| when in math mode.

polemon
  • 4,722
  • 3
  • 37
  • 48
3

write: \textpipe

Here you have the handbook of latex symbols: The Comprehensive LATEX Symbol List

jwaliszko
  • 16,942
  • 22
  • 92
  • 158
3

Using \textbar will give the pipe symbol.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
  • 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
-3

use $|$ and it the document compiles successfully & it is the best way to type pipe symbol in TeX or Latex.

sudo
  • 1