\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}
A couple of possibilities:
\documentclass[11pt,a4paper]{article}
\usepackage{dcolumn}
\newcolumntype{d}{D..{3.1}}
\begin{document}
\noindent X\dotfill X
\bigskip
\begin{table}[htp]% not ever [!h]
\centering
\setlength\tabcolsep{.37pt}
\small
\begin{tabular}{@{}|D..{2.0}|*{14}{d|}@{}}
\hline
\multicolumn{1}{|c|}{\footnotesize\bfseries SVM} &
\multicolumn{1}{c|}{1}
& \multicolumn{1}{c|}{2}
& \multicolumn{1}{c|}{3}
& \multicolumn{1}{c|}{4}
& \multicolumn{1}{c|}{5}
& \multicolumn{1}{c|}{6}
& \multicolumn{1}{c|}{7}
& \multicolumn{1}{c|}{8}
& \multicolumn{1}{c|}{9}
& \multicolumn{1}{c|}{10}
& \multicolumn{1}{c|}{11}
& \multicolumn{1}{c|}{12}
& \multicolumn{1}{c|}{13}
& \multicolumn{1}{c|}{14}
\\
\hline
1 & & & & & & & & & & & & & & 2.3 \\
\hline 2 & & & & & & & & & & & & & & 0.4 \\
\hline 3 & & & & & & & & & & & & & & \\
\hline 4 & & & & & & & & & & & & & & 0.2 \\
\hline 5 && & & & & & & & 0.7 & & & & & 1.2 \\
\hline 6 & & & & & & & & & & & & & & 0.3 \\
\hline 7 & & & & & & & & & & & & & & 0.2 \\
\hline 8 & & & & & & & & & & & & & & 0.1 \\
\hline 9 & & & & & & & & & 3.4 & & & & & 1.5 \\
\hline 10 & & & & & & & & & & 11.0 & & & & \\
\hline 11 & & & & & & & & & & & & & & 0.1 \\
\hline 12 & & & & & & & & & & & & & & 2.6 \\
\hline 13 & & & & & & & & & & & & & & 0.1 \\
\hline 14 & & & & & & & & & 0.2 & 0.3 & & & & 200.0 \\
\hline
\end{tabular}
\caption{Mean confusion matrices for the first multi-class classification.}
\label{table6}
\end{table}
\begin{table}[htp]% not ever [!h]
\centering
\setlength\tabcolsep{.58pt}
\small
\def\z{\multicolumn{1}{D.\cdot{2.2}}{.}}
\begin{tabular}{@{}D..{2.0}|*{14}{d}@{}}
\multicolumn{1}{c|}{\footnotesize\bfseries SVM} &
\multicolumn{1}{c}{1}
& \multicolumn{1}{c}{2}
& \multicolumn{1}{c}{3}
& \multicolumn{1}{c}{4}
& \multicolumn{1}{c}{5}
& \multicolumn{1}{c}{6}
& \multicolumn{1}{c}{7}
& \multicolumn{1}{c}{8}
& \multicolumn{1}{c}{9}
& \multicolumn{1}{c}{10}
& \multicolumn{1}{c}{11}
& \multicolumn{1}{c}{12}
& \multicolumn{1}{c}{13}
& \multicolumn{1}{c}{14}
\\
\hline
1 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 2.3 \\
2 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 0.4 \\
3 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & \\
4 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 0.2 \\
5 &\z &\z &\z &\z &\z &\z &\z &\z & 0.7 &\z &\z &\z &\z & 1.2 \\
6 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 0.3 \\
7 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 0.2 \\
8 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 0.1 \\
9 &\z &\z &\z &\z &\z &\z &\z &\z & 3.4 &\z &\z &\z &\z & 1.5 \\
10 &\z &\z &\z &\z &\z &\z &\z &\z &\z & 11.0 &\z &\z &\z & \\
11 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 0.1 \\
12 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 2.6 \\
13 &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z &\z & 0.1 \\
14 &\z &\z &\z &\z &\z &\z &\z &\z & 0.2 & 0.3 &\z &\z &\z & 200.0 \\
\end{tabular}
\caption{Mean confusion matrices for the first multi-class classification.}
\label{tablezz}
\end{table}
\end{document}
Best Answer
You need to enclose the
pmatrix
environment in a pair of braces{ }
The internal version of
\Aboxed
,\@Aboxed
, uses&
to split its argument. Normally, this just strips everything after a possible second&
, as in the second example below.In this case though, you’re splitting the
pmatrix
environment which would create a sequence of math-mode commands similar to the (commented) third example.The additional
{ }
hide these&
from the\@Aboxed
macro.Code
Output