LyXProblems with contents page

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
hooman
Posts: 41
Joined: Tue Jul 06, 2010 3:03 pm

Problems with contents page

Post by hooman »

Hi
I'm using lyx 1.6.7-4. I have a deadline in two day and would appreciate some quick solutions. My contents page looks really distorted. I'm using the report document class. I need to know how I can change the content page font, page margin etc without it effecting the entire document.
Thanks in advance.

Recommended reading 2024:

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

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Problems with contents page

Post by meho_r »

hooman
Posts: 41
Joined: Tue Jul 06, 2010 3:03 pm

Re: Problems with contents page

Post by hooman »

Thanks but my problem is that I dont know how to use these packages...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problems with contents page

Post by localghost »

hooman wrote:Thanks but my problem is that I dont know how to use these packages...
I can't imagine that this isn't documented somewhere (online help, wiki, …).


Best regards
Thorsten
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Problems with contents page

Post by meho_r »

hooman wrote:Thanks but my problem is that I dont know how to use these packages...
Then please specify what exactly do you want to change and provide an example .lyx file.
hooman
Posts: 41
Joined: Tue Jul 06, 2010 3:03 pm

Re: Problems with contents page

Post by hooman »

Thanks. All I need to know is how to change the page margins and font on a page without it effecting the other pages. It could be any page or .lyx file. I'm using the report document class.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Problems with contents page

Post by meho_r »

1. For changing margins on some pages, you may use geometry package. Put into the preamble (Document > Settings > LaTeX Preamble) \usepackage{geometry} and set parameters as you like, e.g.:

Code: Select all

\usepackage{geometry}
\geometry{hmargin={3cm,1.5cm},vmargin={2cm,3cm}}
When you want to change margins and other settings*, use \newgeometry command in your document (Ctrl+L, and then enter the command), e.g.:

Code: Select all

\newgeometry{hmargin={6cm,6cm},vmargin={6cm,6cm}}
And, when you want to restore default settings (i.e.those set in the preamble), use \restoregeometry:

Code: Select all

\restoregeometry
Note: Both these commands automatically insert \clearpage command, which means there's a clear page break immediately after they are called.

2. For changing fonts and other properties of TOC, you may try experimenting with this example code (which goes into the preamble, together with \usepackage{titletoc}):

Code: Select all

\usepackage{titletoc}
\titlecontents{chapter}
              [1.5em]% left, indent
              {\bfseries}% above, formatting
              {\contentslabel{1.3em}}% before with label, stuff before title
              {\hspace*{-1.3em}}% same as above, when there's no label
              {\titlerule*[1pc]{.}\contentspage}% filler and page
              [\hrule\vspace*{6pt}]% optional, code that is following an entry

\titlecontents{section}
              [3.7em]
              {\itshape}
              {\contentslabel{2.2em}}
              {\hspace*{-2.2em}}
              {\titlerule*[1pc]{.}\contentspage}
              [\vspace*{3pt}]
In the attachment you may find an example .lyx file with these suggestion implemented.
_______________
* Note that some settings cannot be changed on the fly. Also, for these changes to work you'll need geometry package version 5 or later. Check geometry documentation for details, section 7.
Attachments
Example.lyx.zip
(1.55 KiB) Downloaded 163 times
Post Reply