knitr and LuaLaTeX

Scott Kostyshak skostysh at
Fri Apr 24 04:08:38 UTC 2020

On Thu, Apr 23, 2020 at 09:31:53PM +0200, Dr Eberhard Lisse wrote:
> Hi,
> I have a LyX/knitR document which is
> 	Document -> Settings -> Formats
> 		Default Output Format: PDF (LuaTeX)
> produces PDF without issue.
> Export to TeX
> 	latexmk pgf.tex
> produces PDF without issue
> Export to Rnw
> 	R -e 'library(knitr);knit("pgf.Rnw")' && latexmk pgf.tex
> fails as there is no
> 	\usepackage[latin9]{luainputenc}
> in the Rnw which is however present in the pgf.tex.
> Should that not be there as determined by the Default Output Format?

I can see why you would expect that. Currently in LyX, from what I
understand, the default output format does not affect non-default
output. If your default output is set to PDF (LuaTeX) and you export to
knitr, LyX thinks "OK they don't want the default output format since
they chose a different output".

However, I do see your point that if LyX had to guess what flavor of TeX
it should write the .Rnw in, choosing the flavor that is in the chain
for the default output format is a good guess.

This discussion seems somewhat related to the following feature, which
is not yet implemented:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <>

More information about the lyx-users mailing list