General ⇒ Help adding a vertical line '|'
Help adding a vertical line '|'
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.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10329
- Joined: Mon Mar 10, 2008 9:44 pm
Help adding a vertical line '|'
Re: Help adding a vertical line '|'
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: 10329
- Joined: Mon Mar 10, 2008 9:44 pm
Help adding a vertical line '|'
Code: Select all
If $a|b$ and $a|c$ ...
Help adding a vertical line '|'
\textbar
or $\vert$
. (The latter is a little thicker.)-
- 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: 10329
- Joined: Mon Mar 10, 2008 9:44 pm
Help adding a vertical line '|'
Code: Select all
\documentclass{article}\usepackage[T1]{fontenc}\begin{document}Vertical line: |\end{document}