6

Is there a way to adjust the height of \vline?

Aurelius
  • 7,653
  • 10
  • 49
  • 103

2 Answers2

17

If the height and depth of a \vrule is not specified, then they are taken from the surrounding box. But it is possible to specify them explicitly:

\documentclass{article}
\begin{document}

\mbox{%
  \vline
  A
  \vline height 1ex
}

\mbox{%
  \vline
  B
  \vline height 5pt depth 3pt width 1pt
}
\end{document}

Result

Heiko Oberdiek
  • 271,626
  • hmm I wonder if the lack of a \relax in vline allowing it to parse a following height was intentional, it's very un-latex-like: +1 anyway:-) – David Carlisle Nov 29 '12 at 17:36
4

\vline is designed to make a rule exactly as heigh as the surrounding box so it has no^* control over the height. The LaTeX \rule command has explicit arguments to give the height and width of the rule, so you may be looking for that.

See @Heiko's answer for a partial contradiction to this statement.

David Carlisle
  • 757,742