The path of my directory dont showed completly when make knirt

Hi Community,

Im try to make a pdf and all is well :grin: But I see that the path dont appear completly in the pdf file.

What things I need put for the pdf show all the path? Because the path is a little large.

This is the code of problematic chunk:

library(readxl)

# Para encontrar el archivo podemos usar
# file.choose()

datos<-read_excel( "C:\\Users\\MiguelAngel\\Documents\\R Miguelo\\Ciencia Datos Ecuador\\Intro curso\\World.xlsx", sheet="Hoja2")

The wrong pdf out put:

Maybe some Rmarkdown options I need put for make better this chunk.

Thanks

Hi @M_AcostaCH ! This is actually a setting in pandoc, not R Markdown. It's covered in more depth here.

" For PDF output, it is trickier to wrap the lines. One solution is to use the LaTeX package listings , which can be enabled via the Pandoc argument --listings"

...but it's a great excuse to use one of the many great .html outputs :+1:!

2 Likes

Hi @mjfrigaard, this run well in html, but not in pdf file.

html

pdf
image

The initial code is this:

---
title: "Estadística Básica para Ciencia de Datos con R"
author: "Ciencia de Datos Ecuador"
date: "23/2/2022"
output:
  pdf_document: default
  pandoc_args: --listings
  html_document: default
---

This is a LaTeX issue mainly. Some hints are in the R Markdown Cookbook linked above also

Long lines won't wrap by default in LaTeX verbatim environment. You need to find a way to rewrite or use some tools as described.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.