2013-12-16 5 views
7

apa6e जैसे वर्ग के साथ बुनाई का उपयोग करते समय कोड के बाकी हिस्सों की तरह डबल स्पेस के लिए डिफ़ॉल्ट रूप से डिफ़ॉल्ट डेटा कोड को डिफ़ॉल्ट करते हैं। यह वांछनीय नहीं है।कक्षा एक डबल स्पेस कोड (आरएनडब्ल्यू)

\begin{singlespace} 
<<*>>= 
CODE 
@ 
\end{singlespace} 

कैसे इस विश्व स्तर पर किया जा सकता है बजाय tex सिंगल स्पेस टैग के साथ लपेटकर:

इस के साथ लपेटकर द्वारा बदला जा सकता है?

मेगावाट फ़ाइल .Rnw

\documentclass[leavefloats]{apa6e} 
\usepackage[american]{babel} 
\usepackage{csquotes} 
\usepackage[style=apa,backend=biber,bibencoding=latin1]{biblatex} 
\DeclareLanguageMapping{american}{american-apa} 

\begin{document} 

<<setup, include=FALSE, cache=FALSE>>= 
# set global chunk options 
opts_chunk$set(fig.path='figure/minimal-', fig.align='center', fig.show='hold') 
options(replace.assign=TRUE,width=90) 
library(ggplot2); library(xtable) 
@ 

\title{MWE} 
\shorttitle{MWE} 
\author{Tyler Rinker} 
\date{\today} 
\authornote{\dots} 
\abstract{This is an example of an abstract in APA.} 
\maketitle 


<<foo>>= 
x <- "Got me some code" 
y <- "look another line" 
paste(x, y) 
@ 

\begin{singlespace} 
<<bar>>= 
x <- "Got me some code" 
y <- "look another line" 
paste(x, y) 
@ 
\end{singlespace} 

\end{document} 

उत्तर

8

आप knitrout को फिर से परिभाषित कर सकते हैं singlespace वातावरण में knitr उत्पादन जगह (जो डिफ़ॉल्ट रूप से रिक्त है):

\renewenvironment{knitrout}{\begin{singlespace}}{\end{singlespace}} 
+0

निर्माण पूरी तरह से। धन्यवाद। –

संबंधित मुद्दे