# Problems using widetext.sty

I need to prepare a document for a journal and I'm using the twocolumn option in the article class. Now I have a horrible equation that makes use of the cases environment so it's hard to split up to make it fit into one column. I do not want to use the figure* environment because I have no control over where to put the equation.

What I want to do is to use the widetext package and make sure that this equation looks something like it would like when one uses revtex4. However, when compiling my document I get an error, namely "improper \prevdepth". Does anyone have a clue what I have to do here?

A minimum working example (using the actual formula)

\documentclass[twocolumn]{article}
\usepackage{widetext}
\usepackage{flushend}
\usepackage{cuted}

\begin{document}

a lot of text ...

Here
\begin{widetext}
\begin{eqnarray} \label{e27}
T_{nn''}^{mm''}=({-}1)^{p-p''}\,\dil_0^{\infty}\,J_{m-m''}(au)\,J_{n''}(bu)\,J_{n+1}(u)\,du~=
\begin{cases}
& \dfrac{(q{+}p'')!\,(p{-}p'')!}{(q{-}q'')!\,(p{+}q'')!}\,a^{m-m''}b^{n''}\,P_{p-p''}^{(m-m'',n'')}(1{-}2A^2)P_{p-p''}^{(m-m'',n'')}(2B^2{-}1)~~~ \\ & \text{when}~~~n-n''\geq m-m''\geq0~,\\
\\
& \dfrac{(p{+}q'')!\,(q{-}q'')!}{(p{-}p'')!\,(q{+}p'')!}\,a^{m''-m}b^{n''}\,P_{q-q''}^{(m''-m,n'')}(1{-}2A^2)\,P_{q-q''}^{(m''-m,n'')}(2B^2{-}1)~~~ \\ & \text{when}~~~ n-n''\geq m''-m\geq0~, \\
\\
&0 ~~~ \text{otherwise}.
\end{cases}
\end{eqnarray}
\end{widetext}

a lot more text....
\end{document}


Any help would be greatly appreciated!

This works:

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{widetext}
\usepackage{flushend}
\usepackage{cuted}

\begin{document}

a lot of text ...

Here
\begin{widetext}
\label{e27} \begin{aligned} &T_{nn''}^{mm''}=({-}1)^{p-p''}\,d_0^{\infty}\,J_{m-m''}(au)\,J_{n''}(bu)\,J_{n+1}(u)\,du = \\ &\qquad\begin{cases} & \dfrac{(q{+}p'')!\,(p{-}p'')!}{(q{-}q'')!\,(p{+}q'')!}\,a^{m-m''}b^{n''}\,P_{p-p''}^{(m-m'',n'')} (1{-}2A^2)P_{p-p''}^{(m-m'',n'')}(2B^2{-}1) \\ & \text{when}~~~n-n''\geq m-m''\geq0~,\\ \\ & \dfrac{(p{+}q'')!\,(q{-}q'')!}{(p{-}p'')!\,(q{+}p'')!}\,a^{m''-m}b^{n''}\,P_{q-q''}^{(m''-m,n'')} (1{-}2A^2)\,P_{q-q''}^{(m''-m,n'')}(2B^2{-}1)~~~ \\ & \text{when}~~~ n-n''\geq m''-m\geq0~, \\ \\ &0\text{ otherwise}. \end{cases} \end{aligned}
\end{widetext}

a lot more text....
\end{document}


The version used of widetext.sty has been downloaded from

https://svn.einsteintoolkit.org/documents/Paper_EinsteinToolkit_2010/widetext.sty

• This example works for me, but only if I either (1) insert a blank line before \begin{widetext} or (2) make the "Here" paragraph longer; otherwise I still get \prevdepth errors. Could this just be weirdness with my setup, or did you run into anything like this? On a related note, I've seen several forum suggestions for inserting a blank line before \begin{strip} in this widetext.sty, which helps sometimes for me. – user17829 May 22 '13 at 6:31
• works nicely with epj templates. – souravc Feb 20 '15 at 5:14
• Is widetext still part of TeXLive? I have This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) and widetext doesn't work with article. I get ! LaTeX Error: Environment widetext undefined.. – alfC Nov 6 '17 at 17:30
• @alfC I don't think it has ever been in TeX Live. – egreg Nov 6 '17 at 17:35

I'm rewriting my answer because my previous one was actually wrong. I apologize if it wasted anybody's time.

I also got error messages related to \prevdepth. The problem seems to arise in the strip environment used within widetext.

The error message states \prevdepth cannot work in horizontal mode. As Chris White noted, adding a newline solves it since (I guess) it puts TeX in vertical mode.

In order to get it work, I modified widetext.sty, to start a new paragraph before the strip environment and corrected the vertical space to avoid an empty line in second column, as follows:

...
\if@twocolumn
\newenvironment{widetext}
{%
\par \vspace{-\baselineskip} % <-- this line added
\begin{strip}

...

\end{strip}
\par \vspace{-\baselineskip}\noindent % <-- this line added
\hspace*{-\parindent} % <-- this line added
}
...


I had to add these two lines at the end to prevent extra indentation at the first paragraph after widetext, the origin of which I don't know.

See if it works for you.

• I would favour some commands provided by package etoolbox, see for “Environment Hooks” in documentation. Also: The package cuted, to whome the environment strip belongs, provides a glue length \stripsep, what can be changed. See in according documentation, as well. – Speravir Dec 28 '13 at 18:50