Your R Markdown document seems correct. The issue lies in your template.tex document.
This page shows a simple template.tex example:
documentclass{article}
egin{document}
$body$
end{document}
The point of the example is to showcase that the contents of your markdown will be converted to LaTeX and inserted into where the $body$
is located. Therefore, the contents of your markdown are not showing up because there is no $body$
present in your template where the generated LaTeX might be inserted.
However, when I try to use the simple template, I receive an error about an undefined control sequence. This is because a specific LaTeX command is being inserted, but a requisite LaTeX package containing that command is not being loaded.
I am unsure what you want your title page to look like, but here is a working, simple-example of a template that contains a title page consisting of just the title.
documentclass[]{report} % use report class because it contains a title page
usepackage{hyperref} % load the hyperref package to avoid an undefined
% control sequence error
itle{$title$} % set title to what you passed from the yaml in the R
% Markdown document
author{} % set author to empty to avoid warning message about
% no author set; use author{$author$} if you want to
% set author from the yaml like `author: "My Name"`
date{} % set date to empty to avoid a date on the title page;
% use date{$date$} to set from yaml `date: 2021-01-08`
egin{document}
maketitle
$body$
end{document}
But that template is pretty simple, and you will quickly run into additional undefined errors as you attempt to do more in your R Markdown document than what you have showed.
I recommend starting with the default LaTeX template of Pandoc and tweaking that to get where you want to go. The default LaTeX template of Pandoc can be found at https://github.com/jgm/pandoc/tree/master/data/templates (named default.latex).
In fact, you might be able to use the default template as is and just change your yaml because the following will create a title page as above:
---
title: "My Super Awesome Title"
documentclass: report
output: pdf_document
---
# abstract
this is just some text
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…