A Small Question

Scott Kostyshak skostysh at lyx.org
Sun Apr 11 20:55:30 UTC 2021

On Sun, Apr 11, 2021 at 02:07:51PM -0600, Doug Martin wrote:
> Scott and all,
> Here you go.  As you will see, the Table is fine, but we get the "knitr
> errors" message:
> LaTeX Error: Not in outer par mode.
> Doug
> P.S. We like various capabilities that the kableExtra package provides us
> with, e.g.,
> in this simple example the add_header_above via kable_styling.
> Of course if we ever find out how to directly import a data frame into the
> LYX table
> capability, we will probably use it a lot.

Can you try replacing the line

  kable_styling %>%

in your .lyx file with

  kable_styling(table.env = "centering") %>%

or perhaps instead the following:

  kable_styling(table.env = "@empty") %>%

When I do that, the .lyx file compiles. This is a hack. Ideally, the
table.env argument would treat the value NA to mean "don't output any
table environment", but it does not behave that way. Perhaps worth an
enhancement request to the kableExtra authors? Note that with xtable you
can achieve this with the argument "floating = FALSE". Perhaps
kable_styling has a way to do it but I couldn't find it.

In any case, does that "hack" work for you? In case my instructions
above are not clear, I attach the .lyx file with the change. I went with
the first suggested change (using "centering"), but the second one
(using "@empty") might be better. If one doesn't work, try the other.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: outerparErrorExample_with_hack.lyx
Type: application/x-lyx
Size: 6251 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210411/1812bff5/attachment.lyx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210411/1812bff5/attachment.asc>

More information about the lyx-devel mailing list