0
\begin{equation}
\label{4.12}
\scalebox{0.6}
{
    $\mathcal{Z}$
    =
    \begin{bmatrix}
    W_{1,1,1} & \dots & W_{1,K,1} & & W_{n,1,1} & \dots  & W_{n,K,1} \\
    \vdots & \ddots & \vdots & \dots & \vdots & \ddots &\vdots \\
    W_{1,1,F} & \dots & W_{1,K,1} &  & W_{n,1,1} & \dots  & W_{n,K,1}
    \end{bmatrix}
    \begin{bmatrix}
    Q_{1,1} & 0 & \dots & \vdots & \dots & \dots  & 0 \\
    0 & \ddots & 0 & \vdots & \ddots & \ddots &\vdots \\
    \vdots & \dots & Q_{1,K,1} & \vdots & \ddots & \ddots  & \vdots\\
    \dots & \dots & \dots & \dots & \dots & \dots &\dots \\
    \vdots & \ddots & \ddots & & Q_{n,1} & 0  & \vdots \\
    \vdots & \ddots & \ddots & \vdots & 0 & \ddots 0 \\
    0 & \dots & \dots & \vdots & \dots & 0 & Q_{n,K}\\
    \end{bmatrix}
    \begin{bmatrix}
    x_{11} & x_{12} & x_{13} \\
    x_{21} & x_{22} & x_{23} \\
    \vdots & \vdots & \vdots \\
    x_{d1} & x_{d2} & x_{d3} 
    \end{bmatrix}
    $\approx$
    \begin{bmatrix}
    \mathcal{Z}_1 \\
    \vdots \\
    \mathcal{Z}_n
    \end{bmatrix}
}
\end{equation}
  • 1
    your matrix is not in math mode But why are you going in and out of math mode: $\approx$ just puts the approx in math mode and comes out of math for the matrix, you want a single $....$ for the entire scalebox. (but I would never put math in a \scalebox) – David Carlisle Oct 2 '18 at 11:12
  • Pretty much all box macros (not found in mathtools) will take you out of math mode; e.g. \fbox{$\displaystyle ...$} – John Kormylo Oct 2 '18 at 20:04
0

enter image description here

Don't come in an out of math mode around each operator. And only use \scalebox as an absolute last resort.

\documentclass[a4paper]{article}

\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}


scale
\begin{equation}
\label{scaled}% best not to use numbers in \label \label{4.12}
\scalebox{0.6}
{$\displaystyle
    \mathcal{Z}
    =
    \begin{bmatrix}
    W_{1,1,1} & \dots & W_{1,K,1} & & W_{n,1,1} & \dots  & W_{n,K,1} \\
    \vdots & \ddots & \vdots & \dots & \vdots & \ddots &\vdots \\
    W_{1,1,F} & \dots & W_{1,K,1} &  & W_{n,1,1} & \dots  & W_{n,K,1}
    \end{bmatrix}
    \begin{bmatrix}
    Q_{1,1} & 0 & \dots & \vdots & \dots & \dots  & 0 \\
    0 & \ddots & 0 & \vdots & \ddots & \ddots &\vdots \\
    \vdots & \dots & Q_{1,K,1} & \vdots & \ddots & \ddots  & \vdots\\
    \dots & \dots & \dots & \dots & \dots & \dots &\dots \\
    \vdots & \ddots & \ddots & & Q_{n,1} & 0  & \vdots \\
    \vdots & \ddots & \ddots & \vdots & 0 & \ddots 0 \\
    0 & \dots & \dots & \vdots & \dots & 0 & Q_{n,K}\\
    \end{bmatrix}
    \begin{bmatrix}
    x_{11} & x_{12} & x_{13} \\
    x_{21} & x_{22} & x_{23} \\
    \vdots & \vdots & \vdots \\
    x_{d1} & x_{d2} & x_{d3} 
    \end{bmatrix}
    \approx
    \begin{bmatrix}
    \mathcal{Z}_1 \\
    \vdots \\
    \mathcal{Z}_n
    \end{bmatrix}$}
