LyXPage margin

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
urbajs
Posts: 2
Joined: Sun May 03, 2009 10:37 pm

Page margin

Post by urbajs »

Hello everyone!

I am new to LyX and haven't used LaTeX before. I have written a couple of reports for my school asignments with LyX already, but have now encountered a problem which I can't seem to be able to solve on my own. I have read the tutorial and user guide that came with LyX but still haven't found the solution.
I have a document (report class) in which I have a table which is too wide for the page. By that I mean for the page layout and margins as defined in the report class. I have a 4.3 cm margin on the left but the right end of the table ends 1 cm from the right edge of the paper. How do I center the table so that it will be on the center of the page (left to right center)? Can I change the page margins of just one page in the document?

I read something on the internet about geometry package beeing able to do that, but I could not get it to work. I added \usepackage{geometry} to the Preamble but what next? If I put \geometry{left=wcm,right=xcm} into insert TeX code I get an error LaTeX Error: Can be used only in preamble.

I used the \usepackage{pdflscape} in the preamble as well and then used \begin{landscape} and \end{landscape} to put just one page into landscape format. Is there a simmilar way for defining the page margins of just one page?

And if anyone has a minute to try and explain to me what the Preamble is (what it does and how to use it) and where all the Packages come in I would greately appreciate it.

Thank you in advance for all the help.

Recommended reading 2024:

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

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

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Page margin

Post by fatra2 »

Hi there,

I can give it a try. Let's first start with the general explanation, before moving to your problem.

So you have decide to use LaTeX. LaTeX use to be a typesetting program, meaning that need to give a set of commands to obtain a certain output, for table for example. Typesetting idea has the advantage to let you concentrate on the content of the text and forget about the layout. I forgot to say that LaTeX follows very strict topological rules, which means that your layout might be different than what you expected, a figure three pages further in your text for example. This is normally due to the topological rules of LaTeX.

Secondly, to avoid having to write very complex command to obtain simple layout, like a table, very nice people wrote package that are there to be used or downloaded. The same applies for document class, where the complex rules of "report" or "letter" are group into a file called the document class. Therefore, to be able to use different command like table or figure, you must tell LaTeX that you want to use this or that package, in which you add in your document preamble. I hope this is all clear to you. At first, this is really what you need to know. The most important piece of advise that was given to me, while learning LaTeX, was that you should concentrate on the content of your text, and let the compiler take care of the page layout.

To come back to your table problem. If you have a table that is wider than the page width, I would suggest to make this page landscape. I would definetly discourage you to start playing with page geometry. You will most probably end up with a document that does not look anything like you expect. Since I never heard of this pdflscape package, and had very good results without it, here are my instructions. First replace

Code: Select all

\usepackage{pdflscape}
with

Code: Select all

\usepackage{ladnscape}
Then whenever your want to have part of your text in landscape layout (like for you table), just add

Code: Select all

\pagebreak or \newpage
\begin{landscape}
your table goes here, with any text that you want with it.
\end{landscape}
I hope this helps you a bit more in creating your wonderful documents.

Cheers
urbajs
Posts: 2
Joined: Sun May 03, 2009 10:37 pm

Re: Page margin

Post by urbajs »

Thank you for the explanation.

I have considered putting the table on a landscape page but the problem is, that the table is too long to fit on such a page. But on the other habd, it is not to wide to put in a normal (portrait) page, I just have to move it a bit to the left.

Any other ideas?
Post Reply