[texhax] \kern in horizontal mode

Björn Michaelsen bjoern at michaelsen.kicks-ass.net
Wed Feb 2 15:04:33 CET 2005


Dear list,
I have a problem generating a bordered box using TeX. I want a vbox with some
space around it and hoped this will generate it:
------ Start LaTeX example ------
\documentclass{article}
\usepackage{calc}

\newlength{\RMtempdima}
\newlength{\RMinnerborder}
\setlength{\RMinnerborder}{4pt}

\newcommand{\borderbox}[2]{%
    \setlength{\RMtempdima}{#1-2\RMinnerborder}%
    \par\kern \RMinnerborder%
    \noindent\kern \RMinnerborder%
    \vbox{%
      \hsize = \RMtempdima%
      #2%
      }
    \kern \RMinnerborder%
    \par\kern \RMinnerborder%
    }

\begin{document}
\fbox{\borderbox{5cm}{%
	The quick brown fox jumps over the lazy dog.
	The quick brown fox jumps over the lazy dog.
}}
\end{document}
------ End LaTeX example ------
also available at: http://michaelsen.kicks-ass.net/bjoern/borderbox.tex

I expect the text to be 4pt from the border on all sides. But on the left and
right the borders are much wider. What did I do wrong? How do I get what I
want?

Thanks in advance,
Björn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://tug.org/pipermail/texhax/attachments/20050202/06167da9/attachment-0001.bin


More information about the texhax mailing list