[Gllug] \pagestyle{mypagestyle} in LaTeX

Nix nix at esperi.demon.co.uk
Wed May 22 07:56:43 UTC 2002


On Tue, 21 May 2002, Stig Brautaset stipulated:
> I actually found the sollution on google, but I could not find any way
> other than defining a new command.

You could make every single letter active.

Er.

Perhaps not. ;}

> 
> \pagestyle{myheadings}
> \newcommand{\mysect}[1]{
>     \section{#1}
>     \markright{
>         \thesection. \uppercase{#1} 
>         \hfill 2AIT314, Stig Brautaset
>         \hspace{1in}
>     }
> }
> \newcommand{\mysubsect}[1]{
>     \subsection{#1}
>     \markright{
>         \thesubsection. \uppercase{#1} 
>         \hfill 2AIT314, Stig Brautaset
>         \hspace{1in}
>     }
> }
> 
> 
> and instead of using \section{ ... } I use \mysect{ ... } and
> \mysubsect{ ... }

You could wrap up \section in this new command, something like

\makeatletter
\let\re at lsection=\section
\def\realsection#1{\re at lsection{#1}}
\makeatother
\def\section#1{%
    \realsection{#1}%
    \markright{%
        \thesection. \uppercase{#1}%
        \hfill 2AIT314, Stig Brautaset
        \hspace{1in}}}

(written in a tearing hurry, ugly). Now \section has changed.

If you want to do this a lot you might find the preview.dtx macro
package useful: it has macros \pr at advise and \pr at advise@ship which are
sort of space-age versions of this, which ban recursive wrapping and so
forth.

-- 
`There are not words enough to describe how fucked up imake is.'
                                        --- Peter da Silva


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list