0

I'm using LyX with XeTeX and non-TeX fonts. I'm using the LyXBook layout from the Editorium. Although I've set a custom paper format in Document>Settings>Page Layout (9x6 inches), when I compile a PDF via XeTeX the paper size is always US Letter. I've tried everything I can think of, but nothing seems to work. I've tried using the geometry package, but whenever I set parameters in the document preamble I get an error:

LaTeX Error: Option clash for package geometry

and, in the error description

The package geometry has already been loaded with options.

This happens regardless of what parameters I invoke. If I press on, the PDF still comes out in Letter size. What am I doing wrong?

\documentclass{memoir}
\usepackage{fontspec}
\setmainfont{Equity Text A}
\usepackage[paperwidth=6in,paperheight=9in]{geometry}
\geometry{verbose,bmargin=3cm,lmargin=2cm}
\usepackage[xetex]{color}

\begin{document}
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
  • Can you post the exported .tex file of the .lyx file where you used the Document > Settings > Page Layout and where it compiles without error but does not give the correct dimensions? By the way, welcome to tex.se! – scottkosty Apr 2 at 22:31
  • Thanks! I'm not sure what to post, though. The preamble alone runs to hundreds of lines. – Bird Apr 3 at 9:51
  • 1
    Ah, then you have some work to do :). The best thing is to figure out which of those lines are necessary to reproduce the problem. This might be a good read: wiki.lyx.org/FAQ/MinimalExample – scottkosty Apr 3 at 12:32
  • I've had a go at this, editing the .tex file in TexMaker - removing lines, then compiling and viewing the output. I've been able to strip out almost everything, but then I find that removing a single line (\usepackage[xetex]{color}) fixes the problem. However, removing that single line from the original .tex file does not fix the problem. So I'm a bit stuck - the MWE i've ended up with is easily fixed by removing that line, but it doesn't seem to be what's causing the problem in the original .lyx document. For what it's worth, the MWE is: – Bird Apr 3 at 17:13
  • Sorry - is added to original post. Also, although I chose the LyXBook layout in LyX, I noticed that the source references the memoir document class. – Bird Apr 3 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.