[Tex/LaTex] vertical rule in tabular cell over part of its height

rulestables

I want to insert a vertical line in a tabular cell which doesn't run over the full height of the cell, but only 90% of it.
I tried:

  • \vrule height 0.45\height depth 0.45\height, but \height throws errors in tabular cells
  • scaling down \vrule, but \scalebox{1}[.9]{\vrule} doesn't work

MWE

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{blindtext}

\begin{document}
\begin{tabular}{p{0.52\linewidth} @{\hspace{0.05\linewidth}} c @{\hspace{0.05\linewidth}} p{0.32\linewidth}}
  \begin{minipage}{\linewidth}\blindtext[2]\end{minipage}
  &
  \vrule height 0.35\textheight depth 0.35\textheight
  &
  \begin{minipage}{\linewidth}\blindtext\end{minipage}
\end{tabular}
\end{document}

Output

output

This roughly produces the output I want, but of course using \textheight isn't the right thing to do here.

If that helps, I thought of a way of filling the cell with some box in which I then can use \height. Would that be an approach?

PS: I am aware of the multicol package, but it doesn't meet my needs of vertically centered columns with different widths.

Best Answer

Suppose your:

\vrule height 0.4\height depth 0.4\height

If you mean \height as maximal height of two columns, then you must to measure them using setbox:

\input plipsum
\newdimen\height

\def\twocols#1:#2#3:#4{{\emergencystretch=2em \parindent=0pt
   \setbox0=\vbox{\hsize=#1\hsize #2}\setbox1=\vbox{\hsize=#3\hsize #4}%
   \height=\ht0 \ifdim\height<\ht1 \height=\ht1 \fi % maximal height
   \hbox to\hsize{$
      \vcenter{\unvbox0}
      \hfil 
      \vrule height .4\height depth.4\height %<<<--- here is your \vrule 
      \hfil
      \vcenter{\unvbox1}$}}}


\twocols .5:{\lipsum1} .4:{\lipsum{2-3}}

\bye
Related Question