3

Using this code, I am facing the problem shown in the right side of the picture. The Equation spans beyond the page margin on the right.

\documentclass[aps,prl,reprint]{revtex4-1}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{bm}        % for math
\usepackage{verbatim}   % for math
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{amssymb}
\usepackage{adjustbox}
\DeclareMathOperator{\RE}{Re}
\DeclareMathOperator{\IM}{Im}
\newcommand{\revtex}{REV\TeX\ }
\newcommand{\classoption}[1]{\texttt{#1}}
\newcommand{\macro}[1]{\texttt{\textbackslash#1}}
\newcommand{\m}[1]{\macro{#1}}
\newcommand{\env}[1]{\texttt{#1}}
\setlength{\textheight}{9.5in}
\newenvironment{psmallmatrix}
  {\left[\begin{smallmatrix}}
  {\end{smallmatrix}\right]}
\begin{document}
\begin{align*}
\tiny{var(\mathbf{\theta^* - \hat{\theta^*}})} \ge
\begin{psmallmatrix}
   2 & 0 & 0 & 0 & 0  \\[3ex]
   0 & 2 &  0 & 0 & 0 \\[3ex]
  0  &  0 & 2 & 0 & 0\\[3ex]
  0 &  0 & 0  & 2 & 0 \\[3ex]
  0 & 0 & 0 & 0 & 1
  \end{psmallmatrix}
 \begin{psmallmatrix}
   \tiny{J_{11}^{-1}} & \tiny{0} & \tiny{\Delta_1^{-1}} & -\Delta_1^{-1}J_{14}{J_{24}}^{-1} & 0  \\[3ex]
   0 & J_{22}^{-1} &  {-J_{24}}^{-1}J_{23}\Delta_1^{-1} & {J_{24}}^{-1}+{J_{24}}^{-1}J_{23}\Delta_1^{-1}J_{14}J_{24}& 0 \\[3ex]
  \Delta_2^{-1}  & -\Delta_2^{-1}J_{32}J_{42}^{-1} & J_{33}^{-1} & 0 & 0\\[3ex]
 \tiny{-J_{42}^{-1}J_{41}\Delta_2^{-1}} & {J_42}^{-1} + {J_42}^{-1}J_{41}\Delta_2^{-1}J_{32}{J_42}^{-1}  & 0  & J_{44}^{-1} & 0 \\[3ex]
  0 & 0 & 0 & 0 & 1
  \end{psmallmatrix}
\end{align*}

\end{document}

picture

I tried using the

\begin{figure*}[b]%% over both colum
\begin{align*}

\nonumber
\end{align*}
\end{figure*}

But the problem with this command is that the equation / matrix appears at the bottom of the page whereas, the text describing / referencing to this Equation is somewhere else in the document. This approach is very unappealing visually. So, is there a command so that the matrix / equation appears with the text and also fits in the page for an article in double column.

Question : How can I break the two column format in specific areas where an Equation extends beyond the page margin? I have several such large matrices in my document. I am using WinEdit7.1 Editor.

UPDATE: This is the output that I am getting based on the answer. The problem still remains as can be seen from the picture; the equation goes beyond the margin on right side.

new

2
  • 2
    ! LaTeX Error: \begin{document} ended by \end{ducument}. Commented Apr 30, 2017 at 21:17
  • sorry for the typo in the spelling of \document. I have fixed it
    – SKM
    Commented Apr 30, 2017 at 21:23

3 Answers 3

8

You can't fit that beast in a narrow column.

Unless you decide to go for a figure* environment, you can use symbolic names for the big expressions. Very small expressions are difficult to read and should only be used in emergency situations.

\documentclass[aps,prl,reprint]{revtex4-1}

\usepackage{amsmath}
\usepackage{bm} % after amsmath!
\usepackage{amssymb}

\usepackage{lipsum} % for the context

\DeclareMathOperator{\RE}{Re}
\DeclareMathOperator{\IM}{Im}

\newenvironment{psmallmatrix}
  {\left[\begin{smallmatrix}}
  {\end{smallmatrix}\right]}

\begin{document}

\lipsum*[2]
\begin{equation*}
\mathit{var}(\mathbf{\theta^* - \widehat{\theta^*}}) \ge
\begin{bmatrix}
  2 & 0 & 0 & 0 & 0 \\
  0 & 2 & 0 & 0 & 0 \\
  0 & 0 & 2 & 0 & 0 \\
  0 & 0 & 0 & 2 & 0 \\
  0 & 0 & 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
  a_{11} & 0      & a_{13} & a_{14} & 0 \\
  0      & a_{22} & a_{23} & a_{24} & 0 \\
  a_{31} & a_{32} & a_{33} & 0      & 0 \\
  a_{41} & a_{42} & 0      & a_{44} & 0 \\
  0      & 0      & 0      & 0      & 1
  \end{bmatrix}
\end{equation*}
where
\begin{align*}
a_{11}&=J_{11}^{-1} \\
a_{13}&=\Delta_1^{-1} \\
a_{14}&=-\Delta_1^{-1}J_{14}^{}J_{24}^{-1}\\
a_{22}&=J_{22}^{-1}\\
a_{23}&=-J_{24}^{-1}J_{23}^{}\Delta_1^{-1}\\
a_{24}&=J_{24}^{-1}+J_{24}^{-1}J_{23}^{}\Delta_1^{-1}J_{14}^{}J_{24}^{}\\
a_{31}&=\Delta_2^{-1}\\
a_{32}&=-\Delta_2^{-1}J_{32}^{}J_{42}^{-1}\\
a_{33}&=J_{33}^{-1}\\
a_{41}&=-J_{42}^{-1}J_{41}^{}\Delta_2^{-1}\\
a_{42}&=J_{42}^{-1} + J_{42}^{-1}J_{41}^{}\Delta_2^{-1}J_{32}^{}J_{42}^{-1}\\
a_{44}&=J_{44}^{-1}
\end{align*}
\lipsum[3-9]

\end{document}

enter image description here

4

Revtex defines the widetext environment for such exceptional situations. It interrupts the two column mode and balances the text above the environment:

\documentclass[aps,prl,reprint]{revtex4-1}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{bm} % for math
\usepackage{verbatim} % for math
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{amssymb}
\usepackage{adjustbox}
\DeclareMathOperator{\RE}{Re}
\DeclareMathOperator{\IM}{Im}
\newcommand{\revtex}{REV\TeX\ }
\newcommand{\classoption}[1]{\texttt{#1}}
\newcommand{\macro}[1]{\texttt{\textbackslash#1}}
\newcommand{\m}[1]{\macro{#1}}
\newcommand{\env}[1]{\texttt{#1}}
\setlength{\textheight}{9.5in}
\newenvironment{psmallmatrix}
  {\left[\begin{smallmatrix}}
  {\end{smallmatrix}\right]}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}
\usepackage{lipsum}

\begin{document}

\lipsum[1-3]
\begin{widetext}
\begin{align*}
var(\mathbf{\theta^* - \hat{\theta^*}}) \ge
\begin{psmallmatrix}
   2 & 0 & 0 & 0 & 0 \\[3ex]
   0 & 2 & 0 & 0 & 0 \\[3ex]
  0 & 0 & 2 & 0 & 0\\[3ex]
  0 & 0 & 0 & 2 & 0 \\[3ex]
  0 & 0 & 0 & 0 & 1
  \end{psmallmatrix}
 \begin{psmallmatrix}
   J_{11}^{-1} & 0 & \Delta_1^{-1} & -\Delta_1^{-1}J_{14}{J_{24}}^{-1} & 0 \\[3ex]
   0 & J_{22}^{-1} & {-J_{24}}^{-1}J_{23}\Delta_1^{-1} & {J_{24}}^{-1}+{J_{24}}^{-1}J_{23}\Delta_1^{-1}J_{14}J_{24}& 0 \\[3ex]
  \Delta_2^{-1} & -\Delta_2^{-1}J_{32}J_{42}^{-1} & J_{33}^{-1} & 0 & 0\\[3ex]
 -J_{42}^{-1}J_{41}\Delta_2^{-1} & {J_42}^{-1} + {J_42}^{-1}J_{41}\Delta_2^{-1}J_{32}{J_42}^{-1} & 0 & J_{44}^{-1} & 0 \\[3ex]
  0 & 0 & 0 & 0 & 1
  \end{psmallmatrix}
\end{align*}
\end{widetext}
\lipsum[4-6]

\end{document}

enter image description here

0
3

enter image description here

Note you can not use size commands in math mode, and if you use them in text they do not take an argument, the syntax is \tiny abc not \tiny{abc}

You can always just leave a space in the second column. You need to leave it until the final edit to tweak the position, but

\documentclass[aps,prl,reprint]{revtex4-1}
\usepackage{amsfonts}
\usepackage{amsmath}
\DeclareMathOperator{\RE}{Re}
\DeclareMathOperator{\IM}{Im}
\newcommand{\revtex}{REV\TeX\ }
\newcommand{\classoption}[1]{\texttt{#1}}
\newcommand{\macro}[1]{\texttt{\textbackslash#1}}
\newcommand{\m}[1]{\macro{#1}}
\newcommand{\env}[1]{\texttt{#1}}
\setlength{\textheight}{9.5in}
\newenvironment{psmallmatrix}
  {\left[\begin{smallmatrix}}
  {\end{smallmatrix}\right]}
\DeclareMathOperator\var{var}
\begin{document}

\par\noindent X\dotfill X
\par\noindent X\dotfill X
\par\noindent X\dotfill X

\begin{flushleft}
\makebox[0pt][l]{$
\var(\mathbf{\theta^* - \hat{\theta^*}}) \ge
\begin{psmallmatrix}
   2 & 0 & 0 & 0 & 0  \\[3ex]
   0 & 2 &  0 & 0 & 0 \\[3ex]
  0  &  0 & 2 & 0 & 0\\[3ex]
  0 &  0 & 0  & 2 & 0 \\[3ex]
  0 & 0 & 0 & 0 & 1
  \end{psmallmatrix}
 \begin{psmallmatrix}
   J_{11}^{-1} & 0 & \Delta_1^{-1} & -\Delta_1^{-1}J_{14}{J_{24}}^{-1} & 0  \\[3ex]
   0 & J_{22}^{-1} &  {-J_{24}}^{-1}J_{23}\Delta_1^{-1} & {J_{24}}^{-1}+{J_{24}}^{-1}J_{23}\Delta_1^{-1}J_{14}J_{24}& 0 \\[3ex]
  \Delta_2^{-1}  & -\Delta_2^{-1}J_{32}J_{42}^{-1} & J_{33}^{-1} & 0 & 0\\[3ex]
 -J_{42}^{-1}J_{41}\Delta_2^{-1} & {J_42}^{-1} + {J_42}^{-1}J_{41}\Delta_2^{-1}J_{32}{J_42}^{-1}  & 0  & J_{44}^{-1} & 0 \\[3ex]
  0 & 0 & 0 & 0 & 1
  \end{psmallmatrix}
$}
\end{flushleft}

\par\noindent X\dotfill X
\par\noindent X\dotfill X
\par\noindent X\dotfill X
\par\noindent X\dotfill X
\par\noindent X\dotfill X

\vspace*{11\baselineskip}

\par\noindent X\dotfill X
\par\noindent X\dotfill X
\par\noindent X\dotfill X

\end{document}
5
  • Thank you for you reply, but I am getting the same output as before. I replaced my code with the part starting from \begin{flushnet} ....\end{flushnet} but still the matrix goes beyond the right margin.
    – SKM
    Commented Apr 30, 2017 at 21:42
  • I have added the output under the update
    – SKM
    Commented Apr 30, 2017 at 21:47
  • @SKM This version assumes that you can enter the equation in the left column, if you need to add it in the right then you eould need flusright not flushleft and [r] not [l] and move the vspace to the first column. Commented Apr 30, 2017 at 22:05
  • Thank you for your explanation. Can you kindly say how you get the value 11 in the command \vspace*{11\baselineskip}
    – SKM
    Commented Apr 30, 2017 at 22:14
  • @SKM just by eye: I guessed 7 originally, but it overprinted the text so i made the gap bigger. Commented May 1, 2017 at 7:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .