数式環境でインライン数式形式を使用する方法

数式環境でインライン数式形式を使用する方法

非常に長い方程式があり、方程式番号を取得するには方程式環境を使用する必要があります。ただし、式ではインライン方程式形式を使用することをお勧めします。インライン方程式形式は自動的に改行されるため、手動で改行するよりもコンパクトになります。

テストテキストは次のとおりです:

\documentclass[twocolumn]{article}

\begin{document}

Equation \ref{eq1}.

$f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c$

\begin{equation}\label{eq1}
f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c
\end{equation}

\end{document}

以下のものを希望します:

ここに画像の説明を入力してください

更新: ラベルと ref コマンドを使用して式を引用できるようにしたいです。これが方程式環境が必要な理由でもあります。

答え1

\documentclass[twocolumn]{article}

\begin{document}



\begin{center}
\refstepcounter{equation}$f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c$\\
\hspace*{\fill}(\theequation)
\end{center}


\end{document}

答え2

環境を定義できますlongequation:

\documentclass[twocolumn]{article}

\usepackage{lipsum} % just for the example

\newenvironment{longequation}
 {\begin{equation}\begin{minipage}{.9\columnwidth}$}
 {$\end{minipage}\end{equation}}

\begin{document}

Equation \ref{eq1}.

\lipsum*[2]
\begin{longequation}\label{eq1}
f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+
c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+
f+a+b+c+d+e+f+a+b+c
\end{longequation}
\lipsum[3]

\end{document}

ここに画像の説明を入力してください

関連情報