2015-05-05 119 views
7

使用tufte_template rmarkdown文件,我想作一個新的段落我用兩個空格,在此表示的*(如\newthought{},但沒有上限。):換行符中的R降價文本(而不是代碼塊)

# Introduction 

The Tufte-\LaTeX\ [^tufte_latex] document** 
** 
classes define a style similar to the style Edward Tufte uses in his books... 

但得到這樣的結果:

enter image description here

我已經到位,第二對空間(**)也都試圖\n,但pandoc拋出一個錯誤。

pandoc.exe: Error producing PDF from TeX source 
Error: pandoc document conversion failed with error 43 

最後,我試圖用一個<br>標籤,但似乎沒有任何作用 - 它不打印的文本或突破至PDF。

我想要一個新的段落,沒有縮進,類似於\ newthought {},但沒有大寫...有沒有辦法?

更新1與sessionInfo():

> sessionInfo() 
R version 3.1.2 (2014-10-31) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 

locale: 
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C       
[5] LC_TIME=English_United States.1252  

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

loaded via a namespace (and not attached): 
[1] digest_0.6.8 htmltools_0.2.6 rmarkdown_0.5.1 tools_3.1.2  yaml_2.1.13 

更新2

這似乎是使用託佛特模板時我特別遇到一個問題:

enter image description here

+0

您的代碼適用於我,不需要縮進,也不需要大寫。 – zx8754

+0

@ zx8754您在「Tufte LaTex文檔」和「類定義...」之間有完整的空行嗎? – d8aninja

+0

是的,空行。 – zx8754

回答

12

我試過這些測試,看來是工作:

test.Rmd

--- 
output: pdf_document 
--- 

# test 1 
No spaces used 

line1 
line2 


# test 2 
2spaces at the end of line1 

line1 
line2 

# test 3 
2spaces at the end of line1, then 2 spaces on next line 

line1 

line2 

enter image description here

sessionInfo() 
R version 3.2.0 (2015-04-16) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows 7 x64 (build 7601) Service Pack 1 

locale: 
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C       
[5] LC_TIME=English_United Kingdom.1252  

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

loaded via a namespace (and not attached): 
[1] htmltools_0.2.6 tools_3.2.0  yaml_2.1.13  rmarkdown_0.5.1 digest_0.6.8 
+0

它似乎是導致這些不同結果的tufte_template ...查看我更新的新圖像 - 爲什麼會這樣做? – d8aninja

3

這是一個相當古老的問題,但我張貼的答案,因爲它google搜索「換行符的時候是第一次打在rmarkdown「。

如果編譯爲pdf,可以使用乳膠宏。在新行中用**代替** \hfill\break

# Introduction 

The Tufte-\LaTeX\ [^tufte_latex] document** 
\hfill\break 
classes define a style similar to the style Edward Tufte uses in his books... 
相關問題