I need to check where the text (from package .sty), if it is in the mainmatter section, then include some headers \pagestyle{LL}, if the other then \pagestyle{plain} or some other.
Construction \ifx\@mainmattertrue\pagestyle{LL}\else\pagestyle{plain}\fi in:
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{New}[2014/12/12]
\DeclareOption{LL}{\AtEndOfPackage{\llstyle}}
\ProcessOptions\relax
\RequirePackage{textcase}
\def\ps@LL{
%------------------Колонтитули---------------------
%------------------Верхні--------------------------
\renewcommand{\@evenhead}%
{\raisebox{0pt}[\headheight][0pt]{% начало блока
\vbox{\hbox to\textwidth{\strut
\small{\thepage\hfil\MakeUppercase{BlaBla}\hfil{GL}. \thechapter}}\hrule}}% конец блока
}% конец макроопределения
\renewcommand{\@oddhead}%
{\raisebox{0pt}[\headheight][0pt]{% начало блока
\vbox{\hbox to\textwidth{\strut
\small{{\S\hspace{1ex}}\thesection\hfil\MakeUppercase{Bla1}\hfil\thepage}}\hrule}}% конец блока
}% конец макроопределения
}
\def\@LLview{
\ifx\@mainmattertrue\pagestyle{LL}\else\pagestyle{plain}\fi
}
\def\llstyle
{
\@ifclassloaded{book}{\@LLview}{}
\@ifclassloaded{extbook}{\@LLview}{}
}
\endinput
does not work in
\documentclass[12pt,twoside]{book}
\usepackage[cp1251]{inputenc}
\usepackage[english]{babel}
\usepackage[LL]{New}
\usepackage{lipsum}
\begin{document}
\frontmatter
\chapter{Intro}
\lipsum[1-6]
\mainmatter
\chapter{One}
\lipsum[1-10]
\end{document}
Why?
bookclass makes that test for chapters, you can have a look at it. – Johannes_B Dec 18 '14 at 08:25mainmatter, redefine or patchmainmatter. When the package is executed, you cannot be in mainmatter. Next topic: Difference between \if and \ifx – Johannes_B Dec 18 '14 at 09:15