Skip to content
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

Code Chunk in Aside #13

Open
1danjordan opened this issue Apr 1, 2016 · 11 comments
Open

Code Chunk in Aside #13

1danjordan opened this issue Apr 1, 2016 · 11 comments
Labels
feature a feature request or enhancement

Comments

@1danjordan
Copy link

Hi guys,

I've been using R Markdown for a while for assignments in university. My experience has been terrific and I am forever grateful to @yihui and the rest of R Studio for creating and supporting it. Some assignments require the inclusion of code in the document, and I thought using Tufte style margins might be nice for including one liners and short snippets.

I was hoping there would be chunk option, similar to fig.margin but I don't think this feature is supported. I've been looking all over but I cannot find simple way to hack it either. There is no mention or example in the RStudio material, however I did see something in Michael Sachs original example. To place the code chunk in the margin he included the html aside tags which doesn't seem to work as he's specified any more, and alludes to using the pandoc footnote syntax for LaTeX/PDF. Pandoc footnotes seem to work for outputting inline R results, but I can't get it to work for code chunks.

Is there a way to achieve this and/or are there future plans to implement something like it? I don't know if this feature clashes with the Tufte style and understand that if this were so this might make this issue irrelevant.

@yihui
Copy link
Member

yihui commented Apr 7, 2016

Sorry for the late response. You are the second one who requested this feature, so I'll consider it. It should be relatively easy to implement for LaTeX output, but might be a little tricky for HTML output, since I don't use the <aside> tag.

@1danjordan
Copy link
Author

If I was a better developer I would have forked and given it a go myself, but I'm not and I think this feature would be really beneficial. Thanks yihui!

@spholmes
Copy link

I want to pitch in and say I am trying to hack a way to do this and
would love to have a cleaner solution that my current one.
Thanks Yihui.

@yihui
Copy link
Member

yihui commented Apr 18, 2016

@spholmes Sure I'll think about it. You were the first one who requested this feature :)

@joelgombin
Copy link

I'm not sure whether it would be a related feature or a distinct one, but being able to include htmlwidgets as a margin content would be awesome. At the moment it's a bit frustrating that you're able to include static figures in margin but not dynamic ones. (I'm only thinking about HTML output, obvisouly).

@jcchacon
Copy link

First of all, thank all those who have created and expanded R markdown, and especially Yihui. We have much to thank to you.
In my case, I was seeking to include code chunks in aside, in order to write a book about graphics in R. For me, Tufte's style is an example of how legibility and spatial equilibrium can be accompanied by visual beauty. Although it may seem outdated, I think that beauty is a psychological added value to any reading; a small pleasure in itself.
I'm not a programmer, so I can help to use and test any improvement in this (or any other) way.
Thank you all, again.

@1beb
Copy link
Contributor

1beb commented Jan 24, 2017

+1 here, would be helpful to be able to add inline code in margin text. Especially for parameterized reporting this would be an excellent feature.

Example usage case:

A standardized report that has customized margin text by parameter.

@jeremy-allen
Copy link

+1 for inline code in the margin for html output.

@egarpor
Copy link

egarpor commented Nov 14, 2018

+1, would be a great feature.

@aminadibi
Copy link

+1 for code chunk in the margin!

@lsempe77
Copy link

lsempe77 commented Sep 7, 2021

Anyone have done it? Thanks

I'm not sure whether it would be a related feature or a distinct one, but being able to include htmlwidgets as a margin content would be awesome. At the moment it's a bit frustrating that you're able to include static figures in margin but not dynamic ones. (I'm only thinking about HTML output, obvisouly).

@cderv cderv added feature a feature request or enhancement and removed enhancement labels Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests