仅识别标签的第一个字符。其余部分显示为文本

仅识别标签的第一个字符。其余部分显示为文本

在特定文档中,align标签仅被识别为指定标签的第一个字符,其余部分则被打印为文本。

以下是 MWE:

\documentclass{article}
\usepackage{amsmath} % provides the align environment
\usepackage{autonum} % Only number referenced equations
\usepackage[backend=biber,url=false,doi=false,style=authoryear]{biblatex}
\usepackage{booktabs} % nicer tables, provides toprule midrule etc
\usepackage[noabbrev]{cleveref} % provides the cref command
\usepackage{dcolumn} % for stargazer R tables
\usepackage{graphicx} % for pdf images
\usepackage[utf8]{inputenc} % Allow non-ascii characters in .bib file
\usepackage[autolanguage]{numprint} % For rounding numbers in tabulars. Provides num command
\usepackage{rotating} % provides sideways table environment
\usepackage[group-separator={,},
    group-minimum-digits = 4]  % default is 5
    {siunitx} % Adds the S column type. Provides num command
\usepackage{subfig} % For side-by-side tables

\begin{document}

%--------------------------------------------------------------
\section{Introduction}
%--------------------------------------------------------------
Here's an equation:

\begin{align}\label{eqn:first}
    f^{(1)}_{ij} = \frac{f^{(0)}_{ij} O_i}{\sum\limits_k f_{ik}}
\end{align}

In \cref{eqn:first} lots of stuff happens. Here's another:
\begin{align}\label{eqn:second}
    f^{(2)}_{ij}
    = \frac{f^{(1)}_{ij} D_j}{\sum\limits_k f^{(1)}_{kj}}
    = \frac{O_i D_j}{\sum\limits_k O_k}
\end{align}

\end{document}

其结果是: 对齐标签被误解

该标签仅被读取为字符e,如文件摘录所示.aux

\newlabel{e}{{1}{1}}
\newlabel{e@cref}{{[equation][1][]1}{1}}

它肯定与序言有关(这就是我将其包含在 MWE 中的原因)但是什么呢?

答案1

显然autonum必须包括在内,cleveref并且在我的印象中,必须编译该文档三次才能使所有参考资料正常工作。

手册上明确写着

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath} % provides the align environment
%
\usepackage[backend=biber,url=false,doi=false,style=authoryear]{biblatex}
\usepackage{booktabs} % nicer tables, provides toprule midrule etc
\usepackage{dcolumn} % for stargazer R tables
\usepackage{graphicx} % for pdf images
\usepackage[utf8]{inputenc} % Allow non-ascii characters in .bib file
\usepackage[autolanguage]{numprint} % For rounding numbers in tabulars. Provides num command
\usepackage{rotating} % provides sideways table environment
\usepackage[group-separator={,},
    group-minimum-digits = 4]  % default is 5
    {siunitx} % Adds the S column type. Provides num command
\usepackage{subfig} % For side-by-side tables

\usepackage[noabbrev]{cleveref} % provides the cref command
\usepackage{autonum} % Only number referenced equations
\begin{document}

%--------------------------------------------------------------
\section{Introduction}
%--------------------------------------------------------------
Here's an equation:

\begin{align}  
    f^{(1)}_{ij} &= \frac{f^{(0)}_{ij} O_i}{\sum\limits_k f_{ik}} \label{eqn:first}
\end{align}

In \cref{eqn:first} lots of stuff happens. Here's another:
\begin{align}
    f^{(2)}_{ij}
    &= \frac{f^{(1)}_{ij} D_j}{\sum\limits_k f^{(1)}_{kj}} \label{eqn:second} \\
    &= \frac{O_i D_j}{\sum\limits_k O_k}
\end{align}

\end{document}

在此处输入图片描述

相关内容