How can I typeset an extra-long \textbar?

Use a \rule

\documentclass{article}

\newcommand{\lpipe}{\rule[-0.4ex]{0.41pt}{2.3ex}}

\begin{document}
Wintersemester 2011 \lpipe\ 2012
\end{document}

result

The optional argument takes a vertical lift, the first mandatory argument takes the line width and the second the height. You may adjust the values to fit your needs (and font settings)

Update

\documentclass{article}

\newcommand{\lpipe}{\smash{\rule[-0.4ex]{0.41pt}{42ex}}}

\begin{document}
Some text to fill the lines and see the \verb+\baselineskip+ increasing.
Now let's type the \lpipe\ pipe. And some more filler text. And some more
filler text. And some more filler text. And some more filler text. More
filler text. And some more filler text. And some more filler text. More
filler text. And some more filler text. And some more filler text.

\bigskip
H\lpipe H\\
H \lpipe\ H
\end{document}

Update 2

I added \smash to the definition of \lpipe to make it not affect the line height. But I think that the line should be only as heigh as possible without increasing the line (even without \smash). Otherwise it will hardly fit to the used font.

To illustrate this I took this picture

bad pipe vs. good pipe

which is the result of this code

\documentclass{article}

\newcommand{\lpipe}{\rule[-0.4ex]{0.41pt}{2.3ex}}

\newcommand{\badlpipe}{\smash{\rule[-0.4ex]{0.41pt}{3.2ex}}}

\begin{document}
Some text to fill the lines and see the \verb+\baselineskip+ increasing.
Now let's type the \lpipe\ pipe. And some more filler text. And some more
filler text. And some more filler text. And some more filler text. More
filler text. And some more filler text. And some more filler text. More
filler text. And \badlpipe\ some more filler text. And some more filler text.
\end{document}

The \badlpipe is a litte to long to not affect the line height, so I used \smash. But one can easily see that this is very bad style and looks not good …


Here is an alternative:

\documentclass{standalone}
\begin{document}

Wintersemester 2012 $\mid$ 2013

\end{document}

enter image description here

Tags:

Symbols