marp-team/marpit

Changing to 4:3 slide

Closed this issue · 2 comments

Hi, this is maybe not an issue. But it really troubles me as:

  • in old Marp, i can change slide size by using $size: 4:3.
  • now, I have been trying the new Marpit on VScode and web app. And, I have noticed that changing slide size need to be done by defining height and width of root section tag in style. well, the output result is like below.
    screenshot 2019-05-16 pm 11 06 58
    It left a blank space on the right that I don't know how to remove. I have tried exporting as pdf, html, and image. Is there something that I have done wrong, or ... ?
  • Using traditional 4:3 slide is quite important to me, as this is the only display ratio that I can have in workplace.
yhatt commented

Slide size cannot change via inline style. It comes from Marpit's technical restriction.
https://marpit.marp.app/theme-css?id=slide-size

Using custom theme CSS can do it. This is an example changing slide size to 4:3 based on uncover theme by community.
https://github.com/ttyskg/marp-themes/blob/master/themes/css/uncover43.css

And Marp CLI allows using custom theme. Please try this on CLI tool:

marp --theme default43.css your-markdown.md --pdf
/* default43.css */
@import 'default';

section {
  width: 960px;
  height: 720px;
}

Marp Web and Marp for VS Code does not yet support custom theme, sorry.

Slide size cannot change via inline style. It comes from Marpit's technical restriction.
https://marpit.marp.app/theme-css?id=slide-size

Using custom theme CSS can do it. This is an example changing slide size to 4:3 based on uncover theme by community.
https://github.com/ttyskg/marp-themes/blob/master/themes/css/uncover43.css

And Marp CLI allows using custom theme. Please try this on CLI tool:

marp --theme default43.css your-markdown.md --pdf
/* default43.css */
@import 'default';

section {
  width: 960px;
  height: 720px;
}

Marp Web and Marp for VS Code does not yet support custom theme, sorry.

Yes, I've got it. And, it brings me another thing that, well, I am looking forward to the VS Code support, so that I could use live preview while I am trying out css code. Using Marp CLI can give me 4:3, but also extended my workflow as it requires terminal every time I change even a small piece of code. And, by the way, I use Marp for a very long training material, let's say about 100 slides.

Anyway, I will keep looking on how can I convert my old css file used in old Marp. in the meantime, still, looking forward to critical update on Marp Next. Thanks again.