I try to construct a symbol from 4 rules, one horizontal and three vertical ones.
\showoutput
gives me the correct dimensions for all of them (see below). However, the horizontal one somehow erratically moves slightly to the left or right in the PostScript and PDF. Given four dimensions \@omwd
(desired width), \@omht
(desired height), \@omhtn
(desired height of part above horizontal line), \@omhtp
(desired height of part below horizontal line), where \@omht
= \@omhtp
+ \@omhtn
; I am using this code:
\documentclass{article}
\title{Testing}
\author{Michael Nüsken}
\begin{document}
\showoutput\fboxsep=0pt
\makeatletter
\newdimen\@omwd
\newdimen\@omht
\newdimen\@omhtn
\newdimen\@omhtp
\newdimen\@roundlinewidth
\@omwd=3.72299pt
\@omht=7.05666pt
\@omhtn=5.57127pt
\@omhtp=1.48538pt
\@roundlinewidth=0.438pt
%
\def\Y{%
\vbox to\@omht{\hsize=\@omwd%
\hbox to\@omwd{%
\hfil
\vrule\@width\@roundlinewidth\@height\@omhtn\@depth\z@
\hfil
}%
\kern-.5\@roundlinewidth% overlap vertical and horizontal lines
\hrule\@width\@omwd\@height\@roundlinewidth\@depth0\@roundlinewidth
\kern-.5\@roundlinewidth% overlap vertical and horizontal lines
\hbox to\@omwd{%
\vrule\@width\@roundlinewidth\@height\@omhtp\@depth\z@
\hfil
\vrule\@width\@roundlinewidth\@height\@omhtp\@depth\z@
}%
}%
}
\makeatother
Y\Y
\begin{itemize}
\item Y\Y
\end{itemize}
\end{document}
Also I observe that even \fbox
does not have rules matching properly in its corners.
For example I obtain:
....\vbox(7.05666+0.0)x3.72299
.....\hbox(5.57127+0.0)x3.72299, glue set 1.6425fil
......\glue 0.0 plus 1.0fil
......\rule(5.57127+0.0)x0.438
......\glue 0.0 plus 1.0fil
.....\kern -0.219
.....\rule(0.438+0.0)x3.72299
.....\kern -0.219
.....\hbox(1.48538+0.0)x3.72299, glue set 2.84698fil
......\rule(1.48538+0.0)x0.438
......\glue 0.0 plus 1.0fil
......\rule(1.48538+0.0)x0.438
But \rule(0.438+0.0)x3.72299
appears to be shifted left or right slightly.
However, this does not happen in all positions on a page!???
Is that a bug in TeX? How to fix or bypass that? Please don't tell me it's a rounding problem...
\documentclass{article} \usepackage{stackengine} \begin{document} \makeatletter \newdimen\@omwd \newdimen\@omht \newdimen\@omhtn \newdimen\@omhtp \newdimen\@roundlinewidth \@omwd=3.72299pt \@omht=7.05666pt \@omhtn=5.57127pt \@omhtp=1.48538pt \@roundlinewidth=0.438pt % \setstackgap{S}{-.5\@roundlinewidth} \setstackEOL{\cr} \Shortstack{ \rule{\@roundlinewidth}{\@omhtn }\cr \rule{\@omwd}{\@roundlinewidth}\cr \rule{\@roundlinewidth}{\@omhtp}\kern\@omwd% \kern-2\@roundlinewidth\rule{\@roundlinewidth}{\@omhtp} } \end{document}