Re: Powersem to load book or report class
Stephan Lehmke <[email protected]> Tue, 6 May 2003 14:59:10 +0200 (MEST)
| Newsgroups | gmane.comp.tex.texpower.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Pascal,
first of all, sorry for the very late reply. I hope you are still
with us...
I'll have a lot of time for working of TeXPower this summer,
so I hope you'll keep up your valuable contributions.
Unfortunately, it seems you're referring to an old version
of TeXPower, so the system has diverged in some parts from
your suggestions.
I'll try to merge both as good as possible, please comment
on my `solutions'.
Pascal Kockaert wrote on Fri, 28 Feb 2003 10:14:25 +0100:
>
>Hi to everybody on the list, and especially to Stephan.
>
>My aim is to produce dynamic presentations with powersem/TeXpower,
>while at the same using the "article mode" of seminar to produce
>notes. In this mode, each slide is turned into a figure (a float)
>which is included in the text.
>
>The default and only choice of underlying class with seminar is
>"article" (which is not to be confused with the article option to
>obtain slides included in the text).
>
>I would like to produce notes with the underlying book class. This
>is why I tried to hack a little bit the seminar class so that it
>loads book instead of article. This done, I had a look at the
>powersem.cls code and noticed that everything is already there,
>but to use the KOMAscript class.
In the meantime, there's a macro \baseclass which is used as
the name of the class to load if the KOMA option is set, initially
defined as
\providecommand{\baseclass}{scrartcl}
which I redefine for instance to scrreprt to have slides with
\chapter.
But maybe the KOMA option is misleading in this case...
I added an Option UseBaseClass which is equivalent.
>
>I have modified these definitions in order to be able to choose
>between article (default), book, report and scrartcl classes.
>
>The changes that I made are included at the end of this message.
>
>In the original version of powersem.cls, I did not understand why
>you load the article classe like this:
> \oldLC@PS[#2]{article}
>In this case, the options are, in fact, the name of the class, which is
>"article".
>I also modified the command to load any class with options: \oldLC@PS[#1]{#2}.
>Maybe there was a reason to load any class with \oldLC@PS{#2}.
No. Both were just errors left from different early stages of
development. Both are fixed now.
>As I want to be able to use the article mode, I had to comment the line
>saying \portraittrue.
>Do you really need to impose this mode? I know that it is useful to have
>\portraittrue to
>correctly select the page dimensions. I do this in my seminar configuration
>file, by the lines:
>\@ifclassloaded{seminar}
> { \ifarticle
> \edef\special@paper{\the\paperwidth,\the\paperheight}%
> \fi}{}%
I've disabled \portraittrue if the article option was given, but
I'm not convinced ;-)
I'm afraid this whole matter needs a much deeper looking into
(and rewriting) than I've done previously...
>I think that it would significantly extent the power of powersem, if you
>decided to allow for the choice of other classes, like book,
>report etc.
Right.
Concerning your code:
>%------------------------------------------------------------------------------
--------------------------------
>% The (\cl@ss@PS=book, KOMA, report) option tells powersem to load
>\cl@ss@PS instead of article.
>
>\newboolean{class@PS}
>\setboolean{class@PS}{false}
>\DeclareOption{KOMA} {\setboolean{class@PS}{true}\def\cl@ss@PS{scrartcl}}
>\DeclareOption{reportclass}{\setboolean{class@PS}{true}\def\cl@ss@PS{report}}
>\DeclareOption{bookclass} {\setboolean{class@PS}{true}\def\cl@ss@PS{book}}
>
I've added options reportclass and bookclass which are defined in
terms of the (more flexible) pre-existing \baseclass.
>% Now we need to hack a little to make seminar load \cl@ss@PS instead of
>article (if the option bookclass,reportclass or KOMA was given).
>
>\ifthenelse{\boolean{class@PS}}
>{%
> \def\article@PS{article}
>
>% Make \PassOptionsToClass and \LoadClass use \cl@ss@PS...
>
> \let\oldPOTC@PS=\PassOptionsToClass
>
\def\PassOptionsToClass#1#2{\edef\cls@PS{#2}\ifx\article@PS\cls@PS\oldPOTC@PS{#1
}{\cl@ss@PS}\else\oldPOTC@PS{#1}{#2}\fi}
>%%%PK
> }
>{}
>
>% Furthermore, seminar redefines \paperheight and \paperwidth, saving their
>value in \sem@paperheight and
>% \sem@paperwidth. We undo this so the paper dimension calculation of
>typearea can be used.
>
>\let\oldLC@PS=\LoadClass
>\renewcommand{\LoadClass}[2][]%
>{%
> \edef\cls@PS{#2}%
> \ifx\article@PS\cls@PS
> \let\paperheight\sem@paperheight\let\paperwidth\sem@paperwidth
>
\ifthenelse{\boolean{class@PS}}{\oldLC@PS[#1]{\cl@ss@PS}}{\oldLC@PS[#1]{article}
}
>%%%PK
>%%%PK%%% \portraittrue
> \else
> \oldLC@PS[#1]{#2}% %%%PK
> \fi
> }%
Instead of removing \portraittrue, I replaced it by
\ifarticle\else\portraittrue\fi
to disable it only when making articles.
Could you try the latest CVS version of powersem I've just uploaded?
regards
Stephan
--
Stephan Lehmke [email protected]
Fachbereich Informatik, LS I Tel. +49 231 755 6434
Universitaet Dortmund FAX 6555
D-44221 Dortmund, Germany
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf