Complete
Top Left Corner
Top Right Corner
Bottom Left Corner
Bottom Right Corner
\documentclass[dvipsnames,dvips,cmyk]{minimal}
\usepackage{xcolor,calc}
\usepackage[%
paperwidth=30mm,
paperheight=30mm,
textwidth=25mm,
textheight=25mm,
showframe]{geometry}
\setlength{\fboxsep}{5mm}
\setlength{\fboxrule}{5mm}
\usepackage{lipsum}
\begin{document}
\topskip0pt%
\noindent\color{red}\fbox{\parbox{\textwidth-2\fboxsep-2\fboxrule}{\color{green}\rule{5mm}{5mm}}}
\end{document}
EDIT 1:
Questions:
- These asymmetric frame rules are intentionally made or bugs?
\textwidth
equals to the horizontal distance between inner edges of the frame rules or outer edges of the frame rules?
EDIT 2:
-
I think the frame enclosing the text content is created partially/separately using 4 rules rather than using
\fbox
(with\fboxsep
set to zero, of course). Can it be changed to use\fbox
? -
If we use PSTrick's terminology in this discussion, I think the box enclosing the text content used
dimen=inner
, right? If it is right, then the\textwidth
is measured as the horizontal distance between the inner edges of the box. Please kindly confirm whether or not my understanding is correct?
EDIT 3:
Except for the "asymmetric frame rules" produced by geometry.sty, my diagram below reproduce it with some annotations.
The frame produced by geometry.sty seems to expand outward. Thus, the \textwidth
equals to horizontal distance between the inner edges of this frame.
Note: scale in mm.
This bug still exists.
Best Answer
I'd say that the behaviour seen is a bug in
geometry
. LaTeX's\fbox
also has to use four rules to achieve the effect, but these do join up correctly. So I'd report the issue to the author ofgeometry
and see what he says.On framing around
\textwidth
, the frame should be 'outside' of the material (i.e. the TeX box containing the material should actually have a width of\textwidth
plus twice the width of the rule used). Again, this is certainly what\fbox
does.