On Tue, 06 Mar 2007 18:21:03 -0600
Lyx Physicist <[EMAIL PROTECTED]> wrote:


> 
> 
> Here is the entire LaTex file...  I havent tried the previous
> suggestion to fix the pages on the LOF, but I will get back to you
> when I do. Thanks, Charles
> 

Hi Charles,

I've fixed all your problems. At least the formatting comes out
correct when I run your document.

Here you should use as your preamble. Get rid of the previous stuff I
told you to add. 

\makeatletter
\renewcommand\tableofcontents{%
    [EMAIL PROTECTED]
      [EMAIL PROTECTED]
    \else
      [EMAIL PROTECTED]
    \fi
    \chapter*{\contentsname
    \thispagestyle{empty}
        [EMAIL PROTECTED]
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    [EMAIL PROTECTED]
    [EMAIL PROTECTED]
    }

\renewcommand\listoftables{%
    [EMAIL PROTECTED]
      [EMAIL PROTECTED]
    \else
      [EMAIL PROTECTED]
    \fi
    \chapter*{\listtablename}%
    \thispagestyle{empty}
    \addcontentsline{toc}{chapter}{LIST OF TABLES} 
      [EMAIL PROTECTED]
          \MakeUppercase\listtablename}%
         {\MakeUppercase\listtablename}%
    [EMAIL PROTECTED]
    [EMAIL PROTECTED]
    }
\renewcommand\listoffigures{%
    [EMAIL PROTECTED]
      [EMAIL PROTECTED]
    \else
      [EMAIL PROTECTED]
    \fi
    \chapter*{\listfigurename}%
    \thispagestyle{empty}
    \addcontentsline{toc}{chapter}{LIST OF FIGURES}
      [EMAIL PROTECTED]
              {\MakeUppercase\listfigurename}%
    [EMAIL PROTECTED]
    [EMAIL PROTECTED]
    }
    \makeatother

Let me explain what I am doing. It is simple and worth your while to
understand because as a  physicist I assume you will be using latex
again.

First, in order to redefine the command, I had to start off with a
makeatletter command. This tells latex to look at symbols such as "@"
and not to choke. I end this special environment with a makeatother.
You only need to do this if you are redefining something very basic.

Next, I renenew the commands for the toc, lot, and lof. In order to
find out what these commands were, I opened up the report.cls and
simply cut and paste. So for the listoftables, every line is the
same as it was in the report class *except for 2 lines.* these two
lines are:

 \thispagestyle{empty}
 \addcontentsline{toc}{chapter}{LIST OF TABLES}

I added these commands right after the \chapter command, because that
is where they would normally have to go. For instance, if you wrote
this latex code:

\chapter*{Observations in the lab}

And you wanted to the page style to be empty and you wanted to add the
title to the toc, you would write:

\chapter*{Observations in the lab}
 \thispagestyle{empty}
 \addcontentsline{toc}{chapter}{Obserations in the lab}

Again, notice how I added the apporiate lines *after* the \chapter
command.

Your code wasn't working because you were adding the 

 \thispagestyle{empty}
 \addcontentsline{toc}{chapter}{...}

in the wrong place. Once you issued the \listoftables command, latex
was doing a \chapter command, writing all the text, and then making an
empty page style--too late. Likewise, you tried to issue the
\addcontentsline too soon, before the \chapter was issued by latex.
That's why your page numbers showed up 1 too short.

Normally you don't have to alter the preamble in order to change page
style and to add contents to your toc. In this special case you do,
because the \chapter* command is issued *inside* the \listoftables
command. 

Hope that makes sense.

Try creating a PDF document with LyX itself and see if the page
numbers still come out correct. If not, you will have to export the
document and then run latex 3 times--unless someone on this mailing
list knows how to make LyX run latex 3 times. There is a way you can
automate the whole process. I Know because I am doing that with my
girlfriend's thesis. I run:

lyx -e latex thesis.lyx

And I get a document called thesis.tex. I then run latex on this the
right number of times. However, I do all of this with a Makefile, so
really all's I have to do is type:

make

from the terminal and I get thesis.pdf

You may not need to do any of this.

Paul



PS

I notcie this code in your preamble:

\makeatletter
\let\myTOC\tableofcontents
\renewcommand{\tableofcontents}{%
  \begingroup
  [EMAIL PROTECTED]@empty
  \pagestyle{empty}
  \myTOC
  \endgroup%
}
\makeatother

You can get rid of that, since we redefine toc to do what this code
does.

PSS 

You probably should rename your images so they have no spaces in them.
Unix systems work much better that way, and you will save yourself
some headaches. 

Reply via email to