Page LayoutMigration from a4wide to geometry package

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Migration from a4wide to geometry package

Post by AleCes »

OK, we all know a4wide is deprecated and should be phased out, but my problem is: how do I get this with geometry? Is there a quick-and-dirty option that enables me to get this without resorting to manual (and boring) settings?

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Migration from a4wide to geometry package

Post by localghost »

AleCes wrote:[…] Is there a quick-and-dirty option that enables me to get this without resorting to manual (and boring) settings? […]
It can't be done without some manual settings. But as I found out these are only a few. With the below example I almost get exactly the same layout with geometry as it is done by a4wide.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
%\usepackage{a4wide}
\usepackage{layout}

\geometry{
  includeheadfoot,
  margin=2.54cm
}

\begin{document}
  \layout
\end{document}
If you want to check out the page dimensions, you can use the layout package as shown in the above example. I have attached all three layout for better comparison.

For future projects you should get familiar with the geometry package since it is much more flexible in its settings and does them in a better way. This prevents conflicts with other packages. And you should not hesitate to take a closer look at its manual. It's not complicated and has many examples for explanation.
Attachments
layout-a4wide.pdf
Page dimensions as set by the »a4wide« package.
(83.97 KiB) Downloaded 1371 times
layout-geometry.pdf
Default page dimensions as set by the »geometry« package.
(84.07 KiB) Downloaded 993 times
layout-geometry-custom.pdf
Customized page dimensions done with the »geometry« package.
(83.97 KiB) Downloaded 790 times
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Re: Migration from a4wide to geometry package

Post by AleCes »

Oh, thanks localghost, you've been so helpful! 8-)

I'd downloaded the manual long ago, but my problem was that I didn't know the precise data about the a4wide layout nor did I manage to find any information about that. I only knew it suited me because it reduced those useless (for me) large margins.

One last question: what is fontenc about? Is it essential for layout settings? I've never used it.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Migration from a4wide to geometry package

Post by localghost »

AleCes wrote:[…] One last question: what is fontenc about? Is it essential for layout settings? I've never used it.
No, it's not essential for the page layout. I got used to including it even in forum examples because it invokes the right font encoding (Cork Encoding) for languages other than English when using PDFLaTeX. I must admit it's a bit misplaced here since you prefer to work with XeLaTeX. The right encoding for PDFLaTeX is very important when writing accented characters e. g. in European languages (in your case á, è or ç). It provides correct hyphenation and makes PDF files searchable for terms which include accented characters. In default encoding such characters are assembled.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Re: Migration from a4wide to geometry package

Post by AleCes »

OK, I just shrank the margin to 2.40 because I was getting too many overflows :mrgreen:

Thank you for your help!
Post Reply