kableExtra 中的度数符号

Degree symbol in kableExtra

我正在尝试将度数 (º) 的符号放在 table 中,用 kableExtra 制作。我得到的符号是图中的一个赞:

我只需要符号 (º),下面没有一行,如下所示:

我试过 $^\circ$\degree,我的执行都停止了。

这是我的选择:

---
output: 
 pdf_document:
  number_sections: true
  latex_engine: xelatex
 template: NULL
 word_document: default
geometry: left=2cm,right= 2 cm,top=2 cm, bottom=2 cm
papersize: a4
header-includes: 
 - \usepackage{amsmath} 
 - \usepackage{booktabs}
 - \usepackage{pdflscape}
 - \usepackage[justification=justified,labelfont=bf,singlelinecheck=false, font = small]{caption}
 - \usepackage{flafter}
 - \usepackage{float}
 - \usepackage{gensymb}
bibliography: library_tesis.bib
csl: apa7.csl
fontsize: 12 pt
indent: true
linestretch: 1.5

这里是 table

的代码
atm <- read_csv("tablas/atmosfericos.csv") %>%
 select(-Cueva)

kbl(atm, "latex",
 caption = "Atmopheric conditions.\label{tbl:atm}",
 col.names = c("Punto",
  "CO\textsubscript{2} (ppm)",
  "T (ºC)",
  "RH"),
 align = c("l", "c", "c","c"),
 label = "atm",
 escape = FALSE, 
 booktabs = TRUE, 
 linesep ="") %>%
 row_spec(0, bold = T) %>%
 kable_paper("hover", full_width = F) %>%
 pack_rows("Cueva de la Iglesia", 1, 6) %>%
 pack_rows("Sistema de Tubo de Lava de Chimalacatepec", 7,12) %>%
 kable_styling(latex_options = "hold_position")
 

非常感谢您的帮助。

命令是\textdegree{}.

示例:

kbl(data, 
"latex",
 col.names = c("Primer",
  "Sequences 5'-3'",
  "Amplicon (pb)",
  "T\textsubscript{M}(\textdegree{}C)*",
  "Referencia"),
 align = c("l", "l", "c","c", "c"),
 label = "primers",
 escape= FALSE, 
 booktabs= TRUE, 
 linesep="")

结果: