# Creating a smaller vertical bar

I want a vertical bar but in mathematical mode it appears too big. I just want a small | at the same height as the letters.

-
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Heiko Oberdiek May 1 at 22:02
Welcome to TeX.SX! You seem to be asking two unrelated questions, here. On TeX.SX, we try to keep unrelated questions on separate pages. If you have multiple questions that are unrelated to one another, you should ask each in a separate TeX.SX "question". You'll stand a better chance of getting a satisfactory answer to each of your questions. –  Jubobs May 1 at 22:06
The answer to your question about listings is to use moreemph, which appends to the identifiers to highlight to the existing list, whereas emph overwrites the existing list (if any) with the new one. For more details, see section 4.6 in the listings documentation. –  Jubobs May 1 at 22:10
ok will remove one question. Thank you –  user50931 May 1 at 22:14

You can use \rule{.4pt}{1ex} which will sit on the baseline and be 1ex high. Of course, adjust 1ex to suit your "small" requirement. Here's a small example showing the use case via a macro \vertrule[<len>] where <len> defaults to 1ex.
\documentclass{article}
You can use \vertrule{} (compared to $|$) which will sit on the baseline and be \verb|1ex| high.

Of course, you can also use \usepackage{xspace} \newcommand{\vertrule}[1][1ex]{\rule{.4pt}{#1}\xspace} and avoid having to use \vertrule{} when you want to use the default height, but see Drawbacks of xspace. It depends on your use-case. –  Werner May 1 at 22:39
Since \vert is a math rule, its endcaps are rounded, and not flat like a \rule. If a substitute for \vert is in the offing, consider using roundrule.sty and the \roundrule[]{}{} macro, found at tex.stackexchange.com/questions/161297/… –  Steven B. Segletes May 2 at 0:36