# yihui/knitr

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# output within curly braces not falling in line #421

Closed
opened this Issue Nov 8, 2012 · 3 comments

## Comments

2 participants

### romunov commented Nov 8, 2012

 I noticed that sometimes, output will not respect the wrapping set forth by options(width = n). Here's a minimal example to demonstrate what I mean. \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \begin{document} <<>>= options(width = 60) citation("vegan") @ \end{document}  Any tips?
Owner

### yihui commented Nov 8, 2012

 I just write whatever R gives me. In this case, R gives me a long line and R does not respect options(width) in this case. On one hand, this specific example is not convincing because normally we do not write the bibtex citation as verbatim R output (put it in bibtex database and process it with bibtex/latex instead); on the other hand, it is not easy to have a general rule to break long lines (sometimes you may want to, sometimes you probably should not). That said, you can certainly tweak the output hook function to manually break the output lines. Let me know if you need examples. The other way to go (much harder) is to convince R core to respect the width option when printing citation entries.

### romunov commented Nov 8, 2012

 What baffles me is that some text gets wrapped and some doesn't. Here's my rendition of the above code. Notice that the first paragraph gets folded nicely but the BibTeX citation overflows. Fortunately, you're right, and this sort of wrapping is seldomly needed.
Owner

### yihui commented Nov 8, 2012

 Then that is a question for R core. Presumably it has to be done in print.bibentry().

Closed

### yihui added a commit that referenced this issue Oct 12, 2016

 explains the width option may not work; closes #421 
 9c1d1bf 
to join this conversation on GitHub. Already have an account? Sign in to comment