You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除R语言vitae包hyndman模板中的“Curriculum Vitae”

移除hyndman模板PDF中的“Curriculum Vitae”页眉
  • 方法一:在Rmarkdown的YAML元数据中添加LaTeX命令覆盖页眉设置
    在你的.Rmd文件开头的YAML区块(---之间)加入以下内容,即可清空页眉并移除页眉横线:

    header-includes:
      - \fancyhead{}
      - \renewcommand{\headrulewidth}{0pt}
    

    完整YAML示例:

    ---
    name: 你的姓名
    output:
      vitae::hyndman
    header-includes:
      - \fancyhead{}
      - \renewcommand{\headrulewidth}{0pt}
    ---
    
  • 方法二:自定义模板(进阶)
    若需要更灵活的控制,可先导出hyndman模板文件再修改:

    1. 在R中运行命令导出模板:
      vitae::use_template("hyndman", output = "custom_hyndman.Rmd")
      
    2. 打开生成的custom_hyndman.Rmd,直接添加上述header-includes命令,或修改模板内的LaTeX页眉相关代码。

原理说明:hyndman模板依赖vitae包底层的LaTeX设置,“Curriculum Vitae”是通过fancyhdr宏包的命令动态设置的页眉内容,并非以纯文本形式出现在.sty或可见的Rmd代码中,所以直接搜索字符串无法定位。\fancyhead{}会清空所有页眉内容,\headrulewidth{0pt}则移除页眉下方的横线。

内容的提问来源于stack exchange,提问作者umair durrani

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 05:34:55