我在两列的论文中写了一些冗长的数学描述来覆盖下一列。
我认为我需要将数学描述放在一列中。如何在 2 列模式下做到这一点?
代码(仅数学部分)如下
\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}
答案1
我只是用 figure* 包裹了 align* 环境,它似乎工作正常。
\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*}
答案2
如果在这里将其放在浮点数中是有意义的,那么这是一个不错的选择,但可以说这不是一组对齐的方程式,而是一个定义表,可以这样设置,这使得自动换行变得容易得多。
\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}
答案3
您可以尝试在环境中加载cuted
打包并包装冗长的数学运算。\begin{strip}..\end{strip}