表格环境中的换行方程式

表格环境中的换行方程式

以下代码产生错误! Missing \endgroup <inserted text>.是什么导致了错误? 似乎breqn在表格环境中不起作用。

\documentclass{article}
\usepackage{breqn}
\begin{document}
\begin{tabular}{l}
\begin{dmath*}
  f (1.02) + f (1.06) + f (1.1)  + f (1.14) + f (1.18) + f (1.22) + 
  f (1.26) + f (1.3)  + f (1.34) + f (1.38) + f (1.42) + f (1)
\end{dmath*}
\end{tabular}
\end{document}

答案1

dmath是垂直显示结构,因此无法在l类似 的列中工作\mbox。使用p{...}列使其处于垂直模式,并具有用于换行的目标宽度。

答案2

我看不出有什么理由tabular

\documentclass{article}
\usepackage{breqn}

\begin{document}

You can see an important quantity in table~\ref{q-important}.

\begin{table}[htp]

\begin{dmath*}
  f (1.02) + f (1.06) + f (1.1)  + f (1.14) + f (1.18) + f (1.22) + 
  f (1.26) + f (1.3)  + f (1.34) + f (1.38) + f (1.42) + f (1)
\end{dmath*}

\caption{This is an important quantity\label{q-important}}

\end{table}

\end{document}

在此处输入图片描述

答案3

供参考。输出被放在一个表中,供参考

您可以删除星号并使用编号公式来引用。如果您有特定的标题用例,您可以考虑创建并格式化带有新标签的自定义浮点数。也可以格式化参考文献。

以下是带有任意新浮点数的示例代码annotation

\documentclass{article}
\usepackage{breqn}
\usepackage{newfloat,caption,cleveref}

\DeclareFloatingEnvironment[
  fileext=note,
  listname={List of annotations},
  name=Annotation,
  placement=htp,
]{annotation}
\captionsetup[annotation]{position=bottom,skip=3pt}   % labelfont=bf
\crefformat{annotation}{Annotation~(#2#1#3)}

\usepackage{kantlipsum}   % for dummy texts


\begin{document}
% \listofannotations\vspace{\baselineskip}   % Creates a list of annotations

\kant[1][1]

\begin{annotation}
  \begin{dmath*}
    f (1.02) + f (1.06) + f (1.1)  + f (1.14) + f (1.18) + f (1.22) + 
    f (1.26) + f (1.3)  + f (1.34) + f (1.38) + f (1.42) + f (1)
  \end{dmath*}
  \caption{Sum of functions}\label{note:1}
\end{annotation}

\kant[1][2]

A regular reference: \eqref{note:1}, and reference with a label via \verb!cleveref!: \Cref{note:1}.
\end{document}

在此处输入图片描述

相关内容