Open KevinShook opened 9 months ago
The lack of syntax coloring in pdf is by design; we are using the most common formatting for code output in the case of code listings. If you want listings to be formatted in a particular way, you can use the div syntax for listings, separate from the code cell:
::: {#lst-setpaths}
```{.r}
output_path <- "output/"
figure_path <- "figures/"
Set file paths. The paths will need to be edited for your system.
:::
That will get the formatting.
The docx centering issue is a bug. I'll check when I have a computer with Office available.
Looks like the example from the manual doesn't work either though, or rather the 2nd one works (fenced div), but not the 1st one. It is a bit difficult to see with the sql code (for some reason the highlighting is quite subtle), but if you add some python code it all becomes obvious:
cat test.qmd
```{#lst-customers .python lst-cap="Customers Query"}
1 + 1
Then we query the customers database (@lst-customers).
::: {#lst-customers}
1 + 1
Customers Query
:::
1+1
SELECT * FROM Customers
Then we query the customers database (@lst-customers).
::: {#lst-customers}
SELECT * FROM Customers
Customers Query
:::
touch _quarto.yml quarto render quarto render --to docx quarto render --to pdf
[test.docx](https://github.com/quarto-dev/quarto-cli/files/14316844/test.docx)
[test.pdf](https://github.com/quarto-dev/quarto-cli/files/14316845/test.pdf)
docx and PDF have the problem (no highlighting for Listing 1 and 3; have highlighting for listing 2 and 4 ), HTML is fine.
Quarto 1.4.550.
I've noticed the centering too, that didn't happen with Quarto 1.3, 1.4 inserts a table now with 'w:jc .. center'
Bug description
When using lst-label and lst-cap, the formatting of R chunks is messed up.
When rendering to a pdf, the code is ugly (no syntax coloring, or background shading) but acceptable. When rendering to a .docx, the code is worse. It is centered, rather than being left-justified, there is no syntax coloring, although the background is shaded. In the docx file, the code is shown as using the "Source Code" style, but the style settings are over-ridden The messed up docx occurs whether or not a template docx file is used.
Steps to reproduce
This one does not