Daniel Lohmann wrote:

Paul A. Rubin schrieb:
Daniel Lohmann wrote:
 >> [...]

More precisely:

\usepackage[letterpaper]{geometry}

messed up the layout completely [...]


How did \usepackage[letterpaper]{geometry} mess up the layout?

It also changed the column width, which resulted in a 7 instead of 5 pages document and made the "ACM copyright box" (a fixed area on the bottom of the first column ACM uses for copyright and bibliographic information) run into the second column.

I'm not all that familiar with the workings of the geometry package, but perhaps the ACM class does something creative with column width and geometry, which loads later, unravels that.



The point is that I do not want to specify margins (again), it should just use whatever margins the class defines as default. I just want the package to issue the backend-driver specific /special commands for defining the paper size.

This is a reasonable desire, but I think we are running into a LaTeX problem that LyX may not be able to solve. According to a post I came across (http://www.mail-archive.com/[EMAIL PROTECTED]/msg01352.html):

The problem is that the a4paper option is not passed on to the DVI
processors unless you load some package that includes appropriate
\special commands.  One possibility is \usepackage{hyperref}.
Another packages that wraps this information into \specials is the
geometry package.

I did a little experimenting and confirmed that (a) in general, when LyX invokes pdflatex on a document where I have set A4 paper size, the result is US letter size (my system default) and (b) using either geometry or hyperref results in A4 output.

The alternative to using a package as described above is, of course, to edit the config file pdflatex uses. I'm pretty sure we don't want LyX messing with other programs' config files (not to mention the distinct possibility LyX would lack the necessary permissions to do so). So how can LyX handle this? If it inserts the geometry package, you run the risk that, even without custom margins, geometry breaks something in sig-alternate. Inserting hyperref might work for you; but would it break something for someone else?

A relatively clean solution to your particular case would be to define a layout file for sig-alternate that includes the LaTeX code to set letter size output for pdflatex -- *assuming* that those commands do not screw up DVI or dvips output. If they did, you could still use the custom layout, but you would have to remember that it formats properly only using pdflatex. (That would work for me, since I generate all my final output in PDF using pdflatex.)

The ideal solution, of course, would be if pdflatex actually paid attention to the paper size commands in the document!


BTW: I observed a strange behavior that could be considered a bug (LyX 1.4.5, Windows & Linux): After I changed margins to "Custom" Lyx added, as you described, a \usepackage[...]{gemometry} to the LaTeX preamble, which resulted in the messing up I described. So I changed margins back to "Default". However, from that point on LyX still included the geometry package. In the end I had to revert to an older version of the document, as I was not able to make LyX *not* include geometry. Can somebody else confirm this? Probably a problem only with such brittle classes as ACM, though.

I tried this in LyX 1.4.4 with several different article classes (but not sig-alternate, which I do not have). In every case, switching margins back to default led LyX to remove the geometry package. I would not think this would be class-specific, though. Is it possible that between setting custom margins and reverting to default margins you added something else to the document, or changed something else, that might cause LyX to think the geometry package was still required?

 > I'm using a different class, though, so perhaps ACM is
 > susceptible to format problems where AMS is not.

Well, yes :-) ACM classes are known to be quite fragile. The tools computer scientists design for their own lot tend to be like that...

I know that computer engineers feel that a piece of software (particularly an operating system) that runs correctly must by virtue of that fact be short on features, but I didn't know this extended to their use of LaTeX. :-)

/Paul

Reply via email to