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 have some lengthy math description in 2 column paper to override the next column.

enter image description here

I think I need to make the math description in one column. How can I do that in 2 column mode?

The code (only the math part) is something like this

\documentclass[twocolumn]{article}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{amsmath}

\newcommand{\caller}[1]{\textsc{Caller}(#1)}
\newcommand{\type}[2]{\textsc{Type}(#1, #2)}
\newcommand{\getset}[2]{\ensuremath{\{\, #1 \mid #2 \, \}}}

\newcommand{\phantomstring}{\hphantom{\caller{\textbf{C}.m}}}

\begin{document}1

\begin{align*}
\rlap{\caller{\textbf{C}.$f$}}\phantomstring
  &= \getset{m'}{\forall m' \to \text{invoke static field\ }  \textbf{C}.f}\\
\rlap{\type{$i$}{$m$}}\phantomstring
  &= \text{returns the instantiation type of class that contains method $m$, which is invoked by method $i$}\\
\rlap{\type{$i$}{$f$}}\phantomstring
  &= \text{returns the instantiation type of class that contains field $f$, which is accessed by method $i$}
\end{align*}

\end{document} 
share|improve this question
1  
What are you using to generate the "math description"? A tabular or perhaps an array? Are you limited in your package use? If not, I'm sure the tabularx package would work fine here. –  Werner Nov 16 '12 at 3:34
1  
It seems like your "math description" group needs more text width than is available in a single column. Have you tried placing the group inside a table* (note the asterisk) environment? –  Mico Nov 16 '12 at 3:50
add comment

3 Answers 3

up vote 3 down vote accepted

I just wrap the align* environment with figure*, and it seems to work fine.

\begin{figure*}
\begin{align*}

  ...

\rlap{\type{$i$}{$f$}}\phantomstring
  &= \text{returns the instantiation type of class that contains field $f$, which is accessed by method $i$}
\end{align*}
\caption{Definition}\label{definition}
\end{figure*}

enter image description here

share|improve this answer
    
This is a good suggestion. However nonstandard it might be to put pure maths into a float, it is sometimes a better variant than trying to fit it into two-column format! –  tohecz Nov 16 '12 at 7:44
add comment

If putting it in a float makes sense here that's a good option, but arguably that isn't an aligned set of equations, but a table of definitions and could be set as such, which makes it a lot easier to have automating line breaking.

enter image description here

\documentclass[twocolumn]{article}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{amsmath}

\newcommand{\caller}[1]{\textsc{Caller}(#1)}
\newcommand{\type}[2]{\textsc{Type}(#1, #2)}
\newcommand{\getset}[2]{\ensuremath{\{\, #1 \mid #2 \, \}}}

\newcommand{\phantomstring}{\hphantom{\caller{\textbf{C}.m}}}

\begin{document}

\noindent
\begin{tabularx}{\linewidth}{>$l<$@{ = }>{\raggedright\arraybackslash}X}
\caller{\textbf{C}.$f$}
  &\getset{m'}{\forall m' \to \text{invoke static field\ }  \textbf{C}.f}\\
\type{$i$}{$m$}
  &returns the instantiation type of class that contains method $m$, which is invoked by method $i$\\
\type{$i$}{$f$}
  & returns the instantiation type of class that contains field $f$, which is accessed by method $i$
\end{tabularx}

\newpage

\def\a{One two three four. }\def\b{\a\a\a\a\par}\b\b\b\b\b\b

\end{document} 
share|improve this answer
add comment

You can try to load cuted packaged and wrap lengthy math in \begin{strip}..\end{strip} environment.

share|improve this answer
add comment

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.