当我打印huxtable时,当使用**编织成pdf下划线而不是斜体格式时,将文本(块之间)排列成斜体。
以下是我的例子:
标题:"“
作者:“jd”
日期:“r Sys.Date()”
产出:
pdf_document:
fig_caption: yestoc: yestoc_depth: 3number_sections: truelatex_engine: xelatexhtml_document:
code_folding: showdf_print: pagedtheme: yetihighlight: tangotoc: yestoc_float: collapsed: false smooth_scroll: falsenumber_sections: true字体大小:10
这个*使文本斜体*。
library(huxtable)
library(tidyverse)
data(iris)
dt_hux <- iris[1:5,1:5] %>% as_hux() %>%
set_font_size(8) %>% set_font("Arial") %>%
set_bold(1, everywhere) %>%
set_top_border(1, everywhere) %>%
set_bottom_border(c(1, 6), everywhere)```
Until this point using * * will give italic format in knit pdf (if next chunck is not run).
But after the next chunk is run * * will underline text (in whole Rmarkdown). Commenting out **dt_hux** returns formatting to italic. Also knit to html will print italic formatting even with dt_hux.
```{r table}选项(huxtable.latex_use_fontspec= TRUE)
选项(huxtable.print=print_latex)
dt_hux`
有解决这个问题的办法吗?我需要用pdf打印huxtable吗?
发布于 2021-01-12 13:28:47
从TeXnical的角度来看,问题是ulem包是在没有normalem选项的情况下加载的。有几个解决办法:
classoption: normalem (基于Knitr hook to add code before \documentclass line in tex file to avoid options clash with xcolor)。警告:这将将选项传递给所有包,如果其他包也使用相同的选项名(我不知道有任何其他包使用此选项,但只是以防万一.),则可能不希望使用该选项。\normalem添加为header-include或在文档的开头添加
发布于 2021-02-24 12:19:24
这个问题是在huxtable 5.2.0中解决的,所以您只需要更新您的包。
https://stackoverflow.com/questions/65680594
复制相似问题