r 文章包在最近更新后停止编译

2023-11-29

当我今年夏天提交一篇文章时,以下代码运行良好,但在最近的更新后不再运行。 (R 版本 4.2.2(2022-10-31,R Studio 2022.12.0 Build 353,文章 0.24)。

---
title: "test"
author:
  - name: JB MD PhD
    email: [email protected]
    affiliation: McGill University Health Center
    correspondingauthor: true
    footnote: 1
  - name: LN MSc
    email: 
    affiliation: McGill University Health Center
address:
  - code: McGill University Health Center
    address: McGill University Health Center, Centre for Health Outcomes Research (CORE), 5252 Boul. de Maisonneuve West Room 2B.37, Montreal,  QC, H4A 3S5
footnote:
  - code: 1
    text: "JMB is a research scholar supported by Les Fonds de Recherche Québec Santé"
abstract: |
  Background:  Atrial fibrillation is one of the most common arrhythmias but the optimal drug choice for a rate control strategy remains uncertain.   
      Methods:  This was a retrospective cohort claims database study. Patients with a new diagnosis of atrial fibrillation and a discharge date between 2011 and 2015 were included. The exposure variables of interest were a discharge prescription for beta blockers with and without digoxin. The average treatment effect for the composite of total mortality or a repeat cardiovascular (CV) hospitalization was the primary outcome. Sensitivity analyses with other treatment effect metrics were performed. Baseline covariate imbalance between the groups were adjusted using propensity score methods with inverse probability weighting.      
keywords: 
  - Atrial fibrillation
  - Amiodarone
  - Dronedarone
journal: "CJC Open submission"
date: "Original date 2022-12-19,  Updated - `r Sys.Date()`"
bibliography: references.bib
linenumbers: false
numbersections: true
#classoption: preprint, 3p, authoryear
csl: vancouver-brackets.csl
# csl: https://www.zotero.org/styles/elsevier-harvard
# geometry: "left=3cm,right=3cm,top=2cm,bottom=2cm"
geometry: margin = 2cm
header-includes:
   - \usepackage{setspace}
   - \doublespacing
output: 
  rticles::elsevier_article:
    keep_tex: true
    citation_package: natbib
    latex_engine: xelatex
editor_options: 
  markdown: 
    wrap: 72
---

这给出了以下错误

processing file: Untitled.Rmd
  |......................................................................| 100%
   inline R code fragments


/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc +RTS -K512m -RTS Untitled.knit.md --to latex --from markdown+tex_math_single_backslash-autolink_bare_uris --output Untitled.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --embed-resources --standalone --template /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rticles/rmarkdown/templates/elsevier/resources/template.tex --highlight-style tango --pdf-engine xelatex --natbib --include-in-header /var/folders/vz/g1j5pr8n7tg786zcwmv2dx8c0000gp/T//RtmpifKb24/rmarkdown-str8d9913e20bf4.html 
output file: Untitled.knit.md

! LaTeX Error: Command \gather already defined.
               Or name \end... illegal, see p.192 of the manual.

Error: LaTeX failed to compile Untitled.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Untitled.log for more info.
Execution halted

我查看了日志文件,但由于我对 LaTex 的理解水平较低,我看不出问题是什么

This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2022.12.21)  21 DEC 2022 22:48
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**Untitled.tex
(./Untitled.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2022-12-17> (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/elsarticle/elsarticle.cls
Document Class: elsarticle 2020/11/20, 3.3: Elsevier Ltd
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2022-12-17 L3 programming layer (loader) 
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
File: l3backend-xetex.def 2022-10-26 L3 backend support: XeTeX
\g__graphics_track_int=\count181
\l__pdf_internal_box=\box51
\g__pdf_backend_object_int=\count182
\g__pdf_backend_annotation_int=\count183
\g__pdf_backend_link_int=\count184
)) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
Package: xparse 2022-12-17 L3 Experimental document command parser
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count185
)
\@bls=\dimen140
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2022/07/02 v1.4n Standard LaTeX file (size option)
)
\c@part=\count186
\c@section=\count187
\c@subsection=\count188
\c@subsubsection=\count189
\c@paragraph=\count190
\c@subparagraph=\count191
\c@figure=\count192
\c@table=\count193
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\bibindent=\dimen141
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR)
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2022/03/10 v1.4e Standard LaTeX Graphics (DPC,SPQR)
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2021/08/11 v1.11 sin cos tan (DPC)
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: xetex.def on input line 107.
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/graphics-def/xetex.def
File: xetex.def 2022/09/22 v5.0n Graphics/color driver for xetex
))
\Gin@req@height=\dimen142
\Gin@req@width=\dimen143
)
\c@tnote=\count194
\c@fnote=\count195
\c@cnote=\count196
\c@ead=\count197
\c@author=\count198
\@eadauthor=\toks17
\c@affn=\count199
\absbox=\box52
\elsarticlehighlightsbox=\box53
\elsarticlegrabsbox=\box54
\keybox=\box55
\Columnwidth=\dimen144
\space@left=\dimen145
\els@boxa=\box56
\els@boxb=\box57
\leftMargin=\dimen146
\@enLab=\toks18
\@sep=\skip50
\@@sep=\skip51
(./Untitled.spl) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip52
\bibsep=\skip53
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count266
)
\splwrite=\write3
\openout3 = `Untitled.spl'.

\appnamewidth=\dimen147
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/lineno/lineno.sty
Package: lineno 2022/07/30 line numbers on paragraphs v5.0
Invalid UTF-8 byte or sequence at line 297 replaced by U+FFFD.
\linenopenalty=\count267
\output=\toks19
\linenoprevgraf=\count268
\linenumbersep=\dimen148
\linenumberwidth=\dimen149
\c@linenumber=\count269
\c@pagewiselinenumber=\count270
\c@LN@truepage=\count271
\c@internallinenumber=\count272
\c@internallinenumbers=\count273
\quotelinenumbersep=\dimen150
\bframerule=\dimen151
\bframesep=\dimen152
\bframebox=\box58
\linenoamsmath@ams@eqpen=\count274
LaTeX Info: Redefining \\ on input line 3114.
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
LaTeX Font Info:    Trying to load font information for T1+lmr on input line 112.
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/lm/t1lmr.fd
File: t1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/lm/lmodern.sty
Package: lmodern 2015/05/01 v1.6.1 Latin Modern Fonts
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info:    Overwriting symbol font `letters' in version `normal'
(Font)                  OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `normal'
(Font)                  OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `normal'
(Font)                  OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info:    Overwriting symbol font `letters' in version `bold'
(Font)                  OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `bold'
(Font)                  OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `bold'
(Font)                  OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `bold'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\@emptytoks=\toks20
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info:    Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
)) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2022/04/08 v2.17n AMS math features
\@mathmargin=\skip54
For additional information on amsmath, use the `?' option.
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2021/08/26 v2.01 AMS text
(/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks21
\ex@=\dimen153
)) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen154
) (/Users/jay/Library/TinyTeX/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2022/04/08 v2.04 operator names
)
\inf@bad=\count275
LaTeX Info: Redefining \frac on input line 234.
\uproot@=\count276
\leftroot@=\count277
LaTeX Info: Redefining \overline on input line 399.
LaTeX Info: Redefining \colon on input line 410.
\classnum@=\count278
\DOTSCASE@=\count279
LaTeX Info: Redefining \ldots on input line 496.
LaTeX Info: Redefining \dots on input line 499.
LaTeX Info: Redefining \cdots on input line 620.
\Mathstrutbox@=\box59
\strutbox@=\box60
LaTeX Info: Redefining \big on input line 722.
LaTeX Info: Redefining \Big on input line 723.
LaTeX Info: Redefining \bigg on input line 724.
LaTeX Info: Redefining \Bigg on input line 725.
\big@size=\dimen155
LaTeX Font Info:    Redeclaring font encoding OML on input line 743.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 744.
\macc@depth=\count280
LaTeX Info: Redefining \bmod on input line 905.
LaTeX Info: Redefining \pmod on input line 910.
LaTeX Info: Redefining \smash on input line 940.
LaTeX Info: Redefining \relbar on input line 970.
LaTeX Info: Redefining \Relbar on input line 971.
\c@MaxMatrixCols=\count281
\dotsspace@=\muskip17
\c@parentequation=\count282
\dspbrk@lvl=\count283
\tag@help=\toks22
\row@=\count284
\column@=\count285
\maxfields@=\count286
\andhelp@=\toks23
\eqnshift@=\dimen156
\alignsep@=\dimen157
\tagshift@=\dimen158
\tagwidth@=\dimen159
\totwidth@=\dimen160
\lineht@=\dimen161
\@envbody=\toks24

