Skip to content
Discussion options

You must be logged in to vote

You have many typos and unnecessary options at least in your example.

  • YAML style option for R/Python code cell is #| not # |.
  • You should not define key without value, i.e., docx: .
  • keep-tex is not relevant for docx.

if you want to use knitr/reticulate for Python code without R code cells, as said by Carlos, you need to explicitly set the engine.

Fixing everything and make it small works just fine:

---
format: docx
engine: knitr
---

```{python}
#| label: python libraries
from pyprojroot.here import here
```  

```{python}
#| label: tbl-rates
#| tbl-cap: Just a caption.
#| file: n_treatments.py
```

Just a statement to reference the values shown in @tbl-rates.
import pandas as pd
from ta…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@KipBalkcom-USDA
Comment options

@mcanouil
Comment options

Answer selected by KipBalkcom-USDA
@KipBalkcom-USDA
Comment options

Comment options

You must be logged in to vote
2 replies
@KipBalkcom-USDA
Comment options

@KipBalkcom-USDA
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants