Skip to content

Instantly share code, notes, and snippets.

@floswald
Created November 4, 2012 16:45
Show Gist options
  • Select an option

  • Save floswald/4012550 to your computer and use it in GitHub Desktop.

Select an option

Save floswald/4012550 to your computer and use it in GitHub Desktop.
problem with lyx and knitr
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass article
\use_default_options true
\begin_modules
knitr
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 11
\spacing single
\use_hyperref false
\papersize a4paper
\use_geometry true
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 0
\boxbgcolor #dbdbdb
\branch answer
\selected 1
\filename_suffix 0
\color #faf0e6
\end_branch
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 2cm
\rightmargin 2cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip smallskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Standard
here is my test
\end_layout
\begin_layout Standard
\begin_inset ERT
status open
\begin_layout Plain Layout
<<summary>>=
\end_layout
\begin_layout Plain Layout
mod = lm(formula=speed ~ dist, data=cars)
\end_layout
\begin_layout Plain Layout
summary(mod)
\end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset
\end_layout
\end_body
\end_document
%%%%%%%%%%%%%%%%
%% LYX MESSAGE LOG
%%%%%%%%%%%%%%%%
18:36:45.944: Previewing ...
18:36:45.947: (buffer-view: ⌘R)
18:36:45.963: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/bd/xhwzz96x2xl6b02bwt4myhy00000gn/T/lyx_tmpdir.JL1822/lyx_tmpbuf2/""test.Rnw" "/var/folders/bd/xhwzz96x2xl6b02bwt4myhy00000gn/T/lyx_tmpdir.JL1822/lyx_tmpbuf2/""test.tex" ISO-8859-15 "/Users/florianoswald/Dropbox/bankruptcy/data/philfed/2012/nevada/"
18:36:46.054: running
18:36:46.060: '/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/bd/
18:36:46.067: xhwzz96x2xl6b02bwt4myhy00000gn/T/lyx_tmpdir.JL1822/lyx_tmpbuf2/test.Rnw /var/folders/bd/xhwzz96x2xl6b02bwt4myhy00000gn/T/lyx_tmpdir.JL1822/lyx_tmpbuf2/test.tex ISO-8859-15'
18:36:46.068:
Running: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/bd/xhwzz96x2xl6b02bwt4myhy00000gn/T/lyx_tmpdir.JL1822/lyx_tmpbuf2/""test.Rnw" "/var/folders/bd/xhwzz96x2xl6b02bwt4myhy00000gn/T/lyx_tmpdir.JL1822/lyx_tmpbuf2/""test.tex" ISO-8859-15 "/Users/florianoswald/Dropbox/bankruptcy/data/philfed/2012/nevada/"
18:36:46.708: [1] TRUE
18:36:46.980:
18:36:46.981:
18:36:46.983: processing file: test.Rnw
18:36:47.001:
|
| | 0%
|
18:36:47.002:
|>>>>>>>>>>>>>>>>>>>>>> | 33%
18:36:47.008: ordinary text without R code
18:36:47.009:
18:36:47.009:
|
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 67%
18:36:47.010: label: summary
18:36:47.179:
|
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 100%
18:36:47.181: ordinary text without R code
18:36:47.182:
18:36:47.182:
18:36:47.184: output file: /Users/florianoswald/Dropbox/bankruptcy/data/philfed/2012/nevada/test.tex
18:36:47.185:
18:36:47.185: [1] "test.tex"
18:36:47.186: [1] TRUE
18:36:47.225: pdflatex "test.tex"
Running: pdflatex "test.tex" > /dev/null
18:36:47.472: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
18:36:47.473: restricted \write18 enabled.
18:36:47.481: entering extended mode
18:36:47.483: (./test.tex
18:36:47.483: LaTeX2e <2011/06/27>
18:36:47.484: Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
18:36:47.484: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
18:36:47.485: c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
18:36:47.485: h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
18:36:47.486: h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
18:36:47.486: ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
18:36:47.487: rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
18:36:47.487: kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
18:36:47.487: polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
18:36:47.488: lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
18:36:47.488: welsh, loaded.
18:36:47.489:
18:36:48.085: Error while previewing format: pdf2/Users/Shared/LyX/lyx-2.0.4/src/support/Systemcall.cpp(273): Systemcall: 'pdflatex "test.tex"' finished with exit code 1
%%%%%%%%%%%%%%%%
% tex file
%%%%%%%%%%%%%%%%
% Preview source code
%% LyX 2.0.4 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,english]{article}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,lmargin=2cm,rmargin=2cm}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{babel}
\begin{document}
here is my second test
<<summary>>=
mod = lm(formula=speed ~ dist, data=cars)
summary(mod)
@
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment