【发布时间】:2020-07-17 23:00:56
【问题描述】:
我在 RMarkdown 中使用 LaTeX 中的 fancyhdr 包创建了一个 PDF。我正在尝试找到一个解决方案,在该解决方案中,我可以插入一条水平线作为页脚(就在页码上方),以及类似于我所附图像的右上角的页码。另外,有没有一种方法可以将所有超链接(例如目录)的颜色从默认的黑色更改为与图像相同的颜色?
我的 YAML 如下
---
title: "Template for a Dynamic Report for Work"
Uni_Logo: Tex/logo.jpg
Author1: "Tangeni Shatiwa"
# ----- Manage headers and footers:
#BottomLFooter: $Title$
#BottomCFooter:
#TopLHeader: \leftmark # Adds section name at topleft. Remove comment to add it.
BottomRFooter: "\\footnotesize Page \\thepage" # Add a '#' before this line to remove footer.
addtoprule: TRUE
addfootrule: TRUE # Use if footers added. Add '#' to remove line.
toc: TRUE
numbersections: TRUE # Should sections (and thus figures and tables) be numbered?
fontsize: 11pt # Set fontsize
linestretch: 1.2 # Set distance between lines.
link-citations: TRUE # This creates dynamic links to the papers in reference list.
linkcolor: blue
output:
pdf_document:
includes:
in_header: "header.tex"
---
header.tex文件内容如下
\usepackage{fancyhdr}
\usepackage{titling}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\setlength{\headheight}{50pt}
\lhead{\includegraphics[width = .2\textwidth]{logo.jpg}}
\fancyfoot[R]{\thepage}
\renewcommand{\footrulewidth}{0pt}
\pretitle{%
\begin{center}
\LARGE
\includegraphics[width=4cm,height=6cm]{logo.jpg}\\[\bigskipamount]
}
\posttitle{\end{center}}
【问题讨论】:
标签: r r-markdown