\end{equation}

aligned
\begin{equation}
\label{aligned}% best not to use numbers in \label \label{4.12}
\begin{aligned}
    \mathcal{Z}
    =&
    \begin{bmatrix}
    W_{1,1,1} & \dots & W_{1,K,1} & & W_{n,1,1} & \dots  & W_{n,K,1} \\
    \vdots & \ddots & \vdots & \dots & \vdots & \ddots &\vdots \\
    W_{1,1,F} & \dots & W_{1,K,1} &  & W_{n,1,1} & \dots  & W_{n,K,1}
    \end{bmatrix}\\
&\qquad\qquad
    \begin{bmatrix}
    Q_{1,1} & 0 & \dots & \vdots & \dots & \dots  & 0 \\
    0 & \ddots & 0 & \vdots & \ddots & \ddots &\vdots \\
    \vdots & \dots & Q_{1,K,1} & \vdots & \ddots & \ddots  & \vdots\\
    \dots & \dots & \dots & \dots & \dots & \dots &\dots \\
    \vdots & \ddots & \ddots & & Q_{n,1} & 0  & \vdots \\
    \vdots & \ddots & \ddots & \vdots & 0 & \ddots 0 \\
    0 & \dots & \dots & \vdots & \dots & 0 & Q_{n,K}\\
    \end{bmatrix}\\
&\qquad\qquad\qquad
    \begin{bmatrix}
    x_{11} & x_{12} & x_{13} \\
    x_{21} & x_{22} & x_{23} \\
    \vdots & \vdots & \vdots \\
    x_{d1} & x_{d2} & x_{d3} 
    \end{bmatrix}
\\
    &\approx
    \begin{bmatrix}
    \mathcal{Z}_1 \\
    \vdots \\
    \mathcal{Z}_n
    \end{bmatrix}
\end{aligned}
\end{equation}


\end{document}
  • My equation was not showing mathcal(Z) without $. But problem was something else which is resolved by you.. Thanks – Yash Vardhan Varshney Oct 6 '18 at 7:23
0

The symbol $ is not for “printing strange symbols”. It enters math mode and a single formula should be between single $ signs. Also bmatrix is only legal in a math formula.

However, scaling matrices is not the best way to express such a formula: it will become tiny and unreadable.

Use block matrices, you'll do a better service to your readers.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Define, for $k=1,2,\dots,n$, the blocks
\begin{align*}
\mathcal{W}(k,K,F) &=
  \begin{bmatrix}
  W_{k,1,1} & \dots & W_{k,K,1} \\
  \vdots & \ddots & \vdots \\
  W_{k,1,F} & \dots & W_{k,K,F}
  \end{bmatrix}
\\
\mathcal{Q}(k,K) &= \operatorname{diag}(Q_{k,1},\dots,Q_{k,K})
\end{align*}
Let the $p\times q$  matrix $X_{p,q}$ have entries $x_{ij}$.
Then we have
\begin{equation}\label{whatever}
\begin{split}
\mathcal{Z} &=
\begin{bmatrix}
\mathcal{W}(1,K,F) & \dots & \mathcal{W}(n,K,F)
\end{bmatrix}
\begin{bmatrix}
\mathcal{Q}(1,K)& \dots & 0 \\
\vdots &  \ddots & \vdots \\
0 & \dots & \mathcal{Q}(n,K)
\end{bmatrix}
X_{nK,q}
\\
&\approx
\begin{bmatrix}
\mathcal{Z}_1 \\
\mathcal{Z}_2 \\
\vdots \\
\mathcal{Z}_F
\end{bmatrix}
\end{split}
\end{equation}

\end{document}

enter image description here

  • Thanks for your suggestion. I will definitely change my style of writing equation as suggested... Thanks – Yash Vardhan Varshney Oct 6 '18 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.