-
-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use bicaption instead of caption? #1554
Comments
Thank you, I have solve this problem, in index.Rmd add this line ```{r setup, include=FALSE} library(knitr) knit_hooks$set(plot = function(x, options) { if(!is.null(options$bicap)){ paste("\\begin{figure}[!htp]", hook_plot_tex(x, options), "\\bicaption{", options$bicap[1], "}{",options$bicap[2],"}", "\\end{figure}", sep = "") } else{ hook_plot_tex(x, options) } }) also, you must use \RequirePackage[list=off]{bicaption} then you can write in your Rmd file, like this. ```{r logo, out.width='32.8%', fig.show='hold', bicap=c('上海交通大学','SJTU'), fig.align="center"} knitr::include_graphics("figure/sjtulogo.pdf") ``` |
\RequirePackage[list=off]{bicaption}后面应该加上两行 |
这种设置下,导出pdf完全正常,gitbook图片会无法显示;改进方案:在 index.Rmd 中 library(knitr)后面加上if(is_latex_output())条件语句。 |
这个建议不错。不知道这个功能有没有加入bookdown。对于gitbook,可以自己根据需要写 |
gitbook怎么弄,请指教。 另外,你的这个方案仅仅适用于图片,表格不可以,表格我研究半天目前尚未找到对策 |
找到表格双标题解决方案了:
这样pdf中没问题,gitbook不识别latex,所以应该有更好的方案,
gitbook正常,pdf失败,应该是代码哪写的不对,你比较懂latex,帮我看看 |
关于bookdown图表中英文双标题,汇总了一下,详见R语言学习笔记--R bookdown图表设置中英文双标题,测试文档 |
非常感谢,看你提交到赵鹏的那个 rbookdownplus了。我也顺便更新到我的 deepin-bible模板。确实不错。 |
@xiaoyao177147 仔细阅读了一下,感觉直接加在 bookdown 里面更好,我们这种只是临时方案,不能通用。有条件的可以到 bookdown 提交。 |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
I had search the question, as https://stackoverflow.com/questions/44049547/is-rmarkdown-supporting-multiple-captions , no ans. I know latex, could be write as
and R code
will be,
has it any method to change
caption
tobicaption
? Thank you.The text was updated successfully, but these errors were encountered: