<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Scott,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for your suggestions, both of which work, without resulting in the error message we were getting.</div><div class="gmail_default" style="font-size:small">This is simpler than adding the LaTeX code lines for every table, so we will use it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">We will suggest the change needed to the kableExtra author Hao Zhu, who has previously been <br></div><div class="gmail_default" style="font-size:small">very helpful.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Best,</div><div class="gmail_default" style="font-size:small">Doug<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 11, 2021 at 2:55 PM Scott Kostyshak <<a href="mailto:skostysh@lyx.org" target="_blank">skostysh@lyx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Apr 11, 2021 at 02:07:51PM -0600, Doug Martin wrote:<br>
> Scott and all,<br>
> <br>
> Here you go.  As you will see, the Table is fine, but we get the "knitr<br>
> errors" message:<br>
> LaTeX Error: Not in outer par mode.<br>
> <br>
> Doug<br>
> <br>
> P.S. We like various capabilities that the kableExtra package provides us<br>
> with, e.g.,<br>
> in this simple example the add_header_above via kable_styling.<br>
> Of course if we ever find out how to directly import a data frame into the<br>
> LYX table<br>
> capability, we will probably use it a lot.<br>
<br>
Can you try replacing the line<br>
<br>
  kable_styling %>%<br>
<br>
in your .lyx file with<br>
<br>
  kable_styling(table.env = "centering") %>%<br>
<br>
or perhaps instead the following:<br>
<br>
  kable_styling(table.env = "@empty") %>%<br>
<br>
When I do that, the .lyx file compiles. This is a hack. Ideally, the<br>
table.env argument would treat the value NA to mean "don't output any<br>
table environment", but it does not behave that way. Perhaps worth an<br>
enhancement request to the kableExtra authors? Note that with xtable you<br>
can achieve this with the argument "floating = FALSE". Perhaps<br>
kable_styling has a way to do it but I couldn't find it.<br>
<br>
In any case, does that "hack" work for you? In case my instructions<br>
above are not clear, I attach the .lyx file with the change. I went with<br>
the first suggested change (using "centering"), but the second one<br>
(using "@empty") might be better. If one doesn't work, try the other.<br>
<br>
Scott<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr">R. Douglas Martin<div>Professor Emeritus in Applied Mathematics and Statistics</div><div>Founder and Former Director of MS-CFRM Program</div><div><a href="http://depts.washington.edu/compfin/" target="_blank">depts.washington.edu/compfin/</a></div><div>University of Washington</div></div></div></div>