7

I use scrbook class (see bellow) in my book and sometimes I need typeset wide equation.

\documentclass[%
    ,fontsize=12pt    % 
    ,a3paper         % pagesize
    ,twocolumn 
]{scrbook}
\areaset[5mm]{250mm}{350mm}
\unsettoc{toc}{twocolumn}

Is it possible to partially switch between one and two column formatting? I tried to use the library widetext, but I'm afraid that it is not a part of the MiKTeX distribution. I would like to typeset wide equation in the text, not only at a bottom or top side. Is it possible?

MNWE: (added wide equation; for \setchaptertoc see KOMA-Script (scrbook): onecolumn table of contents & minitoc in twocolumn document)

\documentclass[twocolumn]{scrbook}
\usepackage[nohints]{minitoc}
\usepackage{amsmath, amsthm, amssymb, amsfonts, amsbsy}
\usepackage{bigints}
\usepackage{mathtools}
\mtcsetrules{minitoc}{off}
\usepackage{lipsum}

\newcommand*{\setchaptertoc}{%
  \setchapterpreamble{
  \vspace{1.85\baselineskip} % workaround for removed rule
  \smash{\makebox[\linewidth]{\hrulefill}} % workaround for removed rule
  \vspace{-1.85\baselineskip} % workaround for removed rule
  \minitoc
  \vspace{-1.15\baselineskip} % workaround for removed rule
  \smash{\makebox[\linewidth]{\hrulefill}} % workaround for removed rule
  \vspace{1.15\baselineskip} % workaround for removed rule
}}
\newcommand{\dd}[1]{\hspace{2pt}d#1}

\begin{document}
\dominitoc
\tableofcontents

\setchaptertoc
\chapter{One}
\lipsum[1]
    \begin{equation}\label{fyz:fey_eq_elstat18}
      E_x(x_1, y_1, z_1) = 
        \int\limits_{\substack{\text{all}\\\text{area}}}\varrho(x_2, y_2, z_2)
        \frac{x_1-x_2}{[(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_2)^2]^{\frac{3}{2}}}\dd{x_2}\dd{y_2}\dd{z_2}
    \end{equation} 
\lipsum[1]    
\section{One, one}
\lipsum[2]
\subsection{One, one, one}
\lipsum[3]
\section{One, two}
\lipsum[4]

\setchaptertoc
\chapter{Two}
\lipsum[5]
\section{Two, one}
\lipsum[6]
\section{Two, two}
\subsection{two, two, one}
\lipsum[7]

\setchaptertoc
\chapter{Three}
\section{Three, one}
\lipsum[8]
\section{Three, two}
\lipsum[9]
\end{document}

enter image description here

4
  • 1
    i don't use scrbook, so this is just a suggestion. it is unlikely that you can do what you want using the twocolumn option -- switching between twocolumn and onecolumn forces a page break with every change. instead, take a look at the multicol package, which does allow such switching. Dec 26, 2013 at 13:19
  • This is not duplicate question. Please, try found widetext library in your Miktex distribution. I guess you will not be successful. Until now I used multicol, but I was hoping that it could be solved within koma-script and its possibilities.
    – JardaFait
    Dec 26, 2013 at 15:05
  • 1
    @jafan Barbara did not mention widetext, so I guess, the comment was removed. A simple search with your favorite searching engine should give you Geekery: Widetext in LaTeX (outside RevTeX4). The needed sttools is part of MiKTeX or can be installed. If you had provided a minimal example I could have test it and write a full answer. For a working download link of “widetext.sty” see egreg’s answer to “Problems using widetext.sty”.
    – Speravir
    Dec 27, 2013 at 1:50
  • @Speravir thank you very much. I added MNWE and picture of its behavior.
    – JardaFait
    Dec 27, 2013 at 9:51

1 Answer 1

8

Your problem can be solved with “widetext.sty”. This package mimicing the mechanism with the same name from RevTeX4 was written by Anjishnu Sarkar. Alas, the original home went away. Luckily, we can get a copy from a svn site of Einstein Toolkit, because they have used it for a document (direct link): https://svn.einsteintoolkit.org/documents/Paper_EinsteinToolkit_2010/widetext.sty

Save this package file and put it into your folder for your actual document or, in my eyes better: put into a local TEXMF directory. Since you mentioned MiKTeX in a comment, see Create a local texmf tree in MiKTeX. But if your later want to give away the sources, do not forget to add “widetext.sty”, then.

Here’s an MWE, some explication follows below:

\documentclass[twocolumn]{scrbook}
\usepackage[nohints]{minitoc}
\usepackage{amsmath, amsthm, amssymb, amsfonts, amsbsy}
\usepackage{bigints}
\usepackage{mathtools}
\usepackage{lipsum,kantlipsum}

\usepackage{widetext}% needs packages "flushend" & "cuted" of "sttools"
                     % bundle, which perhaps must separately be installed

\newcommand{\dd}[1]{\hspace{2pt}d#1}

\begin{document}

\chapter{One}
\lipsum[1]
\begin{widetext}
  \begin{equation}\label{fyz:fey_eq_elstat18}
    E_x(x_1, y_1, z_1) = 
      \int\limits_{\substack{\text{all}\\\text{area}}}\varrho(x_2, y_2, z_2)
      \frac{x_1-x_2}{[(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_2)^2]^{\frac{3}{2}}}\dd{x_2}\dd{y_2}\dd{z_2}
  \end{equation}
\end{widetext}

\kant[1]
\end{document}

example output

I intentionally added kantlipsum, another dummy text package, which produces English text. So you can see, how the columns get broken.

There still seem to exist some issues, though, especially with footnotes and floats, coming from the underlying package cuted. Its documentation says, for footnotes you should use \footnotemark plus \footnotetext, but in tests I was not successfull – the notes were printed much to low inside or on top of the right column below the equation depending on the actual text length, cf. code below (I added only modified parts). With \leavevmode\begin{widetext} the output is not perfect, but much better.
Also see on TeX.SE Problems using widetext.sty (do not overlook comments to answers).

\chapter{One}
Text\footnotemark{}
\lipsum[1]
Text\footnotemark
\addtocounter{footnote}{-1}
\footnotetext{Note \thefootnote}
\stepcounter{footnote}
\footnotetext{Note \thefootnote}

\begin{widetext}
...
\end{widetext}

Text\footnote{Note \thefootnote}
\kant[1]
Text\footnote{Note \thefootnote}
3
  • Question. What does widetext package apart from paint those rules/lines? Why is it better than just use strip environment from cuted package?
    – Manuel
    Jan 24, 2014 at 14:58
  • I am not the right one to be asked. This looks to me, that you could ask this as an own question. But take a look int this package, it does a bit more …
    – Speravir
    Jan 24, 2014 at 17:23
  • 1

You must log in to answer this question.

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