Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is what I get with \textbar:

enter image description here

This is what I want it to look like:

enter image description here

share|improve this question
1  
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

2 Answers 2

up vote 12 down vote accepted

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 …

share|improve this answer
    
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
2  
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}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.