! LaTeX Error: Command \gather already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.1560 }
         
Here is how much of TeX's memory you used:
 3712 strings out of 478757
 54106 string characters out of 5849423
 1841979 words of memory out of 5000000
 23743 multiletter control sequences out of 15000+600000
 515285 words of font info for 34 fonts, out of 8000000 for 9000
 14 hyphenation exceptions out of 8191
 70i,0n,76p,233b,93s stack positions out of 10000i,1000n,20000p,200000b,200000s

No pages of output.

问题是,对于当前版本的 lineno 包,它需要在 amsmath 包之后加载(请参阅https://github.com/latex-lineno/lineno/issues/5详情)

已经对文章进行了修复,您可以使用以下命令安装开发版本

remotes::install_github("rstudio/rticles")

(see https://github.com/rstudio/articles/issues/513详情)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

r 文章包在最近更新后停止编译 的相关文章

  • 如何在R中绘制仪表图表?

    如何在 R 中绘制以下图 Red 30 Yellow 40 Green 30 Needle at 52 所以这里有一个完整的ggplot解决方案 注意 从原始帖子中编辑 在仪表中断处添加数字指示器和标签 这似乎是OP在评论中所要求的 如果不
  • 如何使用 RODBC 将数据帧保存到数据库生成的主键表

    我想使用 R 脚本将数据框输入到数据库中的现有表中 并且希望数据库中的表具有顺序主键 我的问题是 RODBC 似乎不允许主键约束 这是创建我想要的表的 SQL CREATE TABLE dbo results ID INT IDENTITY
  • 使用 igraph 将边缘属性显示为标签

    我在 R 中使用 igraph 进行网络分析 我想在图中的每条线上显示边缘属性 下面是一个例子 df lt data frame a c 0 1 2 3 4 b c 3 4 5 6 7 nod lt data frame node c 0
  • 使用 RMySQL 会干扰 RPostgreSQL

    我有一个 R 脚本 我想从 MySQL 数据库中提取一些数据 然后从 PostgreSQL 数据库中提取一些数据 但是 从 RMySQL 加载 MySQL 驱动程序会阻止我从以下位置加载 PostgreSQL 驱动程序 PostgreSQL
  • 列槽不足

    当尝试为 data table 中的每个变量 108 个变量 创建 12 个滞后时 我收到一条错误 指出列槽不足 此操作应创建大约 1200 个变量或列 Data A as data table Datos A Varnames names
  • 了解用于处理色边距的scale_fill_continuous_divergingx参数输入

    这个问题是我上一个问题的延续here https stackoverflow com questions 58718527 setting midpoint for continuous diverging color scale on a
  • 如何从多边形数据中提取栅格值然后加入到空间数据框中?

    我想将多边形数据和栅格数据合并到一个数据框中 以便随后在 R 中使用 randomForests 包 这涉及首先提取每个多边形的平均栅格值 到目前为止 我有以下内容 load libraries library raster library
  • Plotly 绘图不会在 RMarkdown 文档的 for 循环内渲染

    我正在尝试动态构建一个需要运行循环的报告 并为每次迭代打印一些消息 表格和绘图 我可以让一切正常运转except为了情节 示例 rmd r echo FALSE results asis fig keep all message FALSE
  • R:使用带有 .Call 和 C/C++ 包装器的 Fortran 子例程而不是 .Fortran 的优点?

    我有一个 R 包 它使用大量 Fortran 子例程来进行递归线性代数计算的嵌套循环 很大程度上依赖于 BLAS 和 LAPACK 例程 作为 Fortran 的接口 我使用 Fortran功能 我刚刚读过乔纳森卡拉汉的博客文章 http
  • 再现频率矩阵图

    我想在 R 中重新创建一个情节 情节如下 来源 Boring E G 1941 作为动态平衡的统计频率 心理学评论 48 4 279 这略高于我的工资等级 能力 因此在这里询问 无聊的状态 第一次 A 只能出现 从不 0 或 总是 1 在
  • grid.arrange 中的错误 -rangeGrob() 函数

    我有两个图 p1 和 p2 我试图使用 grid arrage 绘制它们 我的代码如下所示 grid arrange p1 p2 ncol 2 top textGrob Distribution across each day of the
  • 根据不平凡的标准有效合并两个数据帧

    正在接听这个问题 https stackoverflow com questions 18821862 data selection error 18823432 18823432昨晚 我花了一个小时试图找到一个没有增长的解决方案data
  • 在单个显示器中绘制多个 jpeg 图像

    我需要在单个组合显示器 或画布 中绘制和显示多个 jpeg 图像 例如 假设我有图像 a b c d jpg 每个图像的大小不同 我想将它们绘制在 2x2 网格的一页上 能够为每个子图设置标题也很好 我一直在彻底寻找解决方案 但不知道如何去
  • 循环中的knitr模板和子文档

    圣诞节前我之前问过跨多个 knitr 文档的单一样式表 https stackoverflow com questions 20370584 single style sheet across multiple knitr document
  • 确定向量中是否存在元素的最有效方法

    我有几种算法取决于确定元素是否存在于向量中的效率 在我看来 这 in 这相当于is element 应该是最有效的 因为它只返回一个布尔值 在测试了几种方法之后 令我惊讶的是 这些方法是迄今为止效率最低的 以下是我的分析 随着向量大小的增加
  • 按具有作业的组划分的 R 分位数

    我有以下 df group rep seq 1 3 30 variable runif 90 5 0 7 5 df data frame group variable 我需要 i 按组定义分位数 ii 将每个人分配到相对于其组的分位数 因此
  • 优化 R 中的嵌套 for 循环

    我尝试加速下面的代码 但没有成功 我读到Rfast https cran r project org web packages Rfast Rfast pdf包 但我也未能实现该包 有没有办法优化R中的以下代码 RI lt function
  • 使用 stargazer 分析包含时间序列的数据帧

    我有一个面板数据集共 10 个观测值和 3 个变量 观测值 30 的数量 10 行 国家 地区 2 列 迁移参数 相应年份的 1 列 可以这么说 我的数据框由 3 个年度数据框组成 我该如何申请观星者考虑到它是一个面板数据集 所以最大 N
  • 无法在 Document-Term-Matrix 中看到 `RTextTools::toLower()` 文本的结果

    我尝试创建一个矩阵 为此我想降低文本 为此 我使用此 R 指令 matrix create matrix tweets 1 toLower TRUE language english removeStopwords FALSE remove
  • 将 read.csv 与符号链接文件一起使用

    我正在尝试做什么 我的源文件非常大 我想避免将其复制到其他文件夹中 我决定创建一个指向大文件的符号链接并想使用read csv读取文件 文件夹结构 项目1 数据 源文件 csv 项目2 数据 别名到源文件 csv 什么地方出了错 读取源文件

随机推荐