\Aboxed
(From mathtools
) is designed to put a box across an alignment point (Refer mathtools
documentation, section- 3.4.5, page 18). Hence,
\Aboxed{\omega(\sigma_{ij}) &\equiv 1 - \left(\frac{27J_3}{2\sigma_e^3}\right)^2 }\
works. The \Aboxed
command is defined as (from mathtools.sty
)
\newcommand\Aboxed[1]{\@Aboxed#1\ENDDNE}
\def\@Aboxed#1\ENDDNE{%
\settowidth\@tempdima{$\displaystyle#1{}$}%
\addtolength\@tempdima{\fboxsep}%
\addtolength\@tempdima{\fboxrule}%
\global\@tempdima=\@tempdima
\kern\@tempdima
&
\kern-\@tempdima
\boxed{#1#2}
}
Hence, when you use \Aboxed
, TeX will greedily look for an &
(alignment character) and when it is not found, an error is returned.
If you want a box only for a portion without an alignment point inside, you can use boxed
(basically from amsmath
and mathtools
loads amsmath
also) as
& = \boxed{ \omega(L) = 1 - \frac{\left( 9L - L^3\right)^2}{\left(L^2+3\right)^3}. }
The boxed
command is defined as (from amsmath.sty
)
\newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
which does not have any concern for the alignment character &
. (Hence it will not work across &
.)
Conclusion: If you want a box to cross through an alignment point, use \Aboxed
. On the other hand, if the box is for only a portion without alignment point, use \boxed
Complete MWE will be:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
\Aboxed{\omega(\sigma_{ij}) &\equiv 1 - \left(\frac{27J_3}{2\sigma_e^3}\right)^2 }\\
& = \boxed{ \omega(L) = 1 - \frac{\left( 9L - L^3\right)^2}{\left(L^2+3\right)^3}. }
\end{align*}
\end{document}
I managed to solve the "problem" as it turned out not to be problem at all.
As already stated in the question, removing the twoside
option resulted in the MWE functioning again. At first I didn't realise this, but as the book
documentclass has by default the layout set as two-sided! So including it doesn't add anything, but more importantly, removing the statement doesn't change anything either!
In essence, the fix in the question was already the answer, but it is a mystery why the explicit statement of a default setting would result in these error messages.
I then did some further testing with classes that do not as a default have the twoside
option enabled such as the article
class. Without any statement (so default, oneside
) the effect is as desired and doesn't give any error messages. However, when the option twoside
is passed it again results in errors.
In summary, it would seem that the fltpage
and caption
packages are incompatible when used in a documentclass that:
a. has not, by default, a twoside
layout; and a twoside
layout is required and therefore passed as an option; or
b. has by default a twoside
layout but this is also given as a statement when devining the documentclass.
My question related to the second option and is therefore answered, remove the optional mentioning of the twoside
option. The issue remains for people wanting to use it in other documentclasses such as article
, in combination with twoside
layout.
Best Answer
That error message is evidence for a fragile command in a moving argument; in this case it's
\mathmakebox
; when in a caption, use\protect
in front of it.Better, define a new command for complicated constructions:
and in your document type
\leftarrowbox
.I hope you're not loading
MnSymbol
just to get\smallsquare
. See Importing a Single Symbol From a Different Font for a workaround. With the standard fonts you can get away with