TeXShopDifferent width and height of text according to font

Information and discussion about TeXShop, an integrated LaTeX environment for Mac OS X
Post Reply
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Different width and height of text according to font

Post by fja »

I'm writing an {article} document, and I defined the margins of the page. To do this, I used:

Code: Select all

\documentclass[letterpaper,12pt,oneside]{article}
\usepackage[spanish,es-lcroman]{babel}
\setlength{\textwidth}{16.1cm}
 \setlength{\textheight}{23.44cm}
\addtolength{\hoffset}{1cm}
\addtolength{\voffset}{-0.8cm}
So, I compile the document as LaTeX Pdftex (of course, under TexShop), and it works fine. Then, I was told to use the Book Antiqua font, so I loaded the package

Code: Select all

\usepackage{pxfonts}
which did change the font, but the margins too. Is there a way to avoid this, or I have to "calculate" the margins again (and for every font I could use)??

PS: By the way, this declarations of margins was trial and error :?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Different width and height of text according to font

Post by frabjous »

I cannot duplicate the result. If I process the following file:

Code: Select all

\documentclass[letterpaper,12pt,oneside]{article}
\usepackage[spanish,es-lcroman]{babel}
\setlength{\textwidth}{16.1cm}
\setlength{\textheight}{23.44cm}
\addtolength{\hoffset}{1cm}
\addtolength{\voffset}{-0.8cm}
\usepackage{pxfonts}
\usepackage{lipsum}% for creating dummy text
\begin{document}
\lipsum[1-20]% creates dummy text
\end{document}
And then process the same file without the \usepackage{pxfonts}, the margins of the document are exactly the same. Adding this package does not change them, nor do I see why it ever would.

If there is more going on in your document, perhaps some other package or setting is responsible. Can you provide a minimal working example which we can use to reproduce the problem?

However, you should know that the standard and probably best way to set margins in a (pdf)LaTeX document is to use the geometry package, rather that direct length commands, as so:

Code: Select all

\usepackage[top=2cm,bottom=2cm,right=3cm,left=3cm]{geometry}
(Change the values to whatever is suitable.)
Post Reply