I do not undestand how to pass options to the parent class when writting a child class. I tried several possibilities but I never get flush left aligned equations.
I do understand the difference between LoadClass
and LoadClassWithOptions
but I think this is not the problem here. The uncommented lines correspond to what I understand from the document clsguide.pdf but it does not work.
\RequirePackage{filecontents}
% my class file
\begin{filecontents}{baz.cls}
\PassOptionsToClass{fleqn}{article}
\ProcessOptions\relax
%\LoadClass[fleqn]{article}
\LoadClass{article}
%\LoadClassWithOptions{article}
\RequirePackage{amsmath}
\end{filecontents}
\documentclass{baz}
%\documentclass[fleqn]{baz}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{equation*}
e^{i\pi} + 1 = 0
\end{equation*}
\lipsum[2]
\end{document}
Best Answer
The confusion in this example is coming from the fact that it is really the
amsmath
package that needs to know about thefleqn
option. As it stands you are passing no options toamsmath
. One working set up would be:baz.sty
:tex file:
Here you see additional options being passed on to the class, which is loaded additionally with
fleqn
option. The packageamsmath
is loaded with thefleqn
option too. In this case, it may well be the package option is unnecessary, but this mimics the effect of