marp-team / marp-vscode

Marp for VS Code: Create slide deck written in Marp Markdown on VS Code
https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode
MIT License
1.55k stars 72 forks source link

Theme class 'lead' and 'invert' not working when export to pdf and pptx #425

Open foryoung365 opened 1 year ago

foryoung365 commented 1 year ago

Version of Marp Tool

marp-vscode 2.6.0

Operating System

Windows

Environment

vs code about: Version: 1.79.2 (system setup) Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06 Date: 2023-06-14T08:57:04.379Z Electron: 22.5.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

How to reproduce

---
marp: true
theme: default
class: 
    - lead
    - invert
---

# Use your own theme

=========== save above as test.md, export to pdf or pptx

Expected behavior

image work like preview

Actual behavior

image

Additional information

No response

yhatt commented 1 year ago

I could not reproduce that. A provided Markdown exports the correct output with inverted color scheme, just like this PDF. (Note: lead class is not supported in default theme, and it is only available in gaia theme)

We need more information to debug. e.g. the output of console in the VS Code's developer tools while exporting

foryoung365 commented 1 year ago

image

here is the output of the dev tools, but it seems eveything is ok.

test.pdf

I also upload the output pdf file, hope this will help. If any other debug info needed, please let me know.

foryoung365 commented 1 year ago

I tried upgrade node.js to v18.16.1, and use marp-cli to convert to pptx directly, and it doesn't work neither. image test.pptx

yhatt commented 1 year ago

How about if specified just a string as class, instead of YAML array?

---
marp: true
theme: default
class: invert
---

# Use your own theme

This expects exactly same result as YAML array version.

foryoung365 commented 1 year ago

How about if specified just a string as class, instead of YAML array?

---
marp: true
theme: default
class: invert
---

# Use your own theme

This expects exactly same result as YAML array version.

I have tried this, but it don't work either. And I also tried exporting to every format marp supported, all of them produce the incorrect result except html.

yhatt commented 1 year ago

Please check whether installing the latest version of Google Chrome. If not, try to export after updating Chrome into 115.

If you had installed very old version of Chrome, slide variants by class might not work while exporting PDF, due to unsupported modern CSS (:where selector is supported in Chrome 88 and later).

foryoung365 commented 1 year ago

image

chrome version is 115.0.5790.170.

yhatt commented 1 year ago

If you were using Chrome Enterprise, some features for printing PDF correctly might be restricted by the enterprise policy. For example, if PrintingAllowedBackgroundGraphicsModes policy is set as "disabled", PDF may not reproduce the expected color in the slide.

You can check whether managed by the enterprise in chrome://management, and can peek the current policy in chrome://policy. You may have to request to change policy into your administrator as needed.

foryoung365 commented 1 year ago

image

It seems like there is no activated policy in chrome://policy/.