表格作为RMD文档中所有页面的标题

问题描述 投票:0回答:1

想要自定义我的 RMD 模板的标题页,以便在每个页面上都有一个表格作为标题,如下面的屏幕截图:

this 解决方案 somhow 需要定制,特别是在标题页上,我不知道该怎么做!

---
output:
  bookdown::pdf_document2: 
    keep_tex: true
documentclass: book
classoption: demo   
header-includes:
  - \usepackage{array}
  - \usepackage{lastpage}
  - \usepackage{lipsum}
  - \usepackage{fancyhdr}
  - \usepackage{geometry}
  - \geometry{hmargin=2cm,top=4cm,headheight=65pt,footskip=65pt}
  - \setlength{\parindent}{0.95cm}
  - \pagestyle{fancy}
  - \renewcommand{\headrulewidth}{0pt}
  - \fancyhead[CE,CO,LE,LO,RE,RO]{}
  - \fancyhead[C]{\begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.5cm}|} \hline\includegraphics[height=1.5cm,width=2.5cm]{logo.png} &           \centering \Huge{TITLE} & \centering \tiny{P\'ag. \thepage\ de \pageref{LastPage}\\ Data{:} 17/05/2013\\  Rev. 0}\tabularnewline \hline \end{tabular}}
  - \fancyfoot[CE,CO,LE,LO,RE,RO]{}
  - \fancyfoot[C]{\begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.5cm}|} \hline \includegraphics[height=1.5cm,width=2.5cm]{logo.png} & \centering \Huge{TITLE} & \centering \tiny{P\'ag. \thepage\ de \pageref{LastPage}\\ Data{:} 17/05/2013\\ Rev. 0}\tabularnewline \hline \end{tabular}}
---


# Chapter title
\thispagestyle{fancy}
## Section title
\lipsum[1-10]
r templates latex r-markdown knitr
1个回答
0
投票

fancyhdr LaTeX 包的手册 给出了解决方案(参见第 13 页):将

\fancypagestyle{plain}{}
添加到标题包含列表中。这也意味着您不再需要文档正文中的
\thispagestyle{fancy}

---
output:
  bookdown::pdf_document2: 
    keep_tex: true
documentclass: book
classoption: demo   
header-includes:
  - \usepackage{array}
  - \usepackage{lastpage}
  - \usepackage{lipsum}
  - \usepackage{fancyhdr}
  - \usepackage{geometry}
  - \geometry{hmargin=2cm,top=4cm,headheight=65pt,footskip=65pt}
  - \setlength{\parindent}{0.95cm}
  - \pagestyle{fancy}
  - \fancypagestyle{plain}{}
  - \renewcommand{\headrulewidth}{0pt}
  - \fancyhead[CE,CO,LE,LO,RE,RO]{}
  - \fancyhead[C]{\begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.5cm}|} \hline\includegraphics[height=1.5cm,width=2.5cm]{logo.png} &           \centering \Huge{TITLE} & \centering \tiny{P\'ag. \thepage\ de \pageref{LastPage}\\ Data{:} 17/05/2013\\  Rev. 0}\tabularnewline \hline \end{tabular}}
  - \fancyfoot[CE,CO,LE,LO,RE,RO]{}
  - \fancyfoot[C]{\begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.5cm}|} \hline \includegraphics[height=1.5cm,width=2.5cm]{logo.png} & \centering \Huge{TITLE} & \centering \tiny{P\'ag. \thepage\ de \pageref{LastPage}\\ Data{:} 17/05/2013\\ Rev. 0}\tabularnewline \hline \end{tabular}}
---

# Chapter title
## Section title
\lipsum[1-10]

© www.soinside.com 2019 - 2024. All rights reserved.