[plug] LyX/LaTeX questions

Greg Gamble gregg at maths.uwa.edu.au
Wed Nov 3 23:07:25 WST 1999


Hi Christian,

   Ok ... I think I have found the problem. I needed to include a
\clearpage before changing the \thepage definition. That's why you
were apparently getting negative page numbers on the page before
the appendices ... it was actually <blank>-<page> since the chapter
counter is set to zero and \thepage is changed before LaTeX outputs
the page before the appendices. I believe I have also got the code
to work properly with the appendix package. Try this:

\makeatletter
\@ifpackageloaded{appendix}{\let\normalappendices\appendices}
                           {\let\normalappendices\appendix}
\let\normal at chapter\@chapter
\let\normal at schapter\@schapter
\newif\ifappendix
\def\appextra{\ifappendix \setcounter{page}{1} \fi}
\def\appendices{\clearpage\normalappendices\appendixtrue
       \renewcommand{\thepage}{\thechapter-\@arabic\c at page}}
\def\endappendices{\appendixfalse\clearpage
     \renewcommand{\thepage}{\@arabic\c at page}
     \setcounter{page}{1}}
\def\@chapter[#1]#2{\normal at chapter[#1]{#2}\appextra}
\def\@schapter#1{\normal at schapter{#1}\appextra}
\makeatother

(That should work with or without the appendix package.)

> > Not having used LyX, I don't understand the interaction
> > LyX/LaTeX. How does it work?
> 
> Basically it's a GUI front-end.  You don't have to write the LaTeX code
> yourself in about 95% of common cases, you can just interact with it
> very much like a normal word processor.  For example, environments are
> selected from a combo box much like styles in WordPerfect et al. and
> you select the text to bold, emphasise it etc.  It also gives you some
> vague idea of what it will look like which makes things easier in a lot of
> cases.  It certainly makes LaTeX a lot more accessible and since you can
> add in raw LaTeX code too it's still reasonably flexible.  It's a really
> nice program. :-)

Oh, ok ... it sounds a bit like ScientificWord. I hope LyX does a
better job. The problem with ScientificWord is that it tries to give
you the WYSIWYG feel of the usual word processors ... and does things
like put explicit spacing in tables, (lots of \<space>s everywhere)
which goes against the whole idea of TeX/LaTeX which calculates where
to put things ... and in general does a much better job than a human
can do by eye. 

BTW the key modification in the thebibliography environment that I
gave before was to add the line:

\addcontentsline{toc}{chapter}{\bibname}

... just in case the package you are using doesn't include the
bibliography in the ToC.

  Regards,
  Greg Gamble <gregg at maths.uwa.edu.au>



More information about the plug mailing list