General ⇒ Help adding a vertical line '|'
Help adding a vertical line '|'
Hello,
I'm trying to add a vertical line to my file in TeXnicCenter, but when I build the file it gets interpreted as a long dash. Does anyone know a way around this? Is there an escape character I could use?
Thanks,
I'm trying to add a vertical line to my file in TeXnicCenter, but when I build the file it gets interpreted as a long dash. Does anyone know a way around this? Is there an escape character I could use?
Thanks,
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Help adding a vertical line '|'
LaTeX.org admin
Re: Help adding a vertical line '|'
Basically, I'm trying to say:
If a|b and a|c ...
But, in place of |, I'm getting a long dash. I just tried \rule, but it doesn't display anything. Am I doing something wrong?
If a|b and a|c ...
But, in place of |, I'm getting a long dash. I just tried \rule, but it doesn't display anything. Am I doing something wrong?
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Help adding a vertical line '|'
Use inline math mode:
Stefan
Code: Select all
If $a|b$ and $a|c$ ...
LaTeX.org admin
Help adding a vertical line '|'
You might also use either
\textbar
or $\vert$
. (The latter is a little thicker.)
Last edited by cgnieder on Tue Feb 19, 2013 9:28 pm, edited 1 time in total.
-
- Posts: 1
- Joined: Tue Feb 19, 2013 7:55 pm
Help adding a vertical line '|'
Thank you frabjous, I was having the same issue, thanks to you I've solved it!frabjous wrote:You might also use either \textbar or $\vert$. (The latter is a little thicker.)

- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Help adding a vertical line '|'
That's a problem with the standard OT1 encoding and that character. Simply switch to T1 encoding and you can directly use that symbol. See:
Stefan
Code: Select all
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
Vertical line: |
\end{document}
LaTeX.org admin