New issue

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
romunov opened this Issue Nov 8, 2012 · 3 comments

Comments

2 participants
@romunov

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?

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Nov 8, 2012

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@romunov

romunov 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.

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.

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Nov 8, 2012

Owner

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

Owner

yihui commented Nov 8, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment