# How can I typeset an extra-long \textbar?

This is what I get with \textbar:

This is what I want it to look like:

-
Usually this is written with a slash: "Wintersemester 2011/2012" or shorter "Wintersemester 2011/12". \slash instead of / adds a breakpoint after the slash. –  Heiko Oberdiek Oct 17 '13 at 15:09

Use a \rule

\documentclass{article}

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

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


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

which is the result of this code

\documentclass{article}

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

\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 …

-
Thanks! How can I prevent these two things: (1) The gap to the right is a bit smaller than to the left. (2) The pipe causes the line height to increase. –  mcb Mar 2 '12 at 16:02
@mcb: I can’t see both problems in my update. Thats the reason why an minimal working example (MWE) is always useful ;-) please create one that shows your document class and font settings. Furthermore I guess the rule won’t increase the line height if it’s adjusted to the font settings … –  Tobi Mar 2 '12 at 16:12
You can put the rule inside a \smash to remove any possible line height disruptions. –  Werner Mar 2 '12 at 16:22
Set the height to 42ex, then you'll see what I mean. And concerning (2), I think it’s the font (Platino). I inserted a \hspace{0.8mm} to fix it. –  mcb Mar 2 '12 at 16:32
@Werner: Thanks. I know that there was a macro for this but forgot it’s name … –  Tobi Mar 2 '12 at 16:57

Here is an alternative:

\documentclass{standalone}
\begin{document}

Wintersemester 2012 $\mid$ 2013

\end{document}


-