Whenever I compile my TeX file, I get the following warning
Unused global option(s) [english]
and
Underfull \hbox(badness 10000) in paragraph at lines 27-28
class-optionsparagraphs
Whenever I compile my TeX file, I get the following warning
Unused global option(s) [english]
and
Underfull \hbox(badness 10000) in paragraph at lines 27-28
Remove \FamilyProcessOptions[]{TEST}\relax
from your code. These keys of the family (keys with empty family memember) are set by \FamilyProcessOptions[.myReport.cls]{TEST}\relax
before the keys of the family member .myReport.cls
.
You could use \FamilyProcessOptions{TEST}\relax
. Then the keys of the family are set, followed by the keys of the family member .\@currname.\@currext
. While myReport.cls
is loaded, .\@currname.\@currext
represents .myReport.cls
.
Here are two suggestions depending on what you want to do:
\begin{filecontents}{myBase.sty}
\ProvidesPackage{myBase}
\RequirePackage{scrbase}% <- added
\DefineFamily{TEST}
%\DefineFamilyMember[]{TEST}% family itself -> can be removed
\FamilyBoolKey[]{TEST}{inheritedopt}{TEST@inheritedopt}% inheriteopt is key of family TEST
\end{filecontents}
\begin{filecontents}{myReport.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myReport}
\RequirePackage{scrbase}
\RequirePackage{myBase}
\DefineFamily{TEST}
\DefineFamilyMember{TEST}% <- define family member .myReport.cls
\FamilyBoolKey{TEST}{classopt}{TEST@classopt}% classopt is key of family member .myReport.cls
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrreprt}}% pass unknown options to the parent class
\FamilyProcessOptions{TEST}\relax% process family options and options of family member .myReport.cls
\LoadClass{scrreprt}
\end{filecontents}
\documentclass[
inheritedopt=true,
classopt=true
]{myReport}
\begin{document}
\makeatletter
\ifTEST@classopt
classopt=true
\else
classopt=false
\fi
\quad
\ifTEST@inheritedopt
inheriteopt=true
\else
inheriteopt=false
\fi
\makeatother
\end{document}
or
\begin{filecontents}{myBase.sty}
\ProvidesPackage{myBase}
\RequirePackage{scrbase}% <- added
\DefineFamily{TEST}
\DefineFamilyMember{TEST}% <- define family member .myBase.sty
\FamilyBoolKey{TEST}{inheritedopt}{TEST@inheritedopt}% inheriteopt is key of family member .myBase.sty
\FamilyProcessOptions{TEST}\relax% process (family options and) options of family member .myBase.cls
\end{filecontents}
\begin{filecontents}{myReport.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myReport}
\RequirePackage{scrbase}
\DefineFamily{TEST}
\DefineFamilyMember{TEST}% <- define family member .myReport.cls
\FamilyBoolKey{TEST}{classopt}{TEST@classopt}% classopt is key of family member .myReport.cls
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrreprt}}% pass unknown options to the parent class
\FamilyProcessOptions{TEST}\relax% process (family options and) options of family member .myReport.cls
\LoadClass{scrreprt}
\RequirePackage{myBase}% <- moved
\end{filecontents}
\documentclass[
inheritedopt=true,
classopt=true
]{myReport}
\begin{document}
\makeatletter
\ifTEST@classopt
classopt=true
\else
classopt=false
\fi
\quad
\ifTEST@inheritedopt
inheriteopt=true
\else
inheriteopt=false
\fi
\makeatother
\end{document}
Other example (regarding the update in the question):
\begin{filecontents}{myBase.sty}
\ProvidesPackage{myBase}
\RequirePackage{scrbase}% <- added
\DefineFamily{TEST}
\DefineFamilyMember{TEST}% <- define family member .myBase.sty
\FamilyBoolKey{TEST}{inheritedopt}{TEST@inheritedopt}% inheriteopt is key of family member .myBase.sty
\FamilyProcessOptions{TEST}\relax% process (family options and) options of family member .myBase.cls
\ifTEST@inheritedopt
\RequirePackage{showframe}
\else
\Ifundefinedorrelax{KOMAoptions}{}{\KOMAoptions{paper=landscape}}
\fi
\end{filecontents}
\begin{filecontents}{myReport.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myReport}
\RequirePackage{scrbase}
\DefineFamily{TEST}
\DefineFamilyMember{TEST}% <- define family member .myReport.cls
\FamilyBoolKey{TEST}{classopt}{TEST@classopt}% classopt is key of family member .myReport.cls
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrreprt}}% pass unknown options to the parent class
\FamilyProcessOptions{TEST}\relax% process (family options and) options of family member .myReport.cls
\LoadClass{scrreprt}
\RequirePackage{myBase}% <- moved
\end{filecontents}
\documentclass[
inheritedopt=true,
classopt=true
]{myReport}
\begin{document}
\makeatletter
\ifTEST@classopt
classopt=true
\else
classopt=false
\fi
\quad
\ifTEST@inheritedopt
inheriteopt=true
\else
inheriteopt=false
\fi
\makeatother
\end{document}
Best Answer
This really depends on the class you're using and/or your document preamble, but you're probably calling
If the (global) option
english
is not used by the<class>
it is passed to and package you might load along the way. If TeX reaches\begin{document}
without theenglish
option being used, it'll issue a warning and reference all unused options.Typically
english
is used withbabel
, so you can addto your preamble for
english
to be properly used, or remove theenglish
option altogether from loading the class.Your second question is addressed here: What are underfull hboxes and vboxes and how can I get rid of them?