【发布时间】:2018-08-07 03:17:46
【问题描述】:
我正在尝试借助 R Markdown 包编写 Latex 文档。 我一直在使用 TaxMaker 等软件,但考虑到我将使用 R 来生成多个绘图,我想尝试 R Markdown 包。
到目前为止,我有一个非常简单的代码,只是为了尝试理解它的工作原理。这里有文件
---
title: "Untitled"
output: pdf_document
---
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[latin1]{inputenc}
\title{My Title}
\author{Me}
\date{}
\begin{document}
\maketitle
\end{document}
但是这不能编译:
! LaTeX Error: Can be used only in preamble.
Error: Failed to compile 1.tex. See 1.log for more info.
Execution halted
相同的代码在标准的 Latex 环境中完美运行。
我错过了什么? 谢谢
【问题讨论】:
-
我注意到您的问题得到了很好的回答,但很少接受这些问题。提示 .-)