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

\begin{fullwidth} not working for highlighted code chunks #222

Closed
gimoya opened this issue May 4, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@gimoya
Copy link

commented May 4, 2012

in the tufte handout I try to set fullwidth for a text block containing highlighted r-code like:

\section{Statistical Analysis:}
\begin{fullwidth}
<<Stats, eval=TRUE>>=
binom.test(10, 121))
@
\end{fullwidth}

but this doesn't widen the block - it only centers it...

Is there a way around, or maybe it should be optimized internally?

Kind regards,
Kay

@yihui

This comment has been minimized.

Copy link
Owner

commented May 4, 2012

That is probably a bug of the framed package (http://yihui.name/knitr/demo/framed/); it does not work well with the fullwidth environment. You have two choices:

  1. redefine the kframe environment like

    \renewenvironment{kframe}{}{}
  2. use the listings package instead which is more robust (use render_listings() in your first chunk; http://yihui.name/knitr/demo/listings/)

BTW, you can use three backticks to write a fenced code block; see http://github.github.com/github-flavored-markdown/

@r0bis

This comment has been minimized.

Copy link

commented Jul 12, 2018

Interesting thing - if in tufte-handout I start fullwidth and in the enclosed text paragraphs there is italics markdown as in _italicword_ then \begin{fullwidth} and correspondingly the end too get escaped and do not work - i.e. appear in the document verbatim. However if I remove underscore from the paragraphs between fullwidth, then it works very nicely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.