Re: Knitr (Rnw) Rscript error log
On Sat, Sep 29, 2012 at 5:43 PM, Yihui Xie wrote: > He sent me the message log without cc'ing the list, and I saw > > 12:13:14.353: Rscript --verbose --no-save --no-restore > "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" > "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw" > "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""tex" > UTF-8 "/Users/XYZ/Documents/..." > > I think that is Mac OS, although in the first email it was Windows 7. Ah, yes I think I thought the same thing when I saw that. Glad I'm not the only one that was confused. Scott
Re: Lyx on MacBook Pro retina
Here is a way to get it working (for the displayed text at least - icons are another matter): 1. Edit /Applications/LyX.app/Contents/Info.plist 2. At the bottom of that file, inside the scope, add the following two lines: NSHighResolutionCapable Restart LyX and you should be good to go! James On Fri, Sep 28, 2012 at 7:14 AM, Jacques Le Bourlot < jacques.lebour...@obspm.fr> wrote: > > Bonjour, > > I just got a new MacBook Pro 15" with retina screen (which nobody care, I > guess). However, LyX is one of the very few applications which does NOT > scale to the new resolution. The result is both blurry and extremely ugly. > > Is there a (VERY simple) way to fix that, or must I wait for an update? > > Thank you. > > Jacques >
How to make a layout derived from extbook in LyX?
Hi all, I'm writing a couple books destined to be eBooks and nothing else, so I want bigger than a 12pt font, and I understand the way to do that is with the extsizes package, which I already have installed and texhashed. For most books I like to make a layout derived the Book document class, so now that I can use 17 point (or maybe only 14 pt), I wanted to derive it from the extbook document class. I did NOT want to go and use something like Koma -- my belief is that switching document classes every time you want a different feature is walking the road to ruin. But it was not at all obvious how to make a layout based on extsizes.cls, that would both reveal all font sizes in the LyX environment, and compile to a PDF. Finally, after searching the web, I just imitated Herbert Voss' extbook layout: http://fossies.org/unix/misc/lyx-2.0.4.tar.gz:a/lyx-2.0.4/lib/layouts/extbook.layout My derivation line (the comment that's line #2 in the layout file) looked like this: # \DeclareLaTeXClass[extbook]{tp_book} The tp_book class is what shows up in the document class list. Then, a few lines down, where the Global Parameters are listed, I added these three lines: ClassOptions FontSize 8|9|10|11|12|14|17|20 end After running LyX and doing Tools->Reconfigure, I was able to select 20pt as the base size, recompile to PDF, and everything worked perfectly. Well, almost perfectly. The default Roman font looked stringy at 20pt -- ugly as sin. Same for Computer Modern Roman, Latin Modern Roman, AE Almost European. Century Schoolbook was much better, but looked a little too bold and blocky at 20pt. Times Roman looked pretty good. Palatino was good and solid, but looked a little funky. Bitstream Charter looked good. Bookman wasn't as stringy as default, but a little too reedy, and the individual letters were too wide. Utopia looked excellent at 20pt. Between these fonts, I think it will be a coin toss between Century Schoolbook and Utopia. I'd like to figure out how to get Liberation Serif, Liberation Sans, and Liberation Mono into LyX, as these exactly mimic Windows TruType Times New Roman, Arial, and Courier New fonts, and I think I'll have less legal ramifications for embedding in the PDF than would other fonts. But of course, I'll need to learn how to incorporate the Liberation fonts into LyX. Anyway, if anyone wants to use larger base fonts with a layout file derived from extbook.cls, which is basically the Book class with some bigger sizes, this is how you do it. SteveT Steve Litt* http://www.troubleshooters.com/ Troubleshooting Training * Human Performance
Re: Knitr (Rnw) Rscript error log
He sent me the message log without cc'ing the list, and I saw 12:13:14.353: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw" "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""tex" UTF-8 "/Users/XYZ/Documents/..." I think that is Mac OS, although in the first email it was Windows 7. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Sat, Sep 29, 2012 at 4:39 PM, Scott Kostyshak wrote: > > I misunderstood. In his original email he stated that he is using Windows 7. > Sorry for the confusion. > > Scott
Re: Knitr (Rnw) Rscript error log
On Sat, Sep 29, 2012 at 5:34 PM, Yihui Xie wrote: > I think this indicated the problem in your log: > > 12:13:14.670: Warning in readLines(input, warn = FALSE) : > 12:13:14.673: invalid input found on input connection 'skryptum.Rnw' > > But without a reproducible example, I'm afraid I cannot do anything, > especially I do not have Mac OS to test with. I misunderstood. In his original email he stated that he is using Windows 7. Sorry for the confusion. Scott
Re: Knitr (Rnw) Rscript error log
I think this indicated the problem in your log: 12:13:14.670: Warning in readLines(input, warn = FALSE) : 12:13:14.673: invalid input found on input connection 'skryptum.Rnw' But without a reproducible example, I'm afraid I cannot do anything, especially I do not have Mac OS to test with. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Sat, Sep 29, 2012 at 10:52 AM, Michael Bach wrote: > Just a quick follow-up. > > I gather from the log that R reads the file as UTF-8. I checked my System > > $ locale > > and the R > >> Sys.getlocale() > > Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)... >
Re: highlighting long text exhibits
I have used the following environment with good results: \newenvironment{sidebar}{\def\FrameCommand{\color[gray]{0.8}\vrule width 5pt \hspace{10pt}\color{black}}\MakeFramed{\advance\hsize-\width\FrameRestore}}{\endMakeFramed} then in the text you can use \begin{sidebar} ... \end{sidebar} and you obtain a grey sidebar for your text. Francesco Il 29/09/2012 16:11, Jeremy C. Reed ha scritto: My book has several long exhibits or examples that may be multiple pages long (such as verbatim copies of software agreements and lists of software packages and descriptions). Instead of putting at end of book as appendix material, I am including them directly in the chapters with the related content. I'd like it to be identified somehow to be extra content so it doesn't break the flow of the reading and is easily identified. Some ideas I tried: - alltt environment but the fixed font went beyond right margins and no caption for each page. - sloppypar with texttt -- that was fine but didn't identify it was different than rest of content other than font change. (I don't care if the content paragraphs are reformatted.) Also no caption for each page. - longtable with vertical and horizontal borders (a box) with the sloppypar and texttt for content inside and a caption at the bottom. I also changed the tablename (and listtablename) to be "Exhibit" instead "Table". (By the way, do any of you do this? What do you call it?) The problem with this is that the caption is only on one page. Also I may have bottom hline and caption on page by itself. And on another example the content just goes off the bottom margin instead of continuing to next page. - Used framed package with leftbar environment. That is fine but no caption (need a float? but that won't work for a multipage?) I will next try using lstlistings with lstcaptioncont (so I can have captions on every page). But I want the text paragraphs to flow together instead of going out into right margin. Any ideas on that? (Instead of continuing to spend more hours trying new ideas, I decided now to ask the list :) Does anyone have any suggestions or ideas on how to do this better? Thank you, Jeremy C. Reed echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \ tr'#-~''\-.-{' -- Francesco Menoncin Università degli Studi di Brescia Facoltà di Economia Via S. Faustino, 74/B 25122 Brescia (Italy) Tel: 0039-030-2988806 Fax: 0039-030-2988837 E-mail: menon...@eco.unibs.it web: www.eco.unibs.it/~menoncin/
Re: Knitr (Rnw) Rscript error log
Does the knitr example file work? I forget how to get to example files on MacOS. Mabye Yihui will have an idea of what's going on, but in the meantime if you want to try something, you can try with the newest version of LyX's knitr module that Yihui sent in a couple of days ago. To do this, you can either (1) apply the attached diff. It should succeed on 2.0.4 with a hunk offset. or (2) copy the other two files attached, to the correct places. Don't forget to back up the original files. Scott On Sat, Sep 29, 2012 at 11:52 AM, Michael Bach wrote: > Just a quick follow-up. > > I gather from the log that R reads the file as UTF-8. I checked my System > > $ locale > > and the R > >> Sys.getlocale() > > Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)... > diff --git a/lib/examples/knitr.lyx b/lib/examples/knitr.lyx index ddbfe01..feab161 100644 --- a/lib/examples/knitr.lyx +++ b/lib/examples/knitr.lyx @@ -182,7 +182,7 @@ status collapsed \begin_layout Plain Layout -http://yihui.github.com/knitr +http://yihui.name/knitr \end_layout \end_inset diff --git a/lib/layouts/knitr.module b/lib/layouts/knitr.module index 694ae77..fe64359 100644 --- a/lib/layouts/knitr.module +++ b/lib/layouts/knitr.module @@ -1,7 +1,7 @@ #\DeclareLyXModule[knitr->latex]{Rnw (knitr)} #DescriptionBegin #Uses the knitr package in R for dynamic report generation. This R package has to be installed for this module to work: install.packages('knitr'). Note it depends on R >= 2.14.1. -#For more info see http://yihui.github.com/knitr +#For more info see http://yihui.name/knitr #DescriptionEnd #Category: literate #Excludes: lilypond | sweave diff --git a/lib/scripts/lyxknitr.R b/lib/scripts/lyxknitr.R index 03150f2..7c029ea 100644 --- a/lib/scripts/lyxknitr.R +++ b/lib/scripts/lyxknitr.R @@ -11,7 +11,7 @@ ## author Yihui Xie ## knitr is an alternative package to Sweave, and has more features -## and flexibility; see https://yihui.github.com/knitr +## and flexibility; see https://yihui.name/knitr ## Rscript $$s/scripts/lyxknitr.R $$p$$i $$p$$o $$e $$r ## $$p the path of the output (temp dir) @@ -31,18 +31,7 @@ options(encoding = .cmdargs[3]) ## can put your data files there and functions like read.table() can ## work correctly without specifying the full path setwd(.cmdargs[4]) +opts_knit$set(root.dir = getwd()) -## copy the Rnw file to the current working directory if it does not exist -.tmp.file = tempfile(); .rnw.file = basename(.cmdargs[1]) -.rnw.exists = file.exists(.rnw.file) -if (.rnw.exists) file.rename(.rnw.file, .tmp.file) -file.copy(.cmdargs[1], '.') ## run knit() to get .tex or .R -knit(.rnw.file, tangle = 'tangle' %in% .cmdargs) - -setwd(.cmdargs[4]) -## remove the copied .Rnw if it did not exist, otherwise move the original one back -if (.rnw.exists) file.rename(.tmp.file, .rnw.file) else unlink(.rnw.file) -file.rename(basename(.cmdargs[2]), .cmdargs[2]) # move .tex to the temp dir -rm(.tmp.file, .rnw.file, .rnw.exists) # clean up these variables - +knit(.cmdargs[1], output = .cmdargs[2], tangle = 'tangle' %in% .cmdargs) knitr.module Description: Binary data lyxknitr.R Description: Binary data
Toobar customizing
Hello, I'd like to cutomize the toolbars by adding some new shortcut items. Documentation is still confused about the name of the icon. For example : 1 - I want to add three items that align the text on left, center and right, i put this code Item "Left" "paragraph-params-apply \align left" Item "Center" "paragraph-params-apply \align center" Item "Right" "paragraph-params-apply \align right" but i can't understand how to fix an icon for each item, normally icon must be named as action_parameter.png, do i name paragraph-params-apply_align_left.png ? 2 - I add a shortcut that insert a math-delim "{ ." as follow Item "Insert { }" "math-delim { ." and i name an icon in math path as lbrace_dot.png but nothing appear, what's wrong ? Best regards.
Re: Knitr (Rnw) Rscript error log
Just a quick follow-up. I gather from the log that R reads the file as UTF-8. I checked my System $ locale and the R > Sys.getlocale() Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...
highlighting long text exhibits
My book has several long exhibits or examples that may be multiple pages long (such as verbatim copies of software agreements and lists of software packages and descriptions). Instead of putting at end of book as appendix material, I am including them directly in the chapters with the related content. I'd like it to be identified somehow to be extra content so it doesn't break the flow of the reading and is easily identified. Some ideas I tried: - alltt environment but the fixed font went beyond right margins and no caption for each page. - sloppypar with texttt -- that was fine but didn't identify it was different than rest of content other than font change. (I don't care if the content paragraphs are reformatted.) Also no caption for each page. - longtable with vertical and horizontal borders (a box) with the sloppypar and texttt for content inside and a caption at the bottom. I also changed the tablename (and listtablename) to be "Exhibit" instead "Table". (By the way, do any of you do this? What do you call it?) The problem with this is that the caption is only on one page. Also I may have bottom hline and caption on page by itself. And on another example the content just goes off the bottom margin instead of continuing to next page. - Used framed package with leftbar environment. That is fine but no caption (need a float? but that won't work for a multipage?) I will next try using lstlistings with lstcaptioncont (so I can have captions on every page). But I want the text paragraphs to flow together instead of going out into right margin. Any ideas on that? (Instead of continuing to spend more hours trying new ideas, I decided now to ask the list :) Does anyone have any suggestions or ideas on how to do this better? Thank you, Jeremy C. Reed echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \ tr'#-~''\-.-{'
Re: Knitr (Rnw) Rscript error log
On 9/26/12 6:25 PM, Yihui Xie wrote: The first place to look at is View-->View Messages, as described in the troubleshooting section in Sweave manual (which applies to knitr as well): https://github.com/downloads/yihui/lyx/sweave.pdf Very good to know, thanks. I enabled that and tried again. It seems that there is an invalid input found by R(?). Please see also the complete log at the end of this post. I investigated the .tex file and found it was cut off in the middle of the abstract environment. I then opened an R session in the temp directory and ran knit("skryptum.Rnw") which produces a skryptum.tex file that can be tex'ed correctly and contains the \Sepr{} parts. Also, the .Rnw file is complete, i.e. not cut off like the .tex file. So I guess the Rscript call messes things up? I tried the hint by Scott on setting an error hook, but to no avail. How to debug further? -- 12:13:14.051: Previewing ... 12:13:14.085: (buffer-view: ⌘R) 12:13:14.353: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw" "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.tex" UTF-8 "/Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/" 12:13:14.373: running 12:13:14.381: '/Library/Frameworks/R.framework/Versions/2.15/Resources/bin/R --slave --no-restore --no-save --no-restore --file=/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R --args /var/folders/yx/ 12:13:14.383: tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex UTF-8' 12:13:14.384: Running: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw" "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.tex" UTF-8 "/Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/" 12:13:14.663: [1] TRUE 12:13:14.670: Warning in readLines(input, warn = FALSE) : 12:13:14.673: invalid input found on input connection 'skryptum.Rnw' 12:13:14.925: 12:13:14.925: 12:13:14.927: processing file: skryptum.Rnw 12:13:14.942: | | | 0% | 12:13:14.943: |>| 100% 12:13:14.944: ordinary text without R code 12:13:14.944: 12:13:14.947: 12:13:14.948: output file: /Users/.../Documents/Vorlesung/Theorie der Simulationstechnik/src/skryptum.tex 12:13:14.949: 12:13:14.949: [1] "skryptum.tex" 12:13:14.951: [1] TRUE 12:13:14.965: pdflatex "skryptum.tex" Running: pdflatex "skryptum.tex" > /dev/null 12:13:15.211: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) 12:13:15.212: restricted \write18 enabled. 12:13:15.227: entering extended mode 12:13:15.229: (./skryptum.tex 12:13:15.230: LaTeX2e <2011/06/27> 12:13:15.230: Babel and hyphenation patterns for english, dumylang, nohyphenation, ge 12:13:15.231: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi 12:13:15.232: c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis 12:13:15.232: h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis 12:13:15.233: h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h 12:13:15.233: ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma 12:13:15.234: rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, 12:13:15.234: kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, 12:13:15.235: polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s 12:13:15.236: lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, 12:13:15.236: welsh, loaded. 12:13:15.237: 12:13:16.309: pdflatex "skryptum.tex" 12:13:16.503: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) 12:13:16.504: restricted \write18 enabled. /Users/Shared/LyX/lyx-2.0.4/src/support/Systemcall.cpp(273): Systemcall: 'pdflatex "skryptum.tex"' finished with exit code 1 Running: pdflatex "skryptum.tex" > /dev/null 12:13:16.520: entering extended mode 12:13:16.521: (./skryptum.tex 12:13:16.521: LaTeX2e <2011/06/27> 12:13:16.522: Babel and hyphenation patterns for english, dumylang, nohyphenation, ge 12:13:16.523: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi 12:13:16.523: c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis 12:13:16.523: h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic
Re: Lyx on MacBook Pro retina
Le 29 sept. 2012 à 11:02, Jürgen Spitzmüller a écrit : > Richard Heck wrote: >>> Is there a (VERY simple) way to fix that, or must I wait for an update? >> >> I believe this is being fixed for 2.0.5. Stephan? > > Only in trunk, apparently: > http://www.lyx.org/trac/changeset/99e53ffce04337cc50c9cfbdb900e66064d450ed/lyxgit > > Would be worth backporting, I suppose, if it works. > > Jürgen Indeed! Thank you. Jacques
Re: Lyx on MacBook Pro retina
Richard Heck wrote: > > Is there a (VERY simple) way to fix that, or must I wait for an update? > > I believe this is being fixed for 2.0.5. Stephan? Only in trunk, apparently: http://www.lyx.org/trac/changeset/99e53ffce04337cc50c9cfbdb900e66064d450ed/lyxgit Would be worth backporting, I suppose, if it works. Jürgen