# Class scrlttr2: Eliminate space between refvpos and date

There is a small space between where visualize.lco (loaded with command \LoadLetterOption{visualize}) indicates is the top of the refline, and where text in the refline actually appears. How can I get rid of this?

Example:

\documentclass{scrlttr2}

\setkomavar{date}{\fbox{11/01/2011}}

\setshowstyle{edges}

\begin{document}
\begin{letter}{Dr.~Leo Lion\\Fordstan University}
\opening{Dear Sir,}
This is a test.
\closing{Sincerely yours}
\end{letter}
\end{document}


• It is to me, at least :) I was able to hack something together that involving changing the definition of the letter environment so that refvpos is toaddrvpos + the height of the toaddr area + 0.89\baselineskip but I don't know why 0.89. Would prefer a more sustainable, elegant, and informed solution. – Michael Hoffman Nov 2 '18 at 13:38
• I upvoted your answer. But I want to exactly get rid of the actual space between refvpos and date, not change the way the visualization works. – Michael Hoffman Feb 9 '19 at 2:29

Well, in file visualize.lco you can find the definition of command \showfield@refline} to display the location of the used refline by edges or lines.

At the end of this definition you can find the command

\showfield{\useplength{refhpos}}{\useplength{refvpos}}%
{\useplength{refwidth}}{-1.5\baselineskip}%


to display the location of the refline. To change the position in verticaly position you need to change the second parameter \useplength{refvpos} to for example 1.01\useplength{refvpos} ...

With the following MWE

\documentclass{scrlttr2}
\setshowstyle{edges}

\makeatletter
\renewcommand*{\showfield@refline}{%
\begingroup
\ifdim\useplength{refwidth}=\z@
\if@refwide
\@setplength{refwidth}{\paperwidth}%
\else
\fi
\else
\@setplength{refwidth}{\textwidth}%
\@setplength{refhpos}{\oddsidemargin}%
\fi
\else\ifdim\useplength{refhpos}=\z@
\begingroup
\setlength\@tempdima{\textwidth}%
\setlength\@tempdimb{\oddsidemargin}%
\setlength{\@tempdimc}{\paperwidth}%
\divide\@tempdimb by 32768\relax
\divide\@tempdimc by 32768\relax
\ifdim\@tempdimc=\z@\else
\multiply\@tempdima by\@tempdimb
\divide\@tempdima by\@tempdimc
\fi
\edef\@tempa{\noexpand\endgroup
\noexpand\@setplength{refhpos}{\the\@tempdima}}%
\@tempa
\fi\fi
\showfield{\useplength{refhpos}}{1.01\useplength{refvpos}}% <=======
{\useplength{refwidth}}{-1.5\baselineskip}%
\endgroup
}
\makeatother

\setkomavar{date}{\fbox{11/01/2011 Qyf}}

%\setkomavar{myref}{201807/Q}
\setkomavar{subject}{Question}
\setkomavar{place}{Capital city}

\begin{document}
\begin{letter}{Dr.~Leo Lion\\Fordstan University}
\opening{Dear Sir,}
This is a test.
\closing{Sincerely yours}
\end{letter}
\end{document}


you get the following result:

But at last I think it is not relevant, because the lines or edges to visualize the refline position are displayed without changing the position of the refline. It is only a visualisation and with a little distance between the lines/edges and your box the edges/lines can be seen better ...