Some times I see the use of \usepackage{showframe}, but other times I see the use of \usepackage[showframe]{geometry}. What is the difference between using one or the other? i.e., When I should use \usepackage{showframe} instead of \usepackage[showframe]{geometry}?
- 4,745
2 Answers
if you like to see page layout determined by package geometry than you can see it with adding option showframe to package.
In case, when page layout is determined by \documentclass{...} or some other way and you are curious how page layout looks, then you can see it with adding package showframe, which not interfere in layout design. with this package you can also change border thick and color, for example:
%-------------------------------------- only for show page layout
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.25pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
- 296,517
If you run
\documentclass[letterpaper]{article}
\usepackage{showframe}
\begin{document}
\the\textwidth; \the\textheight
\end{document}
framelines around the text-, header-, and footer-blocks will be drawn, and the text output will be
345.0pt; 550.0pt
That's roughly 4.77" and 7.61", or 12.1cm and 19.3cm. The same dimensions would obtain if the showframe package weren't loaded at all.
If, on the other hand, you run
\documentclass[letterpaper]{article}
\usepackage[showframe]{geometry}
\begin{document}
\the\textwidth; \the\textheight
\end{document}
you'll still get the framelines, but the textblock parameters are given by
430.00462pt; 556.47656pt
That's roughly 5.95" and 7.70", or 15.1cm and 19.6cm.
There may also be differences in terms of the heights and widths of the header, footer, and margin blocks, but I haven't checked.
- 4,340
- 506,678
-
1I just find out the question Print page margins of a document, it seems that calling the package
geometryas\usepackage[showframe, pass]{geometry}does not change the page margins. But from the question How to do the memoir headings fix but not have my text going over the page bottom margins? when using the classmemoirwe need to use thegeometrypackage instead ofshowframes, as theshowframespackage is know to not word correctly with thememoirpackage. – user Aug 19 '17 at 23:14
showframejust shows the frame, whereasgeometry's main usage is to customize the page layout. Compare the results of\documentclass{article}\usepackage{showframe}\begin{document}test\end{document}with\documentclass{article}\usepackage[showframe]{geometry}\begin{document}test\end{document}– Skillmon Aug 18 '17 at 16:48