【问题标题】:Changing font family for a paragraph in latex rmarkdown在 Latex rmarkdown 中更改段落的字体系列
【发布时间】:2021-08-20 16:33:21
【问题描述】:

有人知道如何在 rmarkdown 文档中间更改字体系列吗?

我目前正在使用以下代码,但它会将给定的文本重置为现代计算机,就像它永远找不到任何其他字体一样。请帮忙

---
title: ''
output:
  pdf_document:
    latex_engine: xelatex
    keep_tex: yes
geometry: left=0.35in,right=0.35in,top=0.3in,bottom=0.3in
header-includes:
- \usepackage{graphicx}
- \usepackage{fancyhdr}
- \usepackage{fontspec}
- \pagestyle{fancy}
- \renewcommand{\headrulewidth}{0.0pt}
fontsize: 9pt
---
\begingroup
\fontfamily{pag}\fontsize{18}{16}\selectfont
\textcolor{black}{tasks}
\endgroup

另外有谁知道我可以使用哪些字体?我找不到有效的列表。

【问题讨论】:

    标签: r latex r-markdown pdflatex xelatex


    【解决方案1】:

    您正在使用 xelatex,因此您可以使用您在操作系统上安装的任何字体

    ---
    title: ''
    output:
      pdf_document:
        latex_engine: xelatex
        keep_tex: yes
    geometry: left=0.35in,right=0.35in,top=0.3in,bottom=0.3in
    header-includes:
    - \usepackage{graphicx}
    - \usepackage{fancyhdr}
    - \usepackage{fontspec}
    - \pagestyle{fancy}
    - \renewcommand{\headrulewidth}{0.0pt}
    fontsize: 9pt
    ---
    Global
    
    \begingroup
    \setmainfont{Arial}
    \fontsize{18}{16}\selectfont
    \textcolor{black}{tasks}
    \endgroup
    
    Global
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-13
      • 1970-01-01
      • 2011-09-02
      • 1970-01-01
      • 2020-01-15
      • 2019-07-07
      • 2015-02-27
      • 1970-01-01
      相关资源
      最近更新 更多