When I'm inserting long captions and the like in my R chunk header, it'd be nice to be able to split the header across multiple lines.
Is there any easy way to do this?
E.g.:
```{r, echo=FALSE, warning=FALSE,
fig.cap="Here is my really long caption. It'd be nice to split this and other portions across lines"}
print(plot(x=runif(100),y=runif(100)))
```
No, you cannot insert line breaks in chunk options. From the manual:
However, if you desperately want neat formatting in the editor you could take a detour via an additional variable, but this inflates the code quite a lot:
With the option
eval.after
it is even possible to definemycaption
within the chunk that uses it as option value:(I assume that the question is about how the code looks (in the editor) not about a line break in the output.)