2016-02-19 12 views
5

LaTeX \textttに相当するRマークダウンとは何ですか?RマークダウンはLaTeX textttに相当しますか?

このMWEで

:私は、このPDFファイルを取得する

--- 
title: "A test" 
author: "Alessandro" 
date: "February 19, 2016" 
output: pdf_document 
--- 
```{r, echo=FALSE} 
d<-data.frame(product_name=c('d','a','b','c')) # what to write here to get a typewriter font? 
``` 

Product names are: `r sort(d$product_name)`. 

enter image description here

私はこの.tex file

\documentclass[a4paper]{article} 

\usepackage[english]{babel} 
\usepackage[utf8x]{inputenc} 
\usepackage{amsmath} 
\usepackage{graphicx} 
\usepackage[colorinlistoftodos]{todonotes} 

\title{A test} 
\author{Alessandro} 

\begin{document} 
\maketitle 
Product names are: \texttt{a, b, c, d}. 

\end{document} 

enter image description here

からの出力を取得したいと思いますが

答えて

4

これを行うためのネイティブなマークダウン方法はありません。出力フォーマットはpdf_documentときしかし、\textttのrmarkdownと同等の\textttそのものです:

Product names are: \texttt{`r sort(d$product_name)`}. 

Rmarkdownは、PDFファイルにコンパイルすることが期待ように、ほとんどの生のラテックスコマンドが動作するはずボンネットの下にラテックスを使用しています。

Product names are: <tt>`r sort(d$product_name)`</tt>. 

同じことがHTML出力のための真であります

関連する問題