2015-05-05 10 views
7

Utilizzando il file tufte_template rmarkdown, sto cercando di fare un nuovo paragrafo che uso due spazi, indicata qui con * (come \newthought{}, ma senza tappi.):Interruzioni di riga nel testo R Markdown (non blocchi di codice)

# Introduction 

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

ma ottenere questo risultato:

enter image description here

ho cercato \n in luogo della seconda coppia di spazi (**) nonché, ma Pandoc genera un errore.

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

Infine, ho provato ad utilizzare un tag <br>, ma che sembra non avere alcun effetto - non stampa il testo o una pausa al PDF.

Vorrei un nuovo paragrafo, senza il rientro, simile a \ newthought {}, ma senza la maiuscola ... c'è un modo?

Update 1 con 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 

Update 2

Questo sembra essere un problema che incontro particolare quando si utilizza il modello Tufte:

enter image description here

+0

Il codice funziona per me, nessun rientro, no capitalizzazione. – zx8754

+0

@ zx8754 hai una linea piena e vuota tra il "Documento Tufte LaTex" e "le classi definiscono ..."? – d8aninja

+0

Sì, linea vuota. – zx8754

risposta

12

Ho provato questi test, sembra di lavorare:

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

sembrerebbe che sia il tufte_template che sta causando questi esiti diversi ... vedere la nuova immagine che ho aggiornato con - Perché dovrebbe farlo? – d8aninja

3

E 'una domanda un po' vecchia, ma inserisco una risposta dal momento che è il primo colpo quando googling per "interruzioni di riga in rmarkdown ".

Se si compila in formato PDF, è possibile utilizzare macro in lattice. Sostituire il ** nella nuova linea con \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... 
Problemi correlati