首页 > 解决方案 > 使用 Bookdown 在 Gitbook 中文本消失

问题描述

几个月前我正在研究 R 中的gitbook使用。bookdown今天,我又恢复了工作,但是当我渲染这本书时,输出的字体发生了巨大的变化。它消失了!我不记得对本书的 TAML 进行了任何更改。这就是它现在的样子。在 WELCOME 这个词之后,文本变得越来越轻,直到它从字面上消失。它有一种消失的效果,我不知道我是怎么得到的。

在此处输入图像描述

感谢您的帮助。

最好的,

这是我的_output.yml

bookdown::gitbook:
  config:
    toc:
      collapse: section
      scroll_highlight: yes
      before: |
        <li><a href="./">PovcalNet Internal Guidelines</a></li>
      after: |
        <li><a href="https://github.com/xxxxx/Povcalnet_internal_guidelines" target="blank">Published with bookdown</a></li>
    download: ["pdf", "epub"]
    toolbar:
      position: fixed
    edit : null
    search: yes
    fontsettings:
      theme: white
      family: sans
      size: 2
    sharing:
      facebook: no
      github: no
      twitter: no
      linkedin: no
      weibo: no
      instapaper: no
      vk: no
    info: yes

bookdown::pdf_book:
  includes:
    in_header: preamble.tex
  latex_engine: xelatex
  citation_package: natbib
  keep_tex: yes
bookdown::epub_book:
  stylesheet: style.css

这是我的_bookdown.yml

book_filename: "Povcalnet_internal_guidelines"
repo: https://github.com/xxxxxx/Povcalnet_internal_guidelines/
output_dir: "docs"
delete_merged_file: true
language:
  label:
    fig: "Figure "
    tab: "Table "
  ui:
    edit: "Edit"
    chapter_name: "Chapter "

rmd_files: [
  "index.Rmd",
  "intro.Rmd",

  "Folder_structure.Rmd",
  "Collaboration_in_Git.Rmd",
  "DM_Group_data.Rmd",

  "Handover.Rmd",
  "references.Rmd",
]

before_chapter_script: "_common.R"

而且,我正在使用以下说明渲染这本书,

bookdown::render_book("index.Rmd", "bookdown::gitbook")

标签: r-markdownbookdowngitbook

解决方案


我发现了问题。基本上,在我的一个 .Rmd 文件中,我使用DiagrammeR包创建了一个图表。当我的一位同事删除图表时,问题消失了,但我们没有图表。但是,我创建了一个单独的 .mmd(美人鱼)文件并更新了包glueDiagrammeR. 所有这些都解决了这个问题。

谢谢。


推荐阅读