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

Box width too narrow and Reference Classes not supported? #44

Closed
jankowtf opened this issue Dec 9, 2011 · 9 comments
Closed

Box width too narrow and Reference Classes not supported? #44

jankowtf opened this issue Dec 9, 2011 · 9 comments
Labels
bug Bugs

Comments

@jankowtf
Copy link

jankowtf commented Dec 9, 2011

Hi Yihui,

kudos for knitr, this thing ROCKS!!

I just played around a bit with it and it looks great!
Came across two issues though:

  1. The boxes that contain R code are just a tiny bit too narrow on the right hand side (just try making (x <- rnorm(20)) a bit larger in your minimal example and you'll see)
  2. Code for reference classes does not seem to work (setRefClass etcl).

It'd be great if you could take a look at this once you get a chance!

Thanks a lot,
Janko

PS: I'm on Windows XP SP2, R 2.14.0, LyX 2.0.2, MikTeX 2.9.

@yihui
Copy link
Owner

yihui commented Dec 9, 2011

  1. sorry I do not quite understand what you mean; which boxes are you talking about? or could you show me a screenshot? (e.g. via imgur.com)
  2. I tried the examples in ?setRefClass and they worked, so what exactly is your problem?

Thanks!

@jankowtf
Copy link
Author

jankowtf commented Dec 9, 2011

  1. Sorry if I might not have used the correct LaTeX terminology, but I
    meant the gray box that is put around R code.
  2. Hm, that's strange. Do you know why it might not work for me? I'm
    running all my R related stuff from a USB drive, but set things like
    'lib' and 'destdir', windows PATH stuff etc. accordingly. I'm using LyX
    2.0.2 and MikTeX 2.9, both portable as well.

On 09.12.2011 04:47, Yihui Xie wrote:

  1. sorry I do not quite understand what you mean; which boxes are you talking about? or could you show me a screenshot? (e.g. via imgur.com)
  2. I tried the examples in ?setRefClass and they worked, so what exactly is your problem?

Thanks!


Reply to this email directly or view it on GitHub:
#44 (comment)


Janko Thyson
janko.thyson@googlemail.com mailto:janko.thyson@googlemail.com

Jesuitenstraße 3
D-85049 Ingolstadt

Mobile: +49 (0)176 83294257

This e-mail and any attachment is for authorized use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be
copied, disclosed to, retained or used by any other party.
If you are not an intended recipient then please promptly delete this
e-mail and any attachment and all copies and inform the sender.

@yihui
Copy link
Owner

yihui commented Dec 9, 2011

  1. Do you get similar output as I did? https://github.com/downloads/yihui/knitr/knitr-minimal.pdf If yes, could you point out how wide the gray shading should be?
  2. You need to be more specific on "not working" -- what is not working for setRefClass? highlighting? or R code won't run? or something else?

@jankowtf
Copy link
Author

jankowtf commented Dec 9, 2011

I'm sorry Yihui, seems like you didn't receive the attachment in my last email (an own example based on your minimal example which shows exactly what you asked for) and without it my last message was indeed not really informative ;-)

Or does this email address does not support attachments? I'm trying againd, if it doesn't work let me know and I'll put it up on the web somewhere.

Best regards,

janko

Sent from my Android Mobile Phone. Please excuse potential brevity and/or lowercase typing.


Von: Yihui Xie reply@reply.github.com
Versendet am: Fri Dec 09 20:28:48 MEZ 2011
An: Songpants Janko.thyson@googlemail.com
Betreff: Re: [knitr] Box width too narrow and Reference Classes not supported? (#44)

  1. Do you get similar output as I did? https://github.com/downloads/yihui/knitr/knitr-minimal.pdf If yes, could you point out how wide the gray shading should be?
  2. You need to be more specific on "not working" -- what is not working? highlighting? or R code won't run? or something else?

Reply to this email directly or view it on GitHub:
#44 (comment)

@jankowtf
Copy link
Author

jankowtf commented Dec 9, 2011

Ok, did not work again. You can get the files (lyx and pdf) here:
http://db.tt/bR3HVlrz

http://db.tt/l7bgPPjY

Sent from my Android Mobile Phone. Please excuse potential brevity and/or lowercase typing.


Von: Yihui Xie reply@reply.github.com
Versendet am: Fri Dec 09 20:28:48 MEZ 2011
An: Songpants Janko.thyson@googlemail.com
Betreff: Re: [knitr] Box width too narrow and Reference Classes not supported? (#44)

  1. Do you get similar output as I did? https://github.com/downloads/yihui/knitr/knitr-minimal.pdf If yes, could you point out how wide the gray shading should be?
  2. You need to be more specific on "not working" -- what is not working? highlighting? or R code won't run? or something else?

Reply to this email directly or view it on GitHub:
#44 (comment)

@yihui
Copy link
Owner

yihui commented Dec 9, 2011

Ahh!! It is finally clear to me what you mean now... First off, GitHub emails do not support attachment, so I did not receive anything in your previous messages (that is the source of confusion).

  1. The problem is that your output is too wide (exceeding the margin), rather than the box is too narrow. The fix is to set options(width = a.smaller.number) (e.g. options(width = 60)).
  2. new() is in the methods package, and at the moment you seem to need to load it explicitly; I do not know what happened to your R session, but the methods package should be loaded automatically... I will double check.

@yihui
Copy link
Owner

yihui commented Dec 10, 2011

Now I have found the answer for your second question: when we run an R script via Rscript, the methods package is not loaded by default; see ?Rscript for details. You have to load it explicitly by library(methods) in your code.

@yihui yihui closed this as completed Dec 11, 2011
@jankowtf
Copy link
Author

Great, thanks!

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs
Projects
None yet
Development

No branches or pull requests

2 participants