I figures out some more details and according to your request from here quarto-dev/quarto-cli#4340 (comment) I will open this issue:
To get code highlighting in HTML AND PDF I have to include the code file with different path:
`
::: {.content-visible when-format="html"}
```{.c include="../code/test.c"}
```
:::
::: {.content-visible when-format="pdf"}
```{.c include="./code/test.c"}
```
:::
`
On this way I get the code highlighting in html and pdf.
I attached the complete test project.
GBSSG_Skripte_030_Physik.zip
Quarto Version: 1.2.334 with installed include-code-files extension.
Thank you very much for your help
regards
Mike