Unexpected behaviours when making tables for copernicus articles
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu từ entry point của article template Copernicus và render example được cung cấp bằng bookdown::pdf_book, sau đó kiểm tra .tex được tạo quanh \toprule. Kiểm tra thiết lập package LaTeX của template và cách xử lý các tham chiếu bảng cũng như trích dẫn. Hoàn tất khi PDF biên dịch được với booktabs và cả tham chiếu bảng lẫn trích dẫn @Dirac1953888 đều được render chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I want to make a simple table (where booktabs=TRUE) in a copernicus article. When I knit the following copernicus article (using the template provided by the package) to pdf_book
---
title: Template for preparing your manuscript submission to Copernicus journals using RMarkdown
journal: "`r rticles::copernicus_journal_abbreviations(journal_name = 'communication')`"
author:
# authors can have multiple affiliations, which can also be used to mark deceased coauthors
- given_name: Daniel
surname: Nüst
affiliation: "1, *"
email: [email protected]
corresponding: true
- given_name: Josiah
surname: Carberry
affiliation: 2
email: [email protected]
- given_name: Markus
surname: Konkol
affiliation: "1, *"
- given_name: Nikolaus
surname: Copernicus
affiliation: "3, †"
# If you have more than one corresponding author, add them manually using the following structure (note the commas):
# Two authors: Daniel Nüst ([email protected]) and Josiah Carberry ([email protected])
# Three authors or more: Daniel Nüst ([email protected]), Josiah Carberry ([email protected]), and Markus Konkol ([email protected])
# If the following line is uncommented, the "corresponding: true" above are ignored
#correspongdingauthors: Daniel Nüst ([email protected]) and Josiah Carberry ([email protected])
# If authors contributed equally, please mark the respective author names with an asterisk '*' and add a further affiliation: 'These authors contributed equally to this work.'", see template.
affiliation:
- code: 1
address: Institute for Geoinformatics, University of Münster, 48149 Münster, Germany
- code: 2
address: Psychoceramics, Wesleyan University, Middletown, CT, United States
- code: 3
address: University of Ferrara, Ferrara, Italy
- code: "†"
address: deceased, 24 May 1543
- code: "*"
address: These authors contributed equally to this work.
abstract: |
The abstract goes here.
It can also be on _multiple lines_.
bibliography: sample.bib
running:
title: R Markdown Template for Copernicus
author: Nüst et al.
competinginterests: |
The authors declare no competing interests.
# See https://publications.copernicus.org/for_authors/licence_and_copyright.html, normally used for transferring the copyright, if needed.
# Note: additional copyright statements for affiliated software or data need to be placed in the data availability section.
copyrightstatement: |
The author's copyright for this publication is transferred to institution/company.
### Note: unless stated otherwise, software and data affiliated with the manuscript are assumed to be published under the same licence as the article (currently Creative Commons 4.0)
availability:
# use this to add a statement when having only software code available
# use this to add a statement when having only data sets available
#code: |
#data: |
codedata: |
use this to add a statement when having data sets and software code available
sample: |
use this section when having geoscientific samples available
videosupplement: |
use this section when having video supplements available
authorcontribution: |
Daniel wrote the package. Josiah thought about poterry. Markus filled in for a second author.
disclaimer: |
We like Copernicus.
acknowledgements: |
Thanks to the rticles contributors!
appendix: |
\section{Figures and tables in appendices}
\subsection{Option 1}
If you sorted all figures and tables into the sections of the text, please also sort the appendix figures and appendix tables into the respective appendix sections.
They will be correctly named automatically.
\subsection{Option 2}
If you put all figures after the reference list, please insert appendix tables and figures after the normal tables and figures.
`\appendixfigures` needs to be added in front of appendix figures
`\appendixtables` needs to be added in front of appendix tables
Please add `\clearpage` between each table and/or figure. Further guidelines on figures and tables can be found below.
Regarding figures and tables in appendices, the following two options are possible depending on your general handling of figures and tables in the manuscript environment:
To rename them correctly to A1, A2, etc., please add the following commands in front of them:
output:
bookdown::pdf_book:
base_format: rticles::copernicus_article # for using bookdown features like \@ref()
rticles::copernicus_article:
highlight: NULL
keep_tex: true
---
\introduction[Introduction]
See Table \@ref(tab:t)
```{r t, echo=FALSE}
df = mtcars[1:3, 1:3]
df$ref = "@Dirac1953888"
knitr::kable(df, booktabs = TRUE)
```
I get the following error:
tlmgr update --all --self
tlmgr: package repository https://mirror.easyname.at/ctan/systems/texlive/tlnet (verified)
tlmgr install: package already present: hyperref
! Undefined control sequence.
l.142 \toprule
Error: LaTeX failed to compile t.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See t.log for more info.
Execution halted
Interestingly, when I do not use booktabs (which I need to):
```{r t, echo=FALSE}
df = mtcars[1:3, 1:3]
df$ref = "@Dirac1953888"
knitr::kable(df, booktabs = FALSE)
```
I get:
So, rendering of the document seems to work, but there are 2 problems:
- Table referencing does not work
- Citation (@Dirac1953888) which is included in the sample.bib file (provided by the copernicus template) does not properly show up in the "ref" column of the table
> xfun::session_info('rticles')
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin23.0.0 (64-bit)
Running under: macOS Sonoma 14.2.1, RStudio 2023.12.0.369
Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
Package version:
base64enc_0.1.3 bslib_0.6.1 cachem_1.0.8 cli_3.6.2 digest_0.6.34 ellipsis_0.3.2
evaluate_0.23 fastmap_1.1.1 fontawesome_0.5.2 fs_1.6.3 glue_1.7.0 graphics_4.3.2
grDevices_4.3.2 highr_0.10 htmltools_0.5.7 jquerylib_0.1.4 jsonlite_1.8.8 knitr_1.45.10
lifecycle_1.0.4 magrittr_2.0.3 memoise_2.0.1 methods_4.3.2 mime_0.12 R6_2.5.1
rappdirs_0.3.3 rlang_1.1.3 rmarkdown_2.25 rticles_0.26.1 sass_0.4.8 stats_4.3.2
stringi_1.8.3 stringr_1.5.1 tinytex_0.49 tools_4.3.2 utils_4.3.2 vctrs_0.6.5
xfun_0.41 yaml_2.3.8
By filing an issue to this repo, I promise that
- I have fully read the issue guide at https://yihui.name/issue/.
- I have provided the necessary information about my issue.
- If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
- If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included
xfun::session_info('rticles'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/rticles'). - If I have posted the same issue elsewhere, I have also mentioned it in this issue.
- I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
- Ngôn ngữ chính
- TeX
- Star
- 1.5k
- Fork
- 516
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rstudio/rticles
-
feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Update the AGU article format to the official 2019 templateCó thể đã có người làm @cderv đã nhận 38 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
feature help wanted :heart:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của rstudio/rticles
Issue tương tự
-
untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dotnet/install-scripts#746 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
fullsend-ai/agents#1786 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
plugin install: the confirmation hint names 'agmsg' even for an install with another --cmd nameĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
githubnext/gh-aw-workshop#5001 ·
Maintainer thường phản hồi trong vòng 1 ngày