首页 > 解决方案 > 在 bookdown 的等式参考中,\tag 不能与 (\#eq:label) 一起使用

问题描述

问题

我正在使用 bookdown 写论文。我想给一个方程起一个特殊的名字(比如“R”),然后再参考它。但是,方程不能以html格式呈现。

\begin{equation}
    \tag{$\mathrm{R}$}
    V_1 \ge \hat{U}_1 \text{ with the equality if and only if }x =1
    (\#eq:R)    
\end{equation}

失败的尝试

我试图(i)\tag在方程式环境中的不同位置放置(ii)取消缩进。但都失败了。似乎我使用了两个标签命令,如下图所示:

gitbook 输出

备注:pdf 输出没有问题。

PDF输出

的信息bookdown

xfun::session_info('bookdown')

> R version 3.5.2 (2018-12-20)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 17134), RStudio 1.2.1335
> 
> Locale:
>   LC_COLLATE=Chinese (Simplified)_China.936 
>   LC_CTYPE=Chinese (Simplified)_China.936   
>   LC_MONETARY=Chinese (Simplified)_China.936
>   LC_NUMERIC=C                              
>   LC_TIME=Chinese (Simplified)_China.936    
> 
> Package version:
>   base64enc_0.1.3 bookdown_0.9    digest_0.6.18   evaluate_0.13  
>   glue_1.3.1      graphics_3.5.2  grDevices_3.5.2 highr_0.8      
>   htmltools_0.3.6 jsonlite_1.6    knitr_1.22      magrittr_1.5   
>   markdown_0.9    methods_3.5.2   mime_0.6        Rcpp_1.0.1     
>   rmarkdown_1.12  stats_3.5.2     stringi_1.4.3   stringr_1.4.0  
>   tinytex_0.12    tools_3.5.2     utils_3.5.2     xfun_0.6       
>   yaml_2.2.0 

标签: rr-markdownbookdown

解决方案


推荐阅读