A Small Question

Doug Martin martinrd3d at gmail.com
Mon Apr 12 19:12:43 UTC 2021


Thanks for your suggestions, both of which work, without resulting in the
error message we were getting.
This is simpler than adding the LaTeX code lines for every table, so we
will use it.

We will suggest the change needed to the kableExtra author Hao Zhu, who has
previously been
very helpful.


On Sun, Apr 11, 2021 at 2:55 PM Scott Kostyshak <skostysh at lyx.org> wrote:

> 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.
> Scott

R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
University of Washington
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210412/c3c92ea1/attachment.html>

More information about the lyx-devel mailing list