Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

This works:

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

\begin{document}

a lot of text ...

Here
\begin{widetext}
\begin{equation} \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{equation}
\end{widetext}

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

enter image description here

The version used of widetext.sty has been downloaded from

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

share|improve this answer
    
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. –  Chris White May 22 '13 at 6:31

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.

share|improve this answer
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  texenthusiast Aug 14 '13 at 22:51
